Skip to content

feat(mcp): surface server prompts and resources as first-class commands - #499

Merged
ajianaz merged 1 commit into
developfrom
feat/mcp-prompts
Nov 3, 2026
Merged

ajianaz merged 1 commit into
developfrom
feat/mcp-prompts

Conversation

@ajianaz

@ajianaz ajianaz commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

What (description of the change)

MCP servers that advertise prompts and/or resources become first-class in tole chat:

  • Prompts: servers advertising prompts are listed at startup (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).
  • Resources: a ReadOnly mcp_read {server, uri} tool is registered only when some server advertised resources; the accepted server set is fixed at startup from the probe, so the model cannot name another server.
  • Probe-first: a server with neither capability never sees prompts/* or resources/* requests and adds nothing.
  • Plumbing: the reactor gains Probe, GetPrompt and ReadResource sharing one bounded helper (run_op); ListTools/Call untouched except MAX_RESULT_CHARS hoisted to a module constant. Docs (README, threat-model note on resources/read trust) 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)

  • RED: the first mcp_prompts run 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 one type_complexity lint), 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.
  • Known limitation, recorded in the code and deferred: prompt argument values cannot contain spaces (no quoting). One workspace flake (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.
  • UNVERIFIED: the /mcp: chat dispatch has no test (interactive REPL path), and no live MCP server was exercised in this environment.

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

@ajianaz
ajianaz merged commit c1f18cd into develop Nov 3, 2026
16 checks passed
@ajianaz
ajianaz deleted the feat/mcp-prompts branch November 3, 2026 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP client: surface server prompts (+resources read) as quick commands

1 participant