mcp-router-local
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
mcp-router-local
Zero-dependency local Model Context Protocol (MCP) router. Aggregate multiple MCP servers behind a single endpoint so an LLM client (Claude Desktop, Claude Code, Cursor, or any JSON-RPC 2.0 over stdio/SSE client) connects to one router instead of managing many individual server processes.
Built on native Node.js modules only — child_process, readline, fs, path, http.
No runtime dependencies, no third-party parsers, nothing to install but the router itself.
Features
Single endpoint aggregation — one stdio connection (or one local SSE endpoint) that fronts every configured sub-server.
Dynamic config discovery — reads
mcp-router.config.jsonfrom the current working directory: executable paths, arguments, env vars, and per-server behavior.Protocol aggregation — spawns every sub-server on startup, performs the MCP handshake, and merges
tools/list,resources/list,resources/templates/list, andprompts/listinto one unified capability manifest.Intelligent routing —
tools/call,resources/read, andprompts/getare intercepted, matched to the owning sub-server, forwarded, and the response is safely returned to the client. Tool-name collisions across servers are auto-namespaced.Process safety — a crashing sub-server is logged to a local debug file (never stdout, so the JSON-RPC stream stays clean) and restarted with capped exponential backoff. On exit, all children are terminated gracefully (SIGTERM → SIGKILL).
Related MCP server: MCP Server Proxy
Requirements
Node.js ≥ 18 (ESM)
Install
npm install -g mcp-router-local # global CLI: mcp-router
# or run without installing:
npx mcp-router-localQuick start
Create mcp-router.config.json in the directory you'll run the router from:
{
"servers": [
{
"id": "filesystem",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"]
},
{
"id": "db",
"command": "python",
"args": ["db_mcp_server.py"],
"env": { "DATABASE_URL": "postgres://localhost/app" }
}
]
}Then start the router:
mcp-routerPoint your LLM client at it. For a client that spawns servers over stdio, configure the
command mcp-router (with --config <path> if needed). For example, Claude Code:
{
"mcpServers": {
"all-my-servers": {
"command": "mcp-router",
"args": ["--config", "/absolute/path/to/mcp-router.config.json"]
}
}
}The router announces itself as a single server exposing the union of every sub-server's tools, resources, and prompts. From the client's perspective there is only one server.
Configuration reference
Key | Type | Default | Description |
|
|
| Server name sent in the |
|
|
| Server version sent in the handshake. |
|
|
| Client-facing transport. |
|
|
| SSE bind host. |
|
|
| SSE bind port. |
|
| — | Required. At least one sub-server entry. |
|
|
| Handshake timeout per sub-server. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Mirror warnings/errors to stderr. |
|
|
| Diagnostic log path (resolved next to the config file). |
Server entry (servers[])
Key | Type | Default | Description |
|
| — | Required. Unique id used for routing and logs. |
|
| — | Required. Executable to spawn. |
|
|
| Arguments passed to the executable. |
|
| inherit | Working directory for the child process. |
|
| inherit | Extra env vars merged over the router's environment. |
|
|
| Restart the child after a crash. |
|
|
| Restart attempts before giving up. |
Transports
stdio (default)
mcp-router reads line-delimited JSON-RPC from stdin and writes responses to stdout.
All diagnostics go to the debug file (and optionally stderr) — stdout carries only
JSON-RPC, so your client never sees log noise.
SSE
Set transport.type to "sse", then:
GET http://host:port/sse— opens the event stream (sendsevent: endpoint).POST http://host:port/message— accepts JSON-RPC bodies, returns202, and pushes responses over the open stream. Requests received before a client connects are queued and drained on connect.
Handling tool-name collisions
If two sub-servers expose a tool with the same name, the router keeps the first server's
name untouched and renames the later one to <serverId>__<toolName>. A warning is
written to the debug log:
Tool "shared" exists on both "alpha" and "beta"; exposed as "beta__shared" to avoid collisionCall the renamed tool exactly as exposed; the router strips the prefix and forwards the original name to the owning sub-server.
Crash handling & restart backoff
When a sub-server exits unexpectedly:
A clean error is written to the debug file (stderr too if
debug.enabled).The router attempts a restart with exponential backoff:
1s, 2s, 4s, 8s, 15s…(capped at 15s), up tomaxRestarts.On each restart the router re-runs the handshake, re-gathers capabilities, and rebuilds its routing indexes.
A server that stays alive for 2 minutes resets its restart counter.
Demo
A self-contained demo ships in demo/ — no real MCP servers needed:
npm run build
node demo/run.mjsIt starts the router against two built-in mock servers (alpha and beta), runs an
initialize handshake, lists the merged tools, and calls tools on both — including the
collision-renamed beta__shared — then tears everything down. Open
demo/mcp-router.config.json to see the shape it uses.
Development
npm install
npm run type-check # strict TypeScript
npm run build # tsup -> dist/index.js + dist/index.d.tsLicense
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
An MCP server that provides an API to LLMs to manage their JumpCloud resources.
Single-connection meta-router indexing 500+ MCP servers & A2A tools with 85% token compression and
Stateless MCP gateway and OTel span-streaming bridge for hosted MCP servers.
Hosted MCP server for LLM cost estimation, model comparison, and budget-aware routing.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceAggregates multiple child MCP servers into a single MCP server endpoint, enabling clients to use various tools (e.g., filesystem, Brave Search) through one interface.32 npm-
- AlicenseNot gradedqualityDmaintenanceAggregates multiple MCP servers into a single endpoint, enabling LLM clients to access tools, resources, and prompts from various backends through one connection.9 npmMIT

MetaMCPofficial
AlicenseAqualityCmaintenanceAggregates multiple MCP servers into a single interface, reducing token overhead and simplifying tool management for LLMs.674 npm18Apache 2.0- AlicenseNot gradedqualityAmaintenanceAggregates multiple MCP servers behind a single endpoint so that clients can reach every one of their tools through one connection instead of configuring each server separately. It simplifies setup and keeps tool access in one place when many servers are in play.1MIT