Universal transport bridge for Model Context Protocol (MCP) - connect stdio-based MCP clients to remote servers over HTTP/SSE.
MCP Bridge solves a common integration challenge: MCP clients like Claude Desktop expect stdio connections, but many MCP servers run remotely over HTTP/SSE. This bridge sits in the middle, translating between these protocols seamlessly.
[Claude Desktop/MCP Client] <--stdio--> [MCP Bridge] <--HTTP/SSE--> [Remote MCP Server]
- Connect Claude Desktop to remote/containerized MCP servers
- Access cloud-hosted MCP services from local clients
- Bridge to MCP servers behind authentication
- Enable any stdio-based MCP client to use HTTP/SSE servers
pip install mcp-bridge
pip install uv
uv pip install mcp-bridge
git clone https://github.com/geosp/mcp-bridge.git
cd mcp-bridge
uv pip install -e .
After installation, verify it's working:
mcp-bridge --version
Create your first config file:
mcp-bridge init
This creates ~/.config/mcp-bridge/config.json
with an example configuration.
Edit the config file with your server details:
# macOS/Linux
vi ~/.config/mcp-bridge/config.json
# Or use your preferred editor
code ~/.config/mcp-bridge/config.json
Configuration format:
{
"url": "http://your-mcp-server.example.com/mcp-endpoint",
"headers": {
"Authorization": "Bearer your-token-here"
}
}
Configuration Options:
url
(required): The HTTP/SSE endpoint of your remote MCP serverheaders
(optional): HTTP headers to include with requests (e.g., authentication tokens)
Test your configuration with a simple initialize request:
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}' | mcp-bridge
You should see a JSON response from your server.
You can configure multiple servers with named configs:
# Create configs for different servers
mcp-bridge init --name weather
mcp-bridge init --name database
mcp-bridge init --name analytics
# List all configs
mcp-bridge list-configs
# Use a specific config
mcp-bridge --config weather.json
- First, create and configure your bridge config:
mcp-bridge init
# Edit ~/.config/mcp-bridge/config.json with your server details
- Add this to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"remote-server": {
"command": "mcp-bridge",
"args": []
}
}
}
- Restart Claude Desktop
For multiple remote servers:
- Create named configs for each server:
mcp-bridge init --name weather
mcp-bridge init --name database
# Edit each config file with appropriate server details
- Update Claude Desktop config:
{
"mcpServers": {
"weather-server": {
"command": "mcp-bridge",
"args": ["--config", "weather.json"]
},
"database-server": {
"command": "mcp-bridge",
"args": ["--config", "database.json"]
}
}
}
- Restart Claude Desktop
Each bridge instance will connect to its configured remote server independently.
- Stdio Interface: Listens for JSON-RPC messages from Claude Desktop on stdin
- HTTP Translation: Forwards requests to the remote MCP server via HTTP POST
- SSE Streaming: Reads Server-Sent Events responses from the HTTP connection
- Session Management: Maintains session IDs across requests
- Response Forwarding: Writes responses back to stdout for the client
┌─────────────────┐
│ Claude Desktop │
│ (MCP Client) │
└────────┬────────┘
│ stdio (JSON-RPC)
│
┌────────▼────────┐
│ MCP Bridge │
│ - Read stdin │
│ - HTTP client │
│ - SSE parser │
│ - Write stdout │
└────────┬────────┘
│ HTTP/SSE
│
┌────────▼────────┐
│ Remote MCP │
│ Server │
└─────────────────┘
See the examples/
directory for sample configurations:
examples/local-server.json
- Connect to a local MCP serverexamples/authenticated-server.json
- Server with bearer token authexamples/claude-desktop-config.json
- Claude Desktop configuration
- Check that
config.json
exists and has valid JSON - Verify the
url
is accessible from your machine - Check logs in stderr for error messages
- Ensure your
Authorization
header token is valid - Check if the token has expired
- Verify the token format matches server expectations
- Verify
mcp-bridge
is in your PATH:which mcp-bridge
- If using a virtual environment, use the full path:
{ "mcpServers": { "remote-server": { "command": "/full/path/to/mcp-bridge", "args": [] } } }
- Check Claude Desktop logs for error messages
# Check what configs exist
mcp-bridge list-configs
# Create a new config if needed
mcp-bridge init
The bridge logs to stderr. Claude Desktop captures these logs. You can also test manually:
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}' | mcp-bridge 2> bridge.log
# Show version
mcp-bridge --version
# Initialize a new config
mcp-bridge init
mcp-bridge init --name myserver
# List all configs
mcp-bridge list-configs
# Run with default config
mcp-bridge
# Run with specific config
mcp-bridge --config weather.json
- WebSocket transport support
- Multiple server configurations (completed in v0.2.0)
- Request/response logging options
- Retry logic and connection pooling
- Health check endpoints
- TLS/SSL certificate configuration
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
MIT License - see LICENSE file for details.
- Model Context Protocol - Official MCP documentation
- Claude Desktop - Anthropic's desktop client
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: docs.claude.com