MCP Local Router
by kaichen
The MCP Local Router acts as an aggregation proxy for MCP servers, connecting to multiple upstream servers and providing a single interface for downstream clients. It simplifies interaction with multiple MCP servers by consolidating their functionalities.
Last updated: N/A
What is MCP Local Router?
The MCP Local Router is an aggregation proxy for MCP (Model Context Protocol) servers. It allows you to connect to multiple upstream MCP servers and expose their combined functionalities through a single, unified interface for downstream clients.
How to use MCP Local Router?
To use the MCP Local Router, you need to build the project using cargo build --release
. Then, run it with a configuration file using the command cargo run --release -- --config mcp-config.json
. The configuration file (e.g., mcp-config.json
) specifies the upstream MCP servers, their commands, arguments, and environment variables.
Key features of MCP Local Router
Supports specifying a configuration file via command line arguments
Supports configuring multiple upstream MCP servers
Supports stdio transport
Supports injecting environment variables into stdio transport
Use cases of MCP Local Router
Aggregating multiple MCP servers into a single endpoint
Simplifying access to multiple MCP server functionalities for downstream clients
Centralizing configuration and management of MCP server connections
Creating a unified interface for interacting with different MCP server implementations
FAQ from MCP Local Router
What is MCP?
What is MCP?
MCP stands for Model Context Protocol.
How do I configure the upstream MCP servers?
How do I configure the upstream MCP servers?
You configure the upstream MCP servers in the configuration file (e.g., mcp-config.json
). This file specifies the command, arguments, and environment variables for each server.
What transport methods are supported?
What transport methods are supported?
The MCP Local Router supports stdio transport.
Can I inject environment variables into the upstream MCP servers?
Can I inject environment variables into the upstream MCP servers?
Yes, you can inject environment variables into the stdio transport of the upstream MCP servers using the env
field in the configuration file.
What are the dependencies?
What are the dependencies?
The project depends on Rust 2021 Edition, tokio async runtime, and MCP-related libraries: mcp-client, mcp-core, mcp-server, mcp-spec.