Expose HTTP request headers (e.g. Posit Connect user session token) to tools
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
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
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của posit-dev/mcptools
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Tất cả issue của posit-dev/mcptools
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
atomashevic/transforEmotion#46 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Error when applying yearCohorts() to a cohort created with generateTargetDenominatorCohortSet()Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
OHDSI/CohortConstructor#777 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
nmfs-ost/stockplotr#445 · 2 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Use renv::installĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
UCL-ARC/r-intermediate-good-practices#37 ·
Maintainer thường phản hồi trong vòng 2 ngày