RFD: MCP meta server - #269
Open
Fluzko wants to merge 35 commits into
Open
Conversation
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.
MCP meta-server
Symposium now registers one MCP server with your agent instead of one per plugin. It exposes two tools:
list_tools(what's reachable here) andexecute(run JavaScript with those tools in scope).A script composes several calls and returns only what matters, so intermediate data never reaches the agent's context.
What's in this PR
cargo agents mcp-serve: one"symposium"entry in agent config, replacing per-plugin entriesdepends-onholdslist_toolsanswers with an index; full TypeScript declarations behind a filter ordetail: "full"tscin CICargo.lockchanges; running servers are carried acrossNot built: cancellation, progress notifications,
tools/list_changed, an on-disk tool cache. HTTP/SSE backing servers are refused — stdio only.Using it
Configure
A plugin declares the servers it provides:
namebecomes the global a script calls (filesystem.read_text_file(...)).depends-ongates the whole entry: this server exists only in workspaces thatdepend on
serde.command/argsare the child process.Then:
That writes a single entry into your agent's MCP config, whatever the agent:
{ "mcpServers": { "symposium": { "command": "cargo-agents", "args": ["mcp-serve"] } } }The filesystem server is not in there. Nothing about it reaches the agent until
something asks.
Interact
Nothing changes in how you talk to your agent. You ask for what you want:
The agent sees two tools, calls
list_toolsfor signatures, then sends oneexecutewith a program like:What the server does with it
depends-onholds.filesystemin the sandbox as a proxy. No child process yet.await filesystem.list_directory({ path: "/tmp/data" }).That suspends it and crosses to the host, which runs the manifest's command --
npx -y @modelcontextprotocol/server-filesystem /tmp/data-- completes the MCP handshake, and checkslist_directoryagainst that server's realtools/list.tools/call, unwraps the result, resumes the script.executeresult.The two file bodies are read at step 5, inside the sandbox. Only the matching
names come back, proxying one tool call at a time would have pulled every
file's contents through the agent's context.
A server the script never names is never started. Servers shut down when the
session ends.
Configuration
[mcp]in~/.symposium/config.toml, all optional.script-timeout-secs(120),script-memory-limit-mb(64),max-result-bytes(32768),max-server-restarts(5),read-only(false), and a few more.max-tool-calls,server-startup-timeout-secsandtool-call-timeout-secsparse but are not honored yet; startup and call timeouts are fixed at 30s and 60s. Per-server overrides on[[mcp_servers]]do work.Design rationale: the RFD.
AI disclosure.
Questions for reviewers.