Run MCP stdio servers over SSE and WS for remote access, debugging, and seamless integration
Supergateway is a powerful tool designed to facilitate advanced integration and remote access capabilities for Model Context Protocol (MCP)-based servers. By leveraging either Server-Sent Events (SSE) or WebSockets (WS), it enables seamless communication between AI applications running on remote servers and local clients, enhancing both debugging and deployment processes.
Supergateway stands out by offering a versatile approach to MCP server management. It supports the conversion of stdio-based MCP servers into SSE or WebSocket services, making them accessible from web-based or remote clients. This integration not only simplifies setup but also streamlines real-time data exchange, enabling developers and users to interact with AI applications more efficiently.
The architecture of Supergateway is built around the Model Context Protocol (MCP), which standardizes interactions between different components in an AI application. By using Supergateway, you can seamlessly connect your stdio-based MCP servers to remote clients over SSE or WebSocket protocols.
graph TD
A[AI Application] -->|MCP Client| B[MCP Protocol]
B --> C[MCP Server]
C --> D[Data Source/Tool]
style A fill:#e1f5fe
style C fill:#f3e5f5
style D fill:#e8f5e8
graph TD
A[Metadata] --> B[JSON-RPC Requests]
B --> C[MCP Server]
C --> D[Data Source/Tool]
E[Cached Responses] --> F[AI Application]
style A fill:#e1f5fe
style B fill:#e8f5e8
style C fill:#f3e5f5
style D fill:#e6ffe4
style E fill:#eff7f3
style F fill:#fcf0b2
Installing Supergateway is straightforward, especially when utilizing npx
. To get started, follow these steps:
Install Supergateway:
npx -y supergateway --stdio "uvx mcp-server-git"
Understanding the Command Line Flags:
--stdio "command"
: Specify the command for an MCP server that runs over stdio.--sse "https://mcp-server-ab71a6b2-cd55-49d0-adba-562bc85956e3.supermachine.app"
: URL of the SSE endpoint to connect to (SSE→stdio mode).--outputTransport stdio | sse | ws
: Configure the output transport mechanism.--port 8000
: Port for listening when converting from stdio to SSE or WS mode.--baseUrl "http://localhost:8000"
: Base URL for SSE clients (stdio→SSE mode).--ssePath "/sse"
: Path for SSE subscriptions.--messagePath "/message"
: Path for message handling.npx -y supergateway --stdio "uvx mcp-server-git" --outputTransport sse --port 8001 --baseUrl http://localhost:8001 --ssePath /local-sse-endpoint
npx -y supergateway --stdio "uvx mcp-server-git" --outputTransport ws --port 8002 --baseUrl http://localhost:8003 --messagePath /ws-messages
Supergateway opens up numerous possibilities for integrating AI applications into complex workflows. Here are two real-world use cases:
Supergateway can enable real-time handling of prompts from AI models by converting a local stdio-based MCP server to an SSE service. This setup allows the AI model to receive prompt requests and return responses in near-real time, enhancing interaction efficiency.
{
"mcpServers": {
"prompt-Handler": {
"command": "npx -y @modelcontextprotocol/prompt-handler",
"env": {
"API_KEY": "your-api-key"
}
}
}
}
By integrating Supergateway with data sources, AI applications can fetch and process synchronized data in a seamless manner. This setup ensures that the data remains up-to-date and relevant for the AI models.
Supergateway is compatible with major MCP clients such as Claude Desktop, Continue, and Cursor. The following matrix outlines their current support:
MCP Client | Resources | Tools | Prompts | Status |
---|---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ | Full Support |
Continue | ✅ | ✅ | ✅ | Full Support |
Cursor | ❌ | ✅ | ❌ | Tools Only |
This compatibility ensures that Supergateway can support a wide range of AI applications, making it easier for developers to build robust integrations.
Supergateway is designed with performance and compatibility in mind. Here’s an overview of its key features:
To configure Supergateway effectively, you can use the following code sample:
{
"mcpServers": {
"[server-name]": {
"command": "npx -y @modelcontextprotocol/server-[name]",
"args": ["-o", "127.0.0.1:8090"],
"env": {
"API_KEY": "your-api-key"
}
}
}
}
Supergateway also provides robust security features, allowing you to configure custom authentication and authorization mechanisms.
Supergateway offers enhanced flexibility by converting local stdio-based servers into SSE or WebSocket services for remote interaction.
Yes, Supergateway supports multiple AI applications, including Continue and Cursor. Ensure to check the compatibility matrix for specific features.
Environment variables are crucial for providing necessary credentials and configurations. Use them wisely to avoid hardcoding sensitive information.
Supergateway retransmits package metadata where possible, ensuring that critical data remains intact during transmission.
While most clients can be fully supported through compatibility matrix updates, some might require custom API integration. Reach out to the Supergateway community for assistance.
Contributions are welcome in the form of issues and pull requests. To get started, follow these steps:
git clone
.Stay updated with the latest developments in the Model Context Protocol ecosystem through official documentation, forums, and community contributions:
By leveraging Supergateway, developers can build more robust and scalable AI applications that integrate seamlessly with various MCP clients, enhancing their overall functionality and usability.
This comprehensive guide to Supergateway positions it as a valuable tool for AI application development, emphasizing its core features, use cases, and integration capabilities. The detailed content ensures thorough coverage while remaining engaging and understandable for technical audiences.
RuinedFooocus is a local AI image generator and chatbot image server for seamless creative control
Build stunning one-page websites track engagement create QR codes monetize content easily with Acalytica
Learn to set up MCP Airflow Database server for efficient database interactions and querying airflow data
Simplify MySQL queries with Java-based MysqlMcpServer for easy standard input-output communication
Access NASA APIs for space data, images, asteroids, weather, and exoplanets via MCP integration
Explore CoRT MCP server for advanced self-arguing AI with multi-LLM inference and enhanced evaluation methods