feat: stdio MCP wrapper for managed tool sidecars (#179)#180
Merged
feat: stdio MCP wrapper for managed tool sidecars (#179)#180
Conversation
Add `claw-mcp-stdio` shared wrapper image that exposes a stdio MCP server
behind a pod-internal Streamable HTTP /mcp endpoint compatible with the
v0.11.0 cllama MCP client. New pod surfaces:
- `x-claw.mcp-stdio: {command, args}` declares the child command; compose
emission injects CLAW_MCP_STDIO_COMMAND/ARGS on the wrapper service.
- `x-claw.describe-file` lets operators supply a deterministic v2
descriptor snapshot from the pod directory (highest-priority descriptor
source ahead of image/build-context discovery).
Wrapper handles initialize caching, MCP-Session-Id minting/validation,
JSON-RPC id multiplexing, child restart with exponential backoff, and
optional bearer auth. Stdio creds stay in wrapper env. Hermetic spike
TestSpikeMCPStdio brings up wrapper + cllama + agent in Docker. cllama
is unchanged.
Closes #179
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
ghcr.io/mostlydev/claw-mcp-stdiowrapper image so any stdio MCP server (npx packages, uvx, anything stdio JSON-RPC) can be exposed as a pod-internal Streamable HTTP/mcpendpoint compatible with the v0.11.0 cllama MCP client. No cllama changes.x-claw.mcp-stdio: {command, args}declares what the wrapper spawns; compose emission injectsCLAW_MCP_STDIO_COMMAND/ARGSon the sidecar. New pod surfacex-claw.describe-filelets operators supply a deterministic v2 descriptor snapshot from the pod directory.initializecaching,MCP-Session-Idminting/validation, JSON-RPC id multiplexing, child restart with exponential backoff, and optional bearer auth. Stdio creds (e.g.PERPLEXITY_API_KEY) stay in the wrapper container env, never reach agent containers.TestSpikeMCPStdiobrings up the full stack (wrapper + cllama + clawdash + agent) in Docker against an in-tree Node echo MCP server. Real-worldexamples/perplexity-stdio/template included.Plan: docs/plans/2026-04-28-issue-179-stdio-mcp-wrapper.md
Closes #179
Test plan
go vet ./...go vet -tags spike ./...go test ./...go test -tags integration ./...go test -tags spike -run TestSpikeMCPStdio ./cmd/claw/...(22s, full Docker pod)TestSpikeRollCallregression (deferred to release flow — needs live Discord/provider creds)