8000 rhizome mcp serve (v0.13.0 Track 89) by stpinkie · Pull Request #40 · stpinkie/rhizome · GitHub
[go: up one dir, main page]

Skip to content

rhizome mcp serve (v0.13.0 Track 89) - #40

Merged
stpinkie merged 1 commit into
mainfrom
devin/track-89-mcp-serve
Sep 23, 2026
Merged

stpinkie merged 1 commit into
mainfrom
devin/track-89-mcp-serve

Conversation

@stpinkie
Copy link
Copy Markdown
Owner

Summary

  • rhizome mcp serve runs Rhizome as an MCP server over stdio — any MCP client (Claude Desktop, Cursor, another agent) can list/call allowlisted local tools. Daemonless; requires tools.mcp_server.enabled.
  • pkg/mcp/server.go bridges ToolRegistry onto modelcontextprotocol/go-sdk (StdioTransport): tool parameters become input schemas, ToolResult becomes text content with IsError in-band, stdin EOF is a clean shutdown.
  • agent.BuildMCPServeToolRegistry builds a standalone registry (files/exec/web/hardware) honoring tools.<name>.enabled, restrict_to_workspace, and allow-path rules against agents.defaults.workspace. Agent-loop tools (delegate, acp_run, swarm verbs, message/send_*, spawn) are never registered, so the allowlist can't name them.
  • stdout stays protocol-pure: banner suppressed via stdioProtocolCommand, console logger drained to stderr before config load (same rule as rhizome acp).
  • Also fixes a pre-existing migration crash: .security.yml stores tools.* secrets top-level, but loadConfigMap only folded web/skills back under tools — mcp/browser/media/web3 secrets 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 — OK
  • In-memory SDK client↔server e2e (pkg/mcp/track89_test.go)
  • Real stdio smoke: initialize, tools/list allowlist-only, unknown tool → protocol error, out-of-workspace call → in-band error, stdin EOF → exit 0, stdout protocol-pure

Generated with Devin

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>
@stpinkie
stpinkie merged commit 18ddeda into main Sep 23, 2026
13 checks passed
@github-actions github-actions Bot added the docs label Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0