A Model Context Protocol (MCP) server that bridges multiple MCP servers with HTTP/SSE transport support and LLM-powered tool orchestration.
- Node.js 18+
- Anthropic API key
npm install
npm run build
# Stdio mode (for Claude Desktop/Cursor)
ANTHROPIC_API_KEY=your-key npm start
# HTTP mode (for web apps/remote access)
TRANSPORT_TYPE=http HTTP_PORT=3001 ANTHROPIC_API_KEY=your-key npm startPerfect for Claude Desktop, Cursor, and other MCP clients:
# Start server
ANTHROPIC_API_KEY=your-key npm start
# Test with echo
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | npm startFor web applications and remote clients:
# Start HTTP server
TRANSPORT_TYPE=http HTTP_PORT=3001 ANTHROPIC_API_KEY=your-key npm start
# Test health endpoint
curl http://localhost:3001/health
# Create SSE connection
curl -H "Accept: text/event-stream" http://localhost:3001/mcp/sse/my-session
# Send JSON-RPC request
curl -X POST http://localhost:3001/mcp \
-H "Content-Type: application/json" \
-H "x-session-id: my-session" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'Add to your claude_desktop_config.json:
{
"mcpServers": {
"mcp-bridge": {
"command": "node",
"args": ["/path/to/mcp-bridge/dist/index.js"],
"env": {
"ANTHROPIC_API_KEY": "your-key"
}
}
}
}Add to your workspace settings:
{
"mcp.servers": {
"mcp-bridge": {
"command": "node",
"args": ["/path/to/mcp-bridge/dist/index.js"],
"env": {
"ANTHROPIC_API_KEY": "your-key"
}
}
}
}Create mcp-wrapper-config.json:
{
"servers": [
{
"name": "filesystem",
"transport": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/files"]
}
},
{
"name": "github",
"transport": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "your-token"
}
}
},
{
"name": "postgres",
"transport": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres"],
"env": {
"POSTGRES_CONNECTION_STRING": "postgresql://user:pass@localhost:5432/db"
}
}
}
],
"toolGroups": {
"development": {
"description": "Development workflow tools",
"servers": ["filesystem", "github"]
},
"data": {
"description": "Data analysis and database operations",
"servers": ["postgres"]
}
}
}Or configure via environment:
export MCP_SERVERS='[
{
"name": "brave-search",
"transport": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-brave-search"],
"env": {"BRAVE_API_KEY": "your-key"}
}
}
]'GET /health- Server health statusGET /mcp/sessions- List active sessionsGET /mcp/sse/:sessionId- Server-Sent Events connectionPOST /mcp- JSON-RPC requests (requiresx-session-idheader)DELETE /mcp/session/:sessionId- Close session
// Connect to SSE
const eventSource = new EventSource('http://localhost:3001/mcp/sse/my-session');
eventSource.onmessage = (event) => {
const data = JSON.parse(event.data);
console.log('Response:', data);
};
// Send request
fetch('http://localhost:3001/mcp', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-session-id': 'my-session'
},
body: JSON.stringify({
jsonrpc: '2.0',
id: 1,
method: 'tools/call',
params: {
name: 'list_tool_groups',
arguments: {}
}
})
});list_tool_groups- Discover available tool groupsget_health_status- Server health and metricsget_server_stats- Detailed server statisticscheck_ticket- Monitor operation progresslist_tickets- View operation history- Dynamic Tool Groups - LLM-generated groups based on discovered tools
βββββββββββββββ βββββββββββββββ βββββββββββββββ
β Client β β MCP Bridge β β MCP β
β(Claude/Web) βββββΊβ Server βββββΊβ Servers β
βββββββββββββββ βββββββββββββββ βββββββββββββββ
β
ββββββββ΄βββββββ
β LLM β
βCoordination β
βββββββββββββββ
- Multi-transport support - stdio, HTTP, SSE
- Session management - Track context across requests
- Tool orchestration - LLM-powered tool coordination
- Health monitoring - Real-time status and metrics
- Graceful shutdown - Clean resource management
# Install dependencies
npm install
# Development mode
npm run dev
# Build
npm run build
# Run tests
npm test
# E2E tests
npm run test:e2eMIT License
Developed with assistance from Claude Code (Anthropic) - an AI-powered development environment that helped architect, implement, and test this MCP bridge server.
Connect multiple MCP servers with modern transport protocols