Bridge stdio-based Claude Desktop with HTTP/SSE MCP servers using MCP Server Gateway for seamless communication
The MCP (Model Context Protocol) Server Gateway acts as a protocol translator, allowing Claude Desktop App to communicate seamlessly with any HTTP/SSE-based MCP server that currently only supports stdio. Originally designed for Claude Desktop, this solution ensures compatibility by converting stdio input and output into protocol-compatible formats.
The core features of the MCP Server Gateway include:
The protocol flow works as follows:
graph TD
A[AI Application] -->|MCP Client| B[MCP Gateway API]
B --> C[MCP Server]
C --> D[Data Source/Tool]
style A fill:#e1f5fe
style C fill:#f3e5f5
style D fill:#e8f5e8
MCP Client | Resources | Tools |
---|---|---|
Claude Desktop | ✅ | ✅ |
Continue | ✅ | ✅ |
Cursor | ❌ | ✅ |
Install MCP Server Gateway globally using npm:
npm install -g @mcphub/gateway
After installation, find where npm installed the gateway using these commands:
# This shows the root directory of global packages
npm root -g
# The gateway will be located at:
<npm_global_root>/@mcphub/gateway/dist/src/mcphub-gateway.js
Common global package locations include:
/opt/homebrew/lib/node_modules/@mcphub/gateway/dist/src/mcphub-gateway.js
/usr/local/lib/node_modules/@mcphub/gateway/dist/src/mcphub-gateway.js
%AppData%\npm\node_modules\@mcphub\gateway\dist\src\mcphub-gateway.js
Verify the installation:
npm list -g @mcphub/gateway
Update your Claude Desktop configuration file (~/Library/Application Support/Claude Desktop/config.json
on macOS) to include this configuration:
{
"mcpServers": {
"server-name": {
"command": "node",
"args": ["/opt/homebrew/lib/node_modules/@mcphub/gateway/dist/src/mcphub-gateway.js"]
}
}
}
Replace the path in args
with your actual path found in step 1.
# Set the MCP server URL (optional)
export MCP_SERVER_URL=https://your-mcp-server.com/api/mcp
By default, it connects to the MCP Hub server at https://server.mcphub.ai/api/mcp
.
Imagine an application using MCP Server Gateway to process real-time data streams. As new data arrives at an HTTP/SSE endpoint, it's translated into stdio commands for Claude Desktop to execute, and the results are then conveyed back through the gateway.
{
"mcpServers": {
"data-processing-server": {
"command": "node",
"args": ["/path/to/mcphub-gateway.js"],
"env": {
"API_KEY": "your-api-key"
}
}
}
}
Another use case involves integrating a large knowledge base with Claude Desktop. By configuring the gateway to connect to an HTTP/SSE API that hosts the knowledge base, users can seamlessly query and retrieve information from Claude Desktop.
Currently supported MCP clients include:
Client | Resources | Tools | Prompts |
---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ |
Continue | ✅ | ✅ | ✅ |
Cursor | ❌ | ✅ | ❌ |
Q: Can I use this gateway with other AI applications besides Claude Desktop?
Q: What are the known limitations of using this gateway?
Q: How can I troubleshoot connection issues?
Q: Can I use a custom MCP server setup instead of the default one?
MCP_SERVER_URL
environment variable or configuring it directly in your Claude Desktop settings.Q: Is this gateway suitable for Production environments?
Contributions to improve and expand the functionality are welcome. Please follow these guidelines:
Explore more about the broader MCP ecosystem at MCPhub, where you'll find resources and tools to enrich your AI development journey.
This comprehensive documentation highlights the capabilities, installation process, and use cases of the MCP Server Gateway while ensuring it remains closely aligned with the provided README content.
Learn to connect to MCP servers over HTTP with Python SDK using SSE for efficient protocol communication
Next-generation MCP server enhances documentation analysis with AI-powered neural processing and multi-language support
Python MCP client for testing servers avoid message limits and customize with API key
Discover easy deployment and management of MCP servers with Glutamate platform for Windows Linux Mac
Expose Chicago Public Schools data with a local MCP server accessing SQLite and LanceDB databases
Learn how to use MCProto Ruby gem to create and chain MCP servers for custom solutions