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)--outputTransport stdio | sse | ws
: Output MCP transport (default:sse
with--stdio
,stdio
with--sse
)--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
)--logLevel info | none
: Controls logging level (default:info
). Usenone
to suppress all logs.--cors
: Enable CORS (stdio→SSE or stdio→WS mode)--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:
npx -y supergateway --sse "https://mcp-server-ab71a6b2-cd55-49d0-adba-562bc85956e3.supermachine.app"
Useful for integrating remote SSE MCP servers into local command-line environments.
Expose an MCP stdio server as a WebSocket server:
npx -y supergateway \
--stdio "npx -y @modelcontextprotocol/server-filesystem ./my-folder" \
--port 8000 --outputTransport ws --messagePath /message
- WebSocket endpoint:
ws://localhost:8000/message
- Run Supergateway:
npx -y supergateway --port 8000 \
--stdio "npx -y @modelcontextprotocol/server-filesystem /Users/MyName/Desktop"
- Use MCP Inspector:
npx @modelcontextprotocol/inspector
You can now list tools, resources, or perform MCP actions via Supergateway.
Use ngrok to share your local MCP server publicly:
npx -y supergateway --port 8000 \
--stdio "npx -y @modelcontextprotocol/server-filesystem ."
# In another terminal:
ngrok http 8000
ngrok provides a public URL for remote access.
A Docker-based workflow avoids local Node.js setup. A ready-to-run Docker image is available here: supercorp/supergateway. Also on GHCR: ghcr.io/supercorp-ai/supergateway
docker run -it --rm -p 8000:8000 supercorp/supergateway \
--stdio "npx -y @modelcontextprotocol/server-filesystem /" \
--port 8000
Docker pulls the image automatically. The MCP server runs in the container’s root directory (/
). You can mount host directories if needed.
Use provided Dockerfile:
docker build -t supergateway .
docker run -it --rm -p 8000:8000 supergateway \
--stdio "npx -y @modelcontextprotocol/server-filesystem /" \
--port 8000
Claude Desktop can use Supergateway’s SSE→stdio mode.
{
"mcpServers": {
"supermachineExampleNpx": {
"command": "npx",
"args": [
"-y",
"supergateway",
"--sse",
"https://mcp-server-ab71a6b2-cd55-49d0-adba-562bc85956e3.supermachine.app"
]
}
}
}
{
"mcpServers": {
"supermachineExampleDocker": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"supercorp/supergateway",
"--sse",
"https://mcp-server-ab71a6b2-cd55-49d0-adba-562bc85956e3.supermachine.app"
]
}
}
}
Model Context Protocol standardizes AI tool interactions. Supergateway converts MCP stdio servers into SSE or WS services, simplifying integration and debugging with web-based or remote clients.
Supergateway emphasizes modularity:
- Automatically manages JSON-RPC versioning.
- Retransmits package metadata where possible.
- stdio→SSE or stdio→WS mode logs via standard output; SSE→stdio mode logs via stderr.
- Superargs - provide arguments to MCP servers during runtime.
Issues and PRs welcome. Please open one if you encounter problems or have feature suggestions.