home / mcp / mcp router mcp server
Aggregates multiple MCP backends with health checks, routing strategies, and namespace prefixes for resilient, scalable routing.
Configuration
View docs{
"mcpServers": {
"amp-rh-mcp": {
"url": "http://localhost:8000",
"headers": {
"MCP_HOST": "0.0.0.0",
"MCP_PORT": "8000",
"MCP_CACHE_TTL": "300",
"MCP_MAX_BACKOFF": "10",
"MCP_MAX_RETRIES": "3",
"MCP_SERVER_NAME": "mcp-router",
"MCP_RETRY_BACKOFF": "2.0",
"MCP_BACKENDS_CONFIG": "/absolute/path/to/config/backends.yaml",
"MCP_REQUEST_TIMEOUT": "30",
"MCP_DEFAULT_STRATEGY": "capability",
"MCP_ENABLE_NAMESPACES": "true",
"MCP_HEALTH_CHECK_TIMEOUT": "5",
"MCP_HEALTH_CHECK_INTERVAL": "30"
}
}
}
}You deploy and run an MCP Router to aggregate and route requests to multiple MCP backends. It provides health checks, circuit-breaking, and flexible routing strategies so you can balance load, enforce namespaces, and recover gracefully from failures.
Use an MCP client to send requests through the router. The router exposes multiple routing strategies so you can route by tool name, backend capabilities, or through a prioritized fallback chain. Enable namespace prefixes to avoid naming conflicts across backends, and rely on builtβin health checks and circuit breakers to keep traffic healthy. Monitor routing decisions and backend health via the routerβs management tools to understand where requests are going and how backends are performing.
Prerequisites: you need Python and a supported runtime to install and run the MCP Router. You also need a local MCP backend setup or access to remote backends if you plan to route to them.
Install from a package index or source using the commands shown below. Pick the method that matches your environment.
Option A: Install from GitHub (recommended for latest changes) you can run directly from a source URL.
Configure one or more backends in a YAML file referenced by MCP_BACKENDS_CONFIG. You can turn on health checks, configure circuit breakers, and define routing rules per backend. Namespace prefixing helps keep tool names unique when aggregating from multiple backends.
Run the router in stdio mode to start a local MCP router process, or run it as a HTTP service depending on your deployment. The router is typically reachable at the standard MCP port, for example http://localhost:8000, once started.
Three routing strategies are available per backend: path-based routing using glob-like patterns, capability-based routing by querying backend capabilities, and priority/fallback chains to try primary backends first and fall back when needed. You can combine these strategies with health checks and circuit breakers to ensure resilience.
Use router management tools to list backends and inspect health and circuit breaker state. This visibility helps you understand routing decisions, diagnose failures, and adjust configurations for better reliability.
Override router behavior with environment variables for runtime configuration such as backend config path, default routing strategy, and health check parameters.
Lists all configured backends with health status and circuit state.
Returns detailed health information for a specific backend including circuit state and last error.