MCP Proxy Server
Introductionβ
The MCP Proxy Server provides a centralized gateway for accessing multiple MCP (Model Context Protocol) servers through a single endpoint. Instead of connecting directly to individual MCP servers, agents connect to the proxy, which handles routing, load balancing, failover, security, and tool catalog aggregation.
Why Use the MCP Proxy?β
- Centralized Management: Single configuration point for all upstream MCP servers
- High Availability: Automatic failover when upstream servers become unavailable
- Load Balancing: Distribute requests across multiple upstream servers
- Security: Centralized rate limiting, logging, and sensitive data redaction
- Tool Aggregation: Unified tool catalog from all upstream servers with conflict resolution
Architecture Overviewβ
Agent -> [MCP Proxy Server] -> Upstream MCP Servers
(MCP Server) (MCP Clients)
The proxy acts as:
- MCP Server to agents (accepts connections, handles tools/list, tools/call, etc.)
- MCP Client to upstream servers (connects to and forwards requests)
Quick Startβ
1. Initialize Configurationβ
rad mcp proxy init
This creates a default configuration file at .radium/mcp-proxy.toml.
2. Configure Upstream Serversβ
Edit .radium/mcp-proxy.toml to add your upstream MCP servers:
[mcp.proxy]
enable = true
port = 3000
transport = "http"
[[mcp.proxy.upstreams]]
name = "server1"
transport = "http"
url = "http://localhost:8080/mcp"
priority = 1
health_check_interval = 30
[[mcp.proxy.upstreams]]
name = "server2"
transport = "http"
url = "http://localhost:8081/mcp"
priority = 2
health_check_interval = 30
3. Start the Proxyβ
rad mcp proxy start
The proxy will:
- Connect to all configured upstream servers
- Discover tools from each upstream
- Start health checking for all upstreams
- Begin accepting agent connections on the configured port
4. Connect Agentsβ
Agents should connect to the proxy instead of individual upstream servers:
http://localhost:3000 (or your configured port)
5. Stop the Proxyβ
rad mcp proxy stop
Or press Ctrl+C if running in the foreground.
Configurationβ
See MCP Proxy Configuration Reference for complete configuration options.
Use Casesβ
Centralized Controlβ
Manage all MCP server connections from a single location, making it easier to update endpoints, add new servers, or modify routing logic.
High Availabilityβ
Configure multiple upstream servers providing the same tools. The proxy automatically fails over to backup servers if the primary becomes unavailable.
Load Balancingβ
Distribute tool execution requests across multiple upstream servers to improve performance and reduce load on individual servers.
Security and Complianceβ
Implement centralized security policies:
- Rate limiting to prevent abuse
- Request/response logging for auditing
- Sensitive data redaction in logs
Componentsβ
Upstream Poolβ
Manages connections to multiple upstream MCP servers, tracking connection state and health.
Tool Routerβ
Routes tool execution requests to appropriate upstream servers with:
- Explicit routing via
upstream:toolsyntax - Round-robin load balancing
- Priority-based failover
Tool Catalogβ
Aggregates tools from all upstream servers and handles name conflicts using configurable strategies:
- AutoPrefix: Automatically prefix conflicting tools with upstream name
- Reject: Keep first tool, reject duplicates
- PriorityOverride: Keep tool from highest priority upstream
Security Layerβ
Enforces security policies:
- Rate limiting per agent/tool combination
- Request/response logging
- Sensitive data redaction using regex patterns
Health Checkerβ
Monitors upstream server health and automatically reconnects failed servers with exponential backoff.
Troubleshootingβ
Proxy Won't Startβ
Error: Port already in use
- Check if another proxy instance is running:
rad mcp proxy status - Stop existing instance:
rad mcp proxy stop - Or change the port in your configuration
Upstream Connection Failuresβ
Error: Failed to connect to upstream
- Verify the upstream server is running and accessible
- Check network connectivity
- Verify URL/command configuration is correct
- Check authentication credentials if using OAuth
Rate Limit Errorsβ
Error: Rate limit exceeded
- Adjust
rate_limit_per_minutein configuration - Check if multiple agents are using the same rate limit key
- Review security configuration
Tools Not Appearingβ
Tools from upstream not in catalog
- Wait for tool discovery to complete (runs on startup)
- Check upstream connection status:
rad mcp proxy status - Verify upstream server is providing tools correctly
- Check conflict resolution strategy if tool names overlap
CLI Commandsβ
rad mcp proxy initβ
Initialize a new proxy configuration file with defaults.
rad mcp proxy startβ
Start the proxy server. Connects to all configured upstreams and begins accepting agent connections.
rad mcp proxy stopβ
Stop a running proxy server gracefully.
rad mcp proxy statusβ
Check if the proxy server is running and display status information.