kaichen_mcp_local_router

kaichen_mcp_local_router

by kaichen
An MCP local router that aggregates multiple MCP servers into a single interface for downstream clients.

MCP Local Router for Server Aggregation

Overview

The MCP Local Router is a powerful aggregation proxy designed to connect multiple upstream MCP (Model Context Protocol) servers and consolidate their functionalities into a single interface for downstream clients. This tool simplifies the management of multiple MCP servers, making it an essential component for developers working with distributed systems.

Features

  • Configuration File Support: Specify a configuration file via command line arguments.
  • Multiple Upstream Servers: Configure and manage multiple upstream MCP servers.
  • Stdio Transport: Supports stdio transport for seamless communication.
  • Environment Variables Injection: Inject environment variables into stdio transport for enhanced flexibility.

Usage

Running the Router

To run the MCP Local Router, you must provide a configuration file:

cargo run -- --config mcp-config.json

Configuration File Format

The configuration file is in JSON format. Below is an example:

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "/Users/username/Desktop"
      ],
      "env": {
        "LINEAR_ACCESS_TOKEN": "your_personal_access_token"
      }
    },
    "everything": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-everything"
      ],
      "env": {}
    }
  }
}

Description:
- mcpServers: A mapping of multiple server configurations.
- Each key is the server's name (used for logging).
- Each value is an object containing:
- command: The command to execute.
- args: An array of command arguments.
- env: A mapping of environment variables to inject.

Build and Installation

To build and install the MCP Local Router, follow these steps:

# Build the project
cargo build --release

# Run the router
cargo run --release -- --config mcp-config.json

Dependencies

  • Rust 2021 Edition
  • tokio async runtime
  • MCP-related libraries: mcp-client, mcp-core, mcp-server, mcp-spec

About

The MCP Local Router is an essential tool for developers looking to aggregate multiple MCP servers into a single, manageable interface. It is designed to simplify the complexities of working with distributed systems, providing a streamlined and efficient solution.

Resources

Stars

4 stars

Watchers

1 watching

Forks

1 fork

Report repository

Releases

No releases published

Packages 0

No packages published

Languages

Features & Capabilities

Categories
mcp_server model_context_protocol rust api_integration aggregation_proxy

Implementation Details

Stats

0 Views
4 GitHub Stars

Repository Info

kaichen Organization

Similar MCP Servers

continuedev_continue by continuedev
25049
21423
9300