Skip to main content
Glama

MCP Router

MCP Router is a service discovery and proxy for MCP (Model Control Protocol) services. It allows you to register, discover, and execute tools on remote MCP servers.

Features

  1. Service Discovery: Register and search for MCP services using vector-based similarity search

  2. Tool Execution Proxy: Execute tools on remote MCP servers through the router

  3. MCP Compliance: Fully compliant with the MCP protocol specification

Related MCP server: one-mcp

Architecture

The MCP Router consists of two core modules:

  1. MCP Data Plane: The frontend that interacts with MCP clients, providing service discovery, registration, and tool execution proxying

  2. MCP Discovery Service: The backend that uses Alibaba Cloud's vector database and embedding models for intelligent search and management of registered MCP services

Prerequisites

  • Python 3.11 or higher

  • Access to Alibaba Cloud DashScope and DashVector services

  • API keys for DashScope and DashVector

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd mcp-router
  2. Install dependencies using uv:

    uv add pydantic httpx dashscope dashvector python-dotenv
  3. Set up environment variables in .env:

    DASHSCOPE_API_KEY=your_dashscope_api_key
    DASHVECTOR_API_KEY=your_dashvector_api_key
    DASHVECTOR_ENDPOINT=your_dashvector_endpoint
    COLLECTION_NAME=mcp_services_collection
    EMBEDDING_DIMENSION=1024

Usage

Run the MCP Router server:

uv run python mcp_router.py

Tools

The MCP Router provides three tools:

  1. search_mcp_server: Search for registered MCP servers based on a query

  2. add_mcp_server: Register a new MCP server with the discovery service

  3. exec_mcp_tool: Execute a tool on a target MCP server

Development

Code Structure

  • mcp_router.py: Main MCP server implementation (Data Plane)

  • discovery_service.py: Discovery service implementation (Discovery Service)

  • config.py: Configuration management

Available Tools

3 tools
add_mcp_serverC
Register a new MCP server with the discovery service.

Args:
    server_name: Unique name of the server
    server_description: Description of the server
    server_endpoint: Endpoint URL of the server
    tools: List of tools provided by the server

Inputs: server_name (required), server_description (required), server_endpoint (required), tools (required). Returns: result

exec_mcp_toolC
Execute a tool on a target MCP server.

Args:
    target_server_name: Name of the target server
    target_tool_name: Name of the tool to execute
    parameters: Parameters for the tool

Inputs: target_server_name (required), target_tool_name (required), parameters (required). Returns: result

search_mcp_serverC
Search for registered MCP servers based on a query.

Args:
    query: Search query
    top_k: Number of top results to return (default: 3)

Inputs: query (required), top_k. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose with no overlap: add_mcp_server registers servers, exec_mcp_tool executes tools on servers, and search_mcp_server searches for servers. The descriptions reinforce these distinct roles, making misselection unlikely.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern with snake_case: add_mcp_server, exec_mcp_tool, and search_mcp_server. This predictable naming scheme enhances readability and usability for agents.

    Tool Count3/5

    With only 3 tools, the server feels thin for a router's scope, which typically involves more operations like listing, updating, or removing servers. While the core functions are present, the count is borderline for comprehensive routing capabilities.

    Completeness3/5

    The tool set covers basic registration, execution, and search, but lacks operations for updating or deleting servers, which are common in lifecycle management. This creates notable gaps that agents might need to work around for full server management.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      Not graded
      maintenance
      Provides a unified MCP interface that proxies requests to multiple backend servers including memory/knowledge graph and vector database services. Enables seamless access to distributed MCP tools through a single endpoint with automatic routing, health monitoring, and retry logic.
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      A lightweight MCP server that enables intelligent tool management and semantic search for APIs using sentence-transformers. It supports both REST and MCP interfaces across dual transport modes, allowing users to upload, manage, and query API tools with natural language.
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      AI-first MCP server discovery tool that enables agents to search, inspect, and install MCP servers from multiple registries.
      16
      AGPL 3.0