Supergateway is a command-line utility designed to bridge Model Context Protocol (MCP) stdio-based servers with network transports like Server-Sent Events (SSE), WebSockets (WS), and Streamable HTTP, and vice versa. It enables remote access, debugging, and client connectivity for MCP servers that primarily support stdio. The current stable version is 3.4.3. The project demonstrates a relatively active release cadence, with several minor updates and a significant rollback release (v3.4.0) to address stability issues from v3.3.0. Its key differentiator is providing a flexible gateway for various MCP communication patterns, facilitating integration of local stdio services into web-based or distributed systems. It supports both stateless and stateful operations for Streamable HTTP, and offers configurable concurrency for stdio-to-SSE gateways.
npm install supergatewayVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to run Supergateway to expose a local stdio-based Model Context Protocol (MCP) server as an SSE endpoint, allowing remote clients to interact with it via HTTP.
Avoid using v3.3.0. Upgrade to v3.4.0 or any subsequent stable release (e.g., >=3.4.0) to benefit from the rollback and improved stability.
Use the `--cors` flag. For all origins, simply use `--cors`. For specific origins, specify them (e.g., `--cors "http://example.com"`). Regex patterns are also supported.
Start with default concurrency (1) and increase incrementally while monitoring server stability and resource usage. Refer to the `--minConcurrency` and `--maxConcurrency` flags in the documentation.
For bearer tokens, use `--oauth2Bearer "your-token"`. For other headers, use `--header "X-Custom-Header: value"`. Multiple `--header` flags can be used.
Specify an unused port using the `--port` flag (e.g., `npx supergateway --port 8001 ...`) or identify and terminate the process currently using the port.
Verify that Supergateway is running, listening on the expected `--port` and `--baseUrl` (if specified). Check for any active firewalls or network configurations that might be preventing client connections.
Ensure the command you pass to `--stdio` (e.g., `uvx mcp-server-git`, `node my-server.js`) is correctly spelled, executable, and present in your system's PATH. Test the command independently in your shell.