Route tasks to external MCP servers with unified tool discovery, capability inference, and a normalized registry. Connect to browser-mcp, paaf, research-agent, and more.
Connect to MCP servers via stdio transport. Handle JSON-RPC messages, sessions, and reconnection.
Discover available servers and tools. Auto-detect capabilities from tool names and descriptions.
Unified tool registry with capability mapping, tool normalization, and search.
Main router with tool selection, execution, and fallback handling.
Configuration schemas for server definitions, transport settings, and validation.
Route to any MCP-compatible server. Here are some examples:
Tasks are matched to tools via capabilities, then routed to the appropriate MCP server.
Automatically discover tools from configured MCP servers at startup.
Infer capabilities from tool names and descriptions using pattern matching.
Normalize tools from different servers into a unified format.
Communicate with MCP servers via standard input/output (JSON-RPC).
Maintain persistent sessions with automatic reconnection.
Search, filter, and select tools across all connected servers.
from mcp_router import MCPRouter from mcp_config import load_mcp_config # Load server configurations from .mcp.json config = load_mcp_config(".mcp.json") # Initialize router with auto-discovery router = MCPRouter(config) await router.discover_all() # Find tools by capability tools = router.find_tools(capability="browser") print(tools) # [browser_navigate, browser_screenshot, ...] # Execute a tool response = await router.execute( tool="browser_navigate", input_data={"url": "https://example.com"}, ) print(response.server) # browser-mcp