feat: add stdio-proxy command for HTTP-to-stdio MCP bridging#14
Draft
wasaga wants to merge 2 commits into
Draft
Conversation
Add a new `stdio-proxy` command that launches a stdio MCP server subprocess and exposes it via HTTP streaming. This enables stdio-only MCP servers to be accessed over HTTP. Features: - Subprocess lifecycle management with graceful shutdown - Automatic capability discovery and forwarding (tools, prompts, resources) - Request/response logging (summaries at info, full JSON-RPC at debug) - Terminal-aware logging (text for TTY, JSON for daemon mode) - Concurrent request handling with shared subprocess - Health checking with 503 responses when subprocess is unavailable - Support for notification handlers (tool/prompt/resource list changes) The implementation uses the official MCP Go SDK's CommandTransport for subprocess communication and StreamableHTTPHandler for HTTP serving. Tests use in-memory transports for fast, reliable execution without spawning actual subprocesses.
Add comprehensive tests for: - Logging notifications (server -> client) - Sampling/CreateMessage requests (server -> client -> server) - Elicitation requests (server -> client -> server) - Error handling when handlers are not configured These tests verify that the ProcessManager correctly wires up notification handlers and forwards bidirectional MCP messages.
b1ec08b to
be3446b
Compare
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
stdio-proxycommand that launches a stdio MCP server subprocess and exposes it via HTTP streamingTest plan
Usage