Mcp Orchestrator

io.github.rupinder2由 GitHub 帳號 rupinder2 發布v0.1.2更新於 Oct 25, 2026

Aggregates tools from multiple MCP servers with unified BM25/regex search and deferred loading.

已驗證STDIO僅桌面知識與記憶開發者工具

概覽

AI 產生的概覽

一個本機中樞,連接多個 MCP 伺服器、索引其工具,讓助理透過單一入口搜尋並呼叫這些工具。

可以做什麼
以 BM25 相關性排序或正規表達式在所有已註冊的下游伺服器中搜尋已索引的工具,並支援延遲載入以控制上下文用量。探索並索引某個已註冊下游伺服器的工具。依命名空間名稱呼叫下游工具,可選擇性覆寫已設定的驗證標頭。透過 JSON 設定檔註冊下游伺服器,支援 stdio 或 HTTP 傳輸,以及記憶體或 Redis 工具定義快取。
適用情境
當你連接許多 MCP 伺服器、希望只有一個入口且工具清單保持精簡,並依需求搜尋出任務所需的工具時適用。也適合用一份設定檔把呼叫路由到多個下游伺服器。
執行需求
需在本機安裝 Python 套件(pip install mcp-orchestrator),以 stdio 或 HTTP 程序執行。需要 server_config.json 列出下游伺服器,路徑由 SERVER_CONFIG_PATH 指定。當 STORAGE_BACKEND=redis 時需透過 REDIS_URL 提供 Redis;HTTP 傳輸需 ORCHESTRATOR_PORT。需能存取各下游伺服器。
安裝前請注意
設定檔可為下游伺服器保存靜態驗證標頭(包括 bearer 權杖),應妥善保護。此中樞可呼叫所連伺服器上的任意工具,包括寫入、傳送或刪除資料的工具,且 call_remote_tool 允許覆寫驗證標頭。HTTP 傳輸預設監聽 0.0.0.0 並啟用 CORS,應限制暴露範圍。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Mcp Orchestrator,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

MCP Orchestrator

[PyPI Version] [Python Version] [License: MIT] [Tests] [Contributions Welcome]

A central hub that connects to multiple downstream MCP servers, aggregates their tools, and provides unified access with powerful tool search capabilities.

Built around deferred tool loading — search across all your servers without blowing Claude's context window.

Features

  • Config-based Server Registration: Add downstream MCP servers via JSON config file
  • Tool Namespacing: Automatic server_name__tool_name format
  • Tool Search: Unified BM25/regex search with deferred loading support
  • Flexible Authentication: Static saved headers or token forwarding
  • Multiple Transports: stdio or HTTP
  • Tool Definition Caching: Cached definitions, raw result passthrough
  • Storage Backends: In-memory (development) or Redis (production)

Quick Start

Installation

bash
pip install mcp-orchestrator

Running the MCP Server

bash
# Run as stdio MCP server (for Claude Desktop, Cursor, etc.)mcp-orchestrator
# Or run with Python directlypython -m mcp_orchestrator.main

HTTP Transport:

bash
ORCHESTRATOR_TRANSPORT=http ORCHESTRATOR_PORT=8080 python -m mcp_orchestrator.main

This starts the server on http://localhost:8080/mcp with CORS enabled.

Configuring Servers

Add downstream MCP servers in server_config.json:

json
{  "servers": [    {      "name": "my-server",      "url": "http://localhost:8080/mcp",      "transport": "http",      "auth_type": "static",      "auth_headers": {        "Authorization": "Bearer my-token"      }    },    {      "name": "my-stdio-server",      "url": "server.py",      "transport": "stdio",      "command": "uv",      "args": ["run", "python", "server.py"]    }  ]}

Searching for Tools

The orchestrator provides unified tool search (BM25 by default, regex optional):

python
# BM25 search (default - natural language)results = await mcp_client.call_tool("tool_search", {    "query": "get weather information",    "max_results": 3})
# Regex search (set use_regex=true)results = await mcp_client.call_tool("tool_search", {    "query": "weather|forecast",    "use_regex": true,    "max_results": 3})

Architecture

┌─────────────────────────────────────────────────────┐│                  MCP Orchestrator                    ││                                                      ││  ┌──────────────────────────────────────────────┐   ││  │              FastMCP Server                   │   ││  │  ┌─────────────┐  ┌──────────────────┐   │   ││  │  │ tool_search │  │ call_remote_tool  │   │   ││  │  └─────────────┘  └──────────────────┘   │   ││  └──────────────────────────────────────────────┘   ││                                                      ││  ┌──────────┐  ┌──────────┐  ┌──────────────┐      ││  │  Server  │  │   Tool   │  │   Storage    │      ││  │ Registry │  │  Search  │  │(Memory/Redis)│      ││  └──────────┘  └──────────┘  └──────────────┘      │└─────────────────────────────────────────────────────┘                           │        ┌───────────────────┼───────────────────┐        ▼                   ▼                   ▼   ┌─────────┐        ┌─────────┐        ┌─────────┐   │ MCP Svr │        │ MCP Svr │        │ MCP Svr │   │   #1    │        │   #2    │        │   #N    │   └─────────┘        └─────────┘        └─────────┘

Configuration

Environment Variables

VariableDefaultDescription
STORAGE_BACKENDmemoryStorage backend (memory or redis)
REDIS_URLredis://localhost:6379/0Redis connection URL
MCP_ORCHESTRATOR_TOOL_CACHE_TTL300Tool schema cache TTL in seconds
MCP_ORCHESTRATOR_DEFAULT_CONNECTION_MODEstatelessDefault connection mode
MCP_ORCHESTRATOR_CONNECTION_TIMEOUT30.0Connection timeout in seconds
MCP_ORCHESTRATOR_MAX_RETRIES3Maximum retry attempts
ORCHESTRATOR_TRANSPORTstdioMCP transport (stdio or http)
ORCHESTRATOR_PORT8080Port for HTTP transport
ORCHESTRATOR_HOST0.0.0.0Host for HTTP transport
ORCHESTRATOR_LOG_LEVELINFOLogging level
SERVER_CONFIG_PATHserver_config.jsonPath to server configuration file

Claude Desktop Integration

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):

json
{  "mcpServers": {    "mcp-orchestrator": {      "command": "mcp-orchestrator",      "env": {        "STORAGE_BACKEND": "memory",        "ORCHESTRATOR_LOG_LEVEL": "INFO"      }    }  }}

MCP Tools

tool_search

Search for tools using BM25 relevance ranking or regex pattern matching.

python
@mcp.tool()async def tool_search(    query: str,    max_results: int = 3,    use_regex: bool = False,) -> dict:    """Search for tools using BM25 or regex.
    By default uses BM25 natural language search. Set use_regex=True    to search using Python regex patterns instead.    """

discover_tools

Discover tools from a registered downstream server.

python
@mcp.tool()async def discover_tools(    server_name: str,) -> dict:    """Discover tools from a registered server and index them for search.
    Returns the list of discovered tools with their schemas.    """

call_remote_tool

Call a tool directly on a downstream MCP server.

python
@mcp.tool()async def call_remote_tool(    tool_name: str,    arguments: Optional[dict] = None,    auth_header: Optional[str] = None,) -> Any:    """Call a tool on a downstream server.
    Args:        tool_name: Namespaced tool name (server_name__tool_name)        arguments: Tool arguments        auth_header: Optional auth header to override server's configured auth    """

Tool Search Results

The search tools return results in the format expected by Claude's tool search system:

json
{  "success": true,  "tool_references": [    {      "type": "tool_reference",      "tool_name": "server_name__tool_name"    }  ],  "total_matches": 5,  "query": "weather"}

Testing

Run the test suite:

bash
uv run pytest

Run with coverage:

bash
uv run pytest --cov=mcp_orchestrator

Project Structure

mcp-orchestrator/├── src/mcp_orchestrator/│   ├── __init__.py│   ├── main.py              # Entry point│   ├── models.py            # Pydantic models│   ├── mcp_server.py        # FastMCP server│   ├── config_loader.py     # Config file loader│   ├── server/│   │   └── registry.py      # Server registry│   ├── tools/│   │   ├── router.py       # Tool router│   │   └── search.py       # Tool search service│   └── storage/│       ├── base.py          # Storage interface│       ├── memory.py        # In-memory backend│       └── redis.py         # Redis backend├── tests/│   ├── test_registry.py│   ├── test_search.py│   ├── test_storage.py│   ├── test_models.py│   └── test_integration.py├── server_config.json       # Pre-configured downstream servers├── pyproject.toml├── README.md└── .env                    # Environment variables (not committed)

License

MIT License

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

來源:README.md,提交 b44912b

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.2最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分