Repository navigation
rhizome mcp serve (v0.13.0 Track 89) - #40
Merged
Merged
Conversation
Rhizome can now act as an MCP server over stdio: `rhizome mcp serve`
exposes allowlisted local tools to any MCP client, daemonless and
gated by tools.mcp_server = {enabled:false, allow:[...]} — disabled
and deny-all by default.
- pkg/mcp/server.go: SDK server on StdioTransport; Rhizome tool
schemas become MCP input schemas; tool errors return in-band
(IsError + text); stdin EOF is a clean shutdown.
- agent.BuildMCPServeToolRegistry: standalone registry (files/exec/
web/hardware) against agents.defaults.workspace with the usual
restrict_to_workspace/allow-paths rules. Agent-loop tools are
unregistrable by construction, so the allowlist cannot name them.
- serve command drains the stdout-bound console logger to stderr
before config load and suppresses the banner via
stdioProtocolCommand — stdout stays protocol-pure, same as acp.
- Fixes a pre-existing migration crash: loadConfigMap now folds all
.security.yml tools.* subsections (mcp/browser/media/web3, not just
web/skills) back under tools for V0-V2 config loads.
Validated end-to-end over real stdio: initialize, tools/list honoring
the allowlist, unknown-tool rejection, workspace-restriction errors
in-band, clean EOF exit.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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
rhizome mcp serveruns Rhizome as an MCP server over stdio — any MCP client (Claude Desktop, Cursor, another agent) can list/call allowlisted local tools. Daemonless; requirestools.mcp_server.enabled.pkg/mcp/server.gobridgesToolRegistryontomodelcontextprotocol/go-sdk(StdioTransport): tool parameters become input schemas,ToolResultbecomes text content withIsErrorin-band, stdin EOF is a clean shutdown.agent.BuildMCPServeToolRegistrybuilds a standalone registry (files/exec/web/hardware) honoringtools.<name>.enabled,restrict_to_workspace, and allow-path rules againstagents.defaults.workspace. Agent-loop tools (delegate,acp_run, swarm verbs,message/send_*,spawn) are never registered, so the allowlist can't name them.stdioProtocolCommand, console logger drained to stderr before config load (same rule asrhizome acp)..security.ymlstorestools.*secrets top-level, butloadConfigMaponly foldedweb/skillsback undertools—mcp/browser/media/web3secrets leaked as unknown top-level fields during V0–V2 migration. Now all supported subsections fold back (with a regression test).Test plan
go build -tags goolm,stdjson ./...go test -tags goolm,stdjson ./pkg/config/... ./pkg/mcp/... ./pkg/agent/... ./cmd/rhizome/...golangci-lint run --build-tags goolm,stdjson— 0 issues (v2.13.2)scripts/lint-docs.sh— OKpkg/mcp/track89_test.go)tools/listallowlist-only, unknown tool → protocol error, out-of-workspace call → in-band error, stdin EOF → exit 0, stdout protocol-pureGenerated with Devin