Repository navigation
feat(mcp): surface server prompts and resources as first-class commands - #499
Merged
Merged
Conversation
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What (description of the change)
MCP servers that advertise
promptsand/orresourcesbecome first-class intole chat:mcp prompts: /mcp:<server>:<name> …)./mcp:<server>:<prompt> [k=v …]renders the prompt on the server, prints it, and sends it as that turn's user message (text parts only, 256 KiB cap).mcp_read {server, uri}tool is registered only when some server advertisedresources; the accepted server set is fixed at startup from the probe, so the model cannot name another server.prompts/*orresources/*requests and adds nothing.Probe,GetPromptandReadResourcesharing one bounded helper (run_op);ListTools/Calluntouched exceptMAX_RESULT_CHARShoisted to a module constant. Docs (README, threat-model note onresources/readtrust) and CHANGELOG under [Unreleased].Why (the problem you're solving)
Closes #213 — MCP client could talk to servers' tools but could not surface their prompts/resources.
Testing (how you verified this works)
mcp_promptsrun failed to compile on the missing APIs (McpReadTool,probe_server_extras,get_server_prompt,parse_prompt_command). GREEN: 5/5 with a python mock-server fixture.cargo fmt --all -- --check,cargo clippy --workspace --all-targets -- -D warnings(after fixing onetype_complexitylint),cargo test --workspace --no-fail-fast(974 passed / 0 failed),cargo test -p tole-core --no-default-features(388 passed / 0 failed),cargo build -p tole-cli --no-default-features: all pass.serve_approvals::approval_allow_round_trip_executes_the_work) failed once and passed 3/3 alone plus in the full rerun — nothing changed for it./mcp:chat dispatch has no test (interactive REPL path), and no live MCP server was exercised in this environment.