feat(mcp): support http and sse MCP server transports#2208
Open
cfis wants to merge 1 commit intoqwibitai:mainfrom
Open
feat(mcp): support http and sse MCP server transports#2208cfis wants to merge 1 commit intoqwibitai:mainfrom
cfis wants to merge 1 commit intoqwibitai:mainfrom
Conversation
Contributor
Author
|
Note for maintainer: |
Widens McpServerConfig to a discriminated union that mirrors the four
transports the Claude Agent SDK already supports:
type: 'stdio' (default) — { command, args?, env? }
type: 'http' — { url, headers? } (Streamable HTTP)
type: 'sse' — { url, headers? } (Server-Sent Events)
Stdio entries without an explicit `type` continue to work as before, so
no existing `container.json` files need to change.
For HTTP and SSE the agent-runner just hands the config through to the
SDK as-is; the SDK does the actual transport setup. No change to host
orchestration, no Dockerfile change, no new dependencies.
Touches:
- src/container-config.ts (host) — type widened, instructions? kept
on every variant (claude-md-compose reads it from any MCP entry).
- container/agent-runner/src/providers/types.ts — provider-side type
widened to match.
- container/agent-runner/src/config.ts — RunnerConfig.mcpServers now
references the union type instead of an inline stdio shape.
- container/agent-runner/src/index.ts — startup log handles all three
variants (stdio prints command, http/sse print URL).
Why: this lets an MCP server live outside the agent container — on the
host, in a sidecar container, or as a hosted service — addressed by URL
instead of as a subprocess. Useful for any MCP server whose runtime
needs aren't a fit for the agent container (e.g. credentials that the
agent shouldn't see, OS-specific dependencies, processes that should
outlive a single agent session). Concrete near-term motivation:
servers that talk raw TCP+TLS protocols (IMAP, SMTP, Postgres, Redis)
where credential injection has to happen at the protocol layer rather
than at the HTTPS proxy OneCLI provides; running those out-of-container
keeps the secrets out of the agent's namespace.
2ab5a16 to
fd46e11
Compare
This was referenced May 6, 2026
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.
Type of Change
.claude/skills/<name>/, no source changes)Description
Widens
McpServerConfigfrom a stdio-only shape to a discriminated union that mirrors the transports the Claude Agent SDK already supports:type: 'stdio'(default) —{ command, args?, env? }(existing behavior, unchanged)type: 'http'—{ url, headers? }(Streamable HTTP)type: 'sse'—{ url, headers? }(Server-Sent Events)Stdio entries without an explicit
typecontinue to work — no existingcontainer.jsonfiles need to change.For HTTP and SSE the agent-runner hands the config straight through to the SDK; the SDK handles the transport. No host-orchestrator change, no Dockerfile change, no new dependencies.
Motivation
Today every MCP server is a subprocess of the agent container. That's fine for servers whose runtime fits cleanly in-container, but it ties some configurations to the agent's namespace that don't need to be there. The HTTP/SSE transports let an MCP server live outside the agent container — on the host, in a sidecar container, or as a hosted service — addressed by URL.
The concrete near-term use case is MCP servers that talk raw TCP+TLS protocols (IMAP, SMTP, Postgres, Redis, etc.) where credentials must be injected at the protocol layer (HTTPS-proxy approaches like OneCLI don't help). Running such a server out-of-container keeps the credentials out of the agent's environment without requiring NanoClaw to grow protocol-specific proxying.
Files
src/container-config.ts— host type widened.instructions?kept on every variant;claude-md-compose.tsalready reads it from any MCP entry.container/agent-runner/src/providers/types.ts— provider-side type widened to match.container/agent-runner/src/config.ts—RunnerConfig.mcpServersreferences the union type instead of an inline stdio shape.container/agent-runner/src/index.ts— startup log line handles all three variants (stdio prints command, http/sse print URL).Possible follow-up
This PR only widens the type so externally-hosted MCP servers can be addressed. If there's interest, I can follow up with a separate PR that also lets
container.jsondeclare how a sidecar MCP server is launched and managed (a sidecars block: image, env, lifecycle, networking) so NanoClaw can spawn and reap them alongside the agent container, instead of leaving that to the operator.Note on CI failure
The two failing tests in
src/host-sweep.test.ts(resetStuckProcessingRows — orphan claim cleanup) are not caused by this PR. Verified by running them against pristineupstream/maincode with none of this PR's changes applied — both fail identically. They're a regression from #2183 (theopenOutboundDbRwreopen path doesn't match the in-memory test DB) that I will fix in a different PR.