routermcp
v0.2.1
Published
A Bun-based CLI MCP Gateway that aggregates multiple upstream MCP servers
Maintainers
Readme
RouterMCP
A powerful CLI MCP Gateway that aggregates multiple upstream MCP servers into a single unified interface with comprehensive filtering, Code Mode, and session management.
Installation
# Global
npm install -g routermcp
# Or use directly with npx
npx routermcpQuick Start
- Create
routermcp.jsonc:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "."],
"allowedToolsGlob": ["read_*", "list_*"]
}
}
}- Run the gateway:
routermcpDocumentation
Full documentation is available in the docs/ folder:
Getting Started
Commands
Configuration
Advanced
- Code Mode - JavaScript sandbox
- Daemon Mode - Process sharing
- Multiple Servers - Aggregation
- Security - Best practices
Reference
Features
- MCP Gateway - Aggregate multiple MCP servers into one endpoint
- Tool Filtering - Allow/deny tools with exact names or glob patterns
- Code Mode - Execute JavaScript in a secure sandbox with tool access
- Session Management - HTTP multiplexing with isolated sessions
- Daemon Mode - Shared gateway process across multiple clients
- OpenAPI Integration - Convert REST APIs to MCP tools
- Stdio-to-HTTP Proxy - Expose stdio servers over HTTP
- Tunnel Support - Cloudflare and ngrok tunnels for public access
- Environment Variables -
${env:VAR}syntax with defaults
Client Integration
Claude Code
Create .mcp.json:
{
"mcpServers": {
"routermcp": {
"command": "npx",
"args": ["-y", "routermcp"]
}
}
}Cursor
Create .cursor/mcp.json:
{
"mcpServers": {
"routermcp": {
"command": "npx",
"args": ["-y", "routermcp"]
}
}
}See Cursor Migration and Claude Code Migration for detailed guides.
Examples
See the examples/ folder for complete working configurations:
Help
routermcp --helpLicense
MIT
