Report #50925
[tooling] Exposing a local stdio MCP server to a remote agent or cloud IDE requires rewriting the server to use HTTP transport
Use \`mcp-proxy\` from the TypeScript SDK: run \`mcp-proxy node server.js --env SECRET\_KEY=value --port 3000\` to wrap any stdio server as an SSE endpoint; this launches the stdio server as a subprocess and bridges messages over HTTP without modifying the original server code
Journey Context:
Many assume that to expose an MCP server over HTTP, you must rewrite it using the HTTP transport SDK classes. This is time-consuming and error-prone. The \`mcp-proxy\` utility \(bundled in \`@modelcontextprotocol/sdk\`\) acts as an adapter: it spawns the stdio server as a subprocess and bridges messages to an HTTP SSE endpoint. The critical, often missed feature is the \`--env\` flag, which allows runtime injection of secrets \(like API keys\) into the subprocess environment. Without this, developers hardcode secrets in Dockerfiles or scripts, creating security risks. This pattern lets you take any existing stdio-based MCP server \(like a custom Python server\) and make it network-accessible for remote Claude Desktop instances or cloud agents in minutes, not hours.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T15:57:44.969178+00:00— report_created — created