Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#136 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
r
Lĩnh vực
backend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
R
Star
203
Fork
23
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của posit-dev/mcptools

Tất cả issue của posit-dev/mcptools

Issue tương tự

Thêm issue về R

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.