Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Expose HTTP request headers (e.g. Posit Connect user session token) to tools

Aperta
#136 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
r
Ambito
backend

Direzione di ricerca

Start by reading the mcptools server request handling and tool invocation code to see where incoming HTTP headers can be passed into a tool call. The issue suggests either an injected reserved argument or a request-scoped accessor, with concurrent calls and clear behavior outside a request as key constraints. Done means tools can read the triggering request headers safely, including the Posit Connect session token.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

When an mcptools server is deployed to Posit Connect, tools have no way to read the incoming HTTP request. In particular, they can't read the HTTP_POSIT_CONNECT_USER_SESSION_TOKEN within the request header. Connect uses the token for viewer-based credentials, so without it a tool can't make downstream requests, such as database queries, as the calling user. It can only use the credentials of the deployed process.

Feature request:
Could mcptools provide a supported way for a tool to read the headers of the request that triggered it? This would make viewer-based credentials usable in tools deployed to Connect.

Implementation thoughts:

  • A reserved argument (e.g. .request) that mcptools injects and omits from the JSON schema seems the safest option. The value is passed directly into one call, so it can't leak between calls and doesn't depend on which mcptools version is loaded.
  • An accessor such as mcptools::mcp_request_headers(), valid only during tool execution, would also work. It would need to be stable across versions and fail clearly when called outside a request.
  • I would avoid a global option or env var. Both are process-wide, so concurrent or async tool calls could see each other's tokens. Env vars are also inherited by child processes.

I'm happy to help test and might also be able to contribute a PR.

Lingua principale
R
Stelle
204
Fork
23
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di posit-dev/mcptools

Tutte le issue di posit-dev/mcptools

Issue simili

Altre issue su R

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.