home / mcp / mcp router mcp server

MCP Router MCP Server

Aggregates multiple MCP backends with health checks, routing strategies, and namespace prefixes for resilient, scalable routing.

Installation
Add the following to your MCP client configuration file.

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.

How to use

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.

How to install

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.

Configuration and usage notes

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.

Router startup and access

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.

Routing behavior and strategies

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.

Management and observability

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.

Environment variables

Override router behavior with environment variables for runtime configuration such as backend config path, default routing strategy, and health check parameters.

Available tools

list_backends

Lists all configured backends with health status and circuit state.

get_backend_health

Returns detailed health information for a specific backend including circuit state and last error.