Document the HTTP shared-secret and trusted-hosts options of mcp_server(type = "http"), or add arguments for them
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 73/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- r
- Domain
- documentation
Research direction
Read the mcp_server help page, server vignette, README, and NEWS; the issue says none currently documents these options. Check the existing test-server.R coverage for mcptools.http_shared_secret to confirm the behavior and header name. Document the supported options, including the exact Host match with port, and make clear which settings are supported.
Written by the indexing model from the issue text.
Description
Hi, and thanks for mcptools.
putior is on CRAN; its development version (to be released as 0.2.0) adds putior_mcp_server(), which can serve putior's tools over HTTP with mcptools::mcp_server(type = "http"). putior sets one of two options before calling it:
- With a token (putior requires one when the server listens on a non-loopback address), putior sets
mcptools.http_shared_secret;handle_http_request()then requires the headerPlumber-Shared-Secret. - Without a token (loopback only): putior adds the loopback names to
mcptools.http_trusted_hosts, whichhandle_http_request()compares with theHostheader as written, in addition to your Origin check.
Both options came with the Posit Connect engine (#106). The code that reads them is unchanged from 1.0.0 to 1.0.3 and on main (714803b), and test-server.R covers mcptools.http_shared_secret as an override of plumber2.sharedSecret. But none of ?mcp_server, the server vignette, the README or NEWS mentions them; ?mcp_server documents MCPTOOLS_PORT and MCPTOOLS_SOCKET_DIR, but not these.
If a later release read other settings, a putior server started with a token would answer requests that lack it, without an error. putior therefore sends mcptools' internal handle_http_request() test requests at start-up, and does not start unless the requests without the right secret or from an untrusted Host get 401/403 and a valid one does not. We would rather depend on a documented interface.
Would you consider one of these?
- Documenting
mcptools.http_shared_secretandmcptools.http_trusted_hostsin?mcp_server, with the header name and the exact Host match (port included).MCPTOOLS_HTTP_TRUSTED_HOSTS,mcptools.http_allowed_originsandMCPTOOLS_HTTP_ALLOWED_ORIGINScould go there too, if you want them supported. - Or arguments such as
mcp_server(..., shared_secret = NULL, trusted_hosts = NULL). - If these options are likely to change, a NEWS entry when they do would already help.
Happy to send a PR for the documentation.
- Dominant language
- R
- Stars
- 207
- Forks
- 24
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from posit-dev/mcptools
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 20/100
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
All issues in posit-dev/mcptools
Similar issues
-
num_ode_rk4_adaptive rejects atol = 0 while accepting rtol = 0 and while num_ode_dopri5 accepts bothOpenarea/ode-pde good first issue help wanted kind/contract severity/4-minor
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Apich-Organization/rssn#383 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
AlexsLemonade/scpca-nf#1384 ·
-
Order the VignettesOpen
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day