SuperGateway is a powerful gateway tool that converts standard input/output (stdio) into Server-Sent Events (SSE). It allows you to run stdio-based MCP (Model Context Protocol) servers and access them remotely via SSE. This project is particularly useful for AI gateway implementations, enabling seamless communication between clients and MCP servers.
shell
cd src/java
mvn clean package
shell
java -jar target/supergateway-1.0.0.jar [options]
--version
: Display the version number--stdio
: Command to run the MCP server--sse
: SSE URL connection address--port
: (stdio→SSE) Server listening port [default: 8000]--baseUrl
: (stdio→SSE) Base URL for SSE clients--ssePath
: (stdio→SSE) SSE subscription path [default: "/sse"]--messagePath
: (stdio→SSE) SSE message path [default: "/message"]--logLevel
: Set the log level: "info" or "none" [default: "info"]--cors
: Enable CORS [default: false]--healthEndpoint
: Add health check endpoints, separated by commas--help
: Display help informationjava -jar target/supergateway-1.0.0.jar \
--stdio "java -jar your-mcp-server.jar" \
--port 8000 \
--baseUrl http://localhost:8000 \
--ssePath /sse \
--messagePath /message
GET /sse
POST /message?sessionId=<session_id>
application/json
200
: Message sent successfully400
: Invalid JSON message503
: Session does not exist or process is not readyGET /health
(if health check endpoints are configured)sessionId
sessionId
obtained from the SSE connection must be usedSuperGateway is designed to run MCP stdio servers over SSE and SSE over stdio, serving as an AI gateway for efficient communication.