SuperAPIAI Directory

mcp-proxy

github.com · AI developer platforms

mcp-proxy is a proxy tool written in TypeScript for converting MCP servers based on stdio transport into services accessible via streamable HTTP and SSE. It enables CORS by default and supports configuration, can simultaneously serve the 2026-07-28 and 2025-era protocol versions, supports API Key authentication, stateless mode, event storage, and reconnection after disconnection, and is suitable for scenarios that need to expose local stdio MCP servers to remote or browser clients.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsAPI

About this tool

mcp-proxy is a streamable HTTP and SSE proxy written in TypeScript, used to expose MCP servers that use stdio transport as network endpoints. FastMCP uses it to enable streamable HTTP and SSE.

Purpose and main capabilities

  • Proxy stdio MCP servers as streamable HTTP (default /mcp) and SSE (default /sse) endpoints; both transports are enabled by default, and only one can be enabled via --server.
  • CORS is enabled by default, and the allowed request headers can be adjusted via programming options or --corsAddAllowedHeader.
  • The same endpoint simultaneously serves protocol revision 2026-07-28 and the 2025-era revisions (2024-10-07 to 2025-11-25). Each POST request is classified by its content: those with a _meta envelope are handled as 2026-07-28, otherwise the 2025-era session mechanism is used.
  • Progress notifications and cancellation can be passed bidirectionally across the proxy; forwarded calls carry the caller's abort signal, and relayed progress is re-labeled with the token sent by the caller.
  • The upstream connection negotiates the protocol revision independently, using the 2025 initialize handshake by default; --upstreamProtocol auto can be used to probe server/discover first, or modern to force it.
  • Supports optional API Key authentication (X-API-Key header), with /ping and OPTIONS preflight exempt.
  • Supports --stateless stateless mode, where each request creates a new server instance, suitable for serverless platforms and load-balanced deployments; this mode only affects the /mcp endpoint.
  • Supports resumable event storage (--eventStore, enabled by default), so clients can replay missed messages after reconnecting, and the maximum number of events retained per session can be configured.
  • Provides configuration items such as connection timeout, request timeout, keep-alive timeout, session idle timeout, and request body size limit.
  • Experimental forwarding of the webhook and poll parts of the MCP Events extension, effective only when the upstream declares the corresponding extension capability; the push delivery mode is not supported.

Usage Start via the command line, for example starting tsx server.js via stdio and serving on 8/mcp and /sse on port 080. The -- separator is optional and is used to distinguish mcp-proxy's own options from the command to be launched. Common options include --port, --server, --endpoint, --sseEndpoint, --streamEndpoint, --stateless, --modern/--no-modern, --upstreamProtocol, --connectionTimeout, --requestTimeout, --keepAliveTimeout, --sessionIdleTimeout, --eventStore, --eventStoreMaxEvents, --maxBodySize, --debug, --shell, --apiKey, --sslCa, --sslCert, --sslKey, --corsAddAllowedHeader.

Use cases Suitable for developers who need to expose a local stdio MCP server to remote clients, browser clients, or load-balanced/serverless environments, and also suitable for deployments that need to be compatible with both old and new protocol clients.

Limitations and caveats

  • The proxy multiplexes each downstream connection onto a single upstream connection, so it does not forward capabilities that require requesting input from the client (elicitation, sampling, roots).
  • Log messages on both sides of a 2026-07-28 connection are not forwarded; logging/setLevel is only answered and honored per downstream connection and is not passed upstream.
  • The client identity seen by the upstream is mcp-proxy itself, not the downstream caller.
  • startStdioServer only serves 2025-era clients; 2026-07-28 is provided only via HTTP endpoints.
  • The /sse endpoint uses the frozen legacy HTTP+SSE transport, which has been deprecated since 2026-07-28 and has a twelve-month migration window; clients are advised to migrate to the streamable HTTP endpoint.
  • MCP Events is an experimental forwarding feature and is not SEP-3415 compliant; webhooks are POSTed directly by the upstream to the URL provided by the caller, and the proxy does not receive them, validate keys, or store subscriptions; all downstream callers appear to the upstream as the same principal.
  • When using --apiKey, production environments shouldprovide the service over HTTPS.
  • If a Python stdio server experiences ping timeouts, run Python in unbuffered mode and send diagnostic information to stderr.
Up/Down to navigate · Enter to open · ESC to closeBrowse all tools