
Supergateway runs MCP stdio-based servers over SSE (Server-Sent Events) or WebSockets (WS) with one command. This is useful for remote access, debugging, or connecting to clients when your MCP server only supports stdio.
Supported by Supermachine (hosted MCPs), Superinterface, and Supercorp.
Run Supergateway via npx:
npx -y supergateway --stdio "uvx mcp-server-git"--stdio "command": Command that runs an MCP server over stdio--sse "https://mcp-server-ab71a6b2-cd55-49d0-adba-562bc85956e3.supermachine.app": SSE URL to connect to (SSE→stdio mode)--streamableHttp "https://mcp-server.example.com/mcp": Streamable HTTP URL to connect to (StreamableHttp→stdio mode)--outputTransport stdio | sse | ws | streamableHttp: Output MCP transport (default:ssewith--stdio,stdiowith--sseor--streamableHttp)--port 8000: Port to listen on (stdio→SSE or stdio→WS mode, default:8000)--baseUrl "http://localhost:8000": Base URL for SSE or WS clients (stdio→SSE mode; optional)--ssePath "/sse": Path for SSE subscriptions (stdio→SSE mode, default:/sse)--messagePath "/message": Path for messages (stdio→SSE or stdio→WS mode, default:/message)--streamableHttpPath "/mcp": Path for Streamable HTTP (stdio→Streamable HTTP mode, default:/mcp)--stateful: Run stdio→Streamable HTTP in stateful mode--sessionTimeout 60000: Session timeout in milliseconds (stateful stdio→Streamable HTTP mode only)--header "x-user-id: 123": Add one or more headers (stdio→SSE, SSE→stdio, or Streamable HTTP→stdio mode; can be used multiple times)--oauth2Bearer "some-access-token": Adds anAuthorizationheader with the provided Bearer token--logLevel debug | info | none: Controls logging level (default:info). Usedebugfor more verbose logs,noneto suppress all logs.--cors: Enable CORS (stdio→SSE or stdio→WS mode). Use--corswith no values to allow all origins, or supply one or more allowed origins (e.g.--cors "http://example.com"or--cors "/example\\.com$/"for regex matching).--healthEndpoint /healthz: Register one or more endpoints (stdio→SSE or stdio→WS mode; can be used multiple times) that respond with"ok"
Expose an MCP stdio server as an SSE server:
npx -y supergateway \
--stdio "npx -y @modelcontextprotocol/server-filesystem ./my-folder" \
--port 8000 --baseUrl http://localhost:8000 \
--ssePath /sse --messagePath /message- Subscribe to events:
GET http://localhost:8000/sse - Send messages:
POST http://localhost:8000/message
Connect to a remote SSE server and expose locally via stdio: