Repository navigation
feat: add MCP server support - #44
Merged
Merged
Conversation
Connect stdio and streamable HTTP MCP servers from the mcpServers settings block or --mcp-config, and expose their tools as mcp__<server>__<tool>. Servers start in parallel before the first request so the tool set stays fixed; a server that fails or exits never stops the session. MCP tools ask for confirmation by default, and /mcp lists server state and tools. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… redaction - Project .sc/settings.json servers start only with --trust-project-mcp or a user-level trustedMcpProjects entry; untrusted values are never expanded. - Stdio servers start with an env allowlist plus their own env. - /mcp and errors show the config as written; substituted values are scrubbed. - McpHub::shutdown closes connections and kills each server's process group or job; dropping the hub kills too. - Docs: -p needs an allow rule; servers run outside the Bash sandbox. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
- SIGINT/SIGTERM/SIGHUP (Ctrl-C, Ctrl-Break, console close on Windows) shut down every MCP server, restore the terminal and exit with 128+signal. - Linux servers get PR_SET_PDEATHSIG=SIGKILL. - Secrets are also scrubbed in percent-encoded form and line by line. - Install the ring rustls provider before rmcp builds its HTTP client, which otherwise panicked on connect; a panicked connect now shows as failed. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…nal exit - The fixture also serves stateless streamable HTTP; an integration test lists and calls tools over it with a configured Authorization header. - Each graceful shutdown step now takes at most 1 s, and the signal path kills every process tree before exiting, whatever the graceful pass did. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
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.
Summary
Implements the M9 MCP client that
rc-mcpreserved.mcpServersblock insettings.json, the same shape as Claude Code and Cursor, plus repeatable--mcp-config <file-or-json>and--strict-mcp-configfor harnesses.${VAR}and${VAR:-default}expand from the environment, so secrets stay out of settings files. Project settings replace user settings per server, andnullremoves one.rmcp3.5, Apache-2.0, MSRV 1.88). TLS reuses the workspace's rustls + ring stack (reqwest-tls-no-provider), so no second crypto provider or C toolchain is added. Legacy SSE is refused with a message pointing to streamable HTTP.Toolnamedmcp__<server>__<tool>, sanitized to the provider's 64-character[a-zA-Z0-9_-]. Tools runSerialWriteand get the usual tool-result cap.defaultandacceptEditsand are denied inplan, likeBash. Rules accept a full tool name ormcp__<server>for a whole server./mcplists each server's state, transport, tools and last stderr line.docs/CONFIGURATION.md, README, ARCHITECTURE and CHANGELOG.Test plan
${VAR}expansion, wire names, schema normalization, result rendering, settings layering, permission rules.crates/rc-mcp/tests/fixture, a test-only bin): listing and calling,isError, a server crashing mid-call, a server failing at startup next to a healthy one, a missing binary, per-call timeout and cancellation.cargo fmt --check,cargo +1.99.0 clippy --workspace --all-targets -D warnings,cargo test --workspace(585 passed),cargo +1.89.0 checkfor both workspaces.marathon -p ... --mcp-config mcp.json --strict-mcp-configonsubconscious/glm-5.3-marathon. The model calledmcp__fx__echo {"text": "marathon-mcp-ok"}and returnedecho: marathon-mcp-ok.🤖 Generated with Claude Code