本地路由器
HTTP-SSE聚合多个MCP服务器的本地路由器
聚合多个MCP服务器的本地路由器
This project is an MCP (Model Context Protocol) local router that serves as an aggregation proxy for MCP servers. It can connect to multiple upstream MCP servers and aggregate their functionalities into a single interface for downstream clients.
/sse and per-upstream /sse/{serverName} endpointsIt must be run with a configuration file:
cargo run -- --config mcp-config.json --transport sse
When the router runs with --transport sse, it exposes two kinds of endpoints:
/sse streams the aggregated tool surface area from every configured upstream server./sse/{serverName} streams only the tools from a single upstream. The {serverName} segment must match the key from mcpServers in your configuration file (for example /sse/filesystem or /sse/workspace-search).The server name keys should be URL-safe because they are used directly as path segments.
Each SSE connection emits an initial endpoint event containing the HTTP path clients should use for POST requests. All streaming endpoints share the same POST /message?sessionId=… channel.
The configuration file is in JSON format; an example is shown below:
{ "mcpServers": { "filesystem": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-filesystem", "/Users/username/Desktop" ], "env": { "LINEAR_ACCESS_TOKEN": "your_personal_access_token" } }, "workspace-search": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-everything" ], "env": {} } } }
Description:
/sse/{serverName} path)# Build the project cargo build --release # Run cargo run --release -- --config mcp-config.json --transport stdio