Price Per TokenPrice Per Token

Gateway MCP Server

by supercorp-ai

0

About

Supergateway bridges transport protocols for MCP servers, enabling bidirectional conversion between stdio, SSE (Server-Sent Events), WebSockets, and Streamable HTTP. It exposes local MCP stdio servers over network protocols for remote access, or connects to remote SSE/Streamable HTTP endpoints and proxies them locally over stdio for debugging and development. Key capabilities: - Convert MCP stdio servers to SSE, WebSocket, or Streamable HTTP endpoints with configurable ports, base URLs, and path routes - Reverse proxy mode: connect to remote SSE servers and expose them locally over stdio - Support for custom headers, OAuth2 Bearer tokens, and CORS configuration - Health check endpoints and session timeout configuration for stateful Streamable HTTP connections - Compatible with hosted MCP platforms including Supermachine, Superinterface, and Supercorp

README

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.

Installation & Usage

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: sse with --stdio, stdio with --sse or --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 an Authorization header with the provided Bearer token
  • --logLevel debug | info | none: Controls logging level (default: info). Use debug for more verbose logs, none to suppress all logs.
  • --cors: Enable CORS (stdio→SSE or stdio→WS mode). Use --cors with 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"
  • stdio → SSE

    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
  • SSE → stdio

    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.

    You can also pass headers when sending requests. This is useful for authentication:

    npx -y supergateway \
        --sse "https://mcp-server-ab71a6b2-cd55-49d0-adba-562bc85956e3.supermachine.app" \
        --oauth2Bearer "some-access-token" \
        --header "X-My-Header: another-header-value"
    

    Streamable HTTP → stdio

    Connect to a remote Streamable HTTP server and expose locally via stdio:

    npx -y supergateway --streamableHttp "https://mcp-server.example.com/mcp"
    

    This mode is useful for connecting to MCP servers that use the newer Streamable HTTP transport protocol. Like SSE mode, you can also pass headers for authentication:

    npx -y supergateway \
        --streamableHttp "https://mcp-server.example.com/mcp" \
        --oauth2Bearer "some-access-token" \
        --header "X-My-Header: another-header-value"
    

    stdio → Streamable HTTP

    Expose an MCP stdio server as a Streamable HTTP server.

    Stateless mode

    npx -y supergateway \
        --stdio "npx -y @modelcontextprotocol/server-filesystem ./my-folder" \
        --outputTransport streamableHttp \
        --port 8000
    

    Stateful mode

    npx -y supergateway \
        --stdio "npx -y @modelcontextprotocol/server-filesystem ./my-folder" \
        --outputTransport streamableHttp --stateful \
        --sessionTimeout 60000 --port 8000
    

    The Streamable HTTP endpoint defaults to http://localhost:8000/mcp (configurable via --streamableHttpPath).

    stdio → WS

    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
  • Example with MCP Inspector (stdio → SSE mode)

    1.

    Related MCP Servers

    AI Research Assistant

    AI Research Assistant

    hamid-vakilzadeh

    AI Research Assistant provides comprehensive access to millions of academic papers through the Semantic Scholar and arXiv databases. This MCP server enables AI coding assistants to perform intelligent literature searches, citation network analysis, and paper content extraction without requiring an API key. Key features include: - Advanced paper search with multi-filter support by year ranges, citation thresholds, field of study, and publication type - Title matching with confidence scoring for finding specific papers - Batch operations supporting up to 500 papers per request - Citation analysis and network exploration for understanding research relationships - Full-text PDF extraction from arXiv and Wiley open-access content (Wiley TDM token required for institutional access) - Rate limits of 100 requests per 5 minutes with options to request higher limits through Semantic Scholar

    Web & Search
    12 8
    Linkup

    Linkup

    LinkupPlatform

    Linkup is a real-time web search and content extraction service that enables AI assistants to search the web and retrieve information from trusted sources. It provides source-backed answers with citations, making it ideal for fact-checking, news gathering, and research tasks. Key features of Linkup: - Real-time web search using natural language queries to find current information, news, and data - Page fetching to extract and read content from any webpage URL - Search depth modes: Standard for direct-answer queries and Deep for complex research across multiple sources - Source-backed results with citations and context from relevant, trustworthy websites - JavaScript rendering support for accessing dynamic content on JavaScript-heavy pages

    Web & Search
    2 24

    context7

    huynguyen03dev

    5