mcp-toolmux
Proxy-style MCP tool multiplexer that aggregates multiple downstream stdio MCP servers into one, offering meta-tools for status, search, call, parallel, batch, and pipeline operations with concurrency control and caching.
README
mcp-toolmux
mcp-toolmux is an independent MCP proxy-style tool multiplexer that exposes a small set of meta-tools and routes calls to downstream MCP servers with concurrency control, caching, and structured partial-failure handling.
It is inspired by callmux, but it is not a full clone. The current release focuses on a practical proxy shape: downstream registry, exposure modes, meta-tools, direct qualified calls, parallel calls, batch calls, dependent pipelines, tool search, schema compression, status, and lightweight caching.
中文说明:这是一个独立的 MCP proxy 项目,用来把多个下游 stdio MCP server 汇聚成一个上游可调用的 MCP server。本项目不是简单 demo,而是一个独立的 MCP 工具调用多路复用项目,目标是逐步完善工具路由、并发调度、批处理、流水线、缓存和协议层优化能力。
Architecture
flowchart LR
Client["Codex / Claude MCP client"] --> Proxy["mcp-toolmux stdio MCP server"]
Proxy --> Meta["Meta-tools\nstatus / search / call / parallel / batch / pipeline"]
Meta --> Registry["Downstream registry\nqualified + unqualified names"]
Registry --> Search["Tool search\ncompressed summaries"]
Meta --> Cache["Read-tool cache\nTTL + max entries"]
Registry --> Fake["fake stdio MCP server"]
Registry --> Other["other trusted stdio MCP servers"]
Features
- stdio MCP proxy server
- downstream MCP server registry from config
- tool exposure modes:
standardandmeta-only - meta-tools:
toolmux_status,toolmux_search_tools,toolmux_call,toolmux_parallel,toolmux_batch,toolmux_pipeline - direct qualified tool calls in standard mode, using names like
server__tool - unqualified tool calls when the tool name is not ambiguous
- global concurrency limit for parallel calls
toolmux_batchfor multiple argument sets against the same downstream tooltoolmux_pipelinefor serial dependent tool chains- input mapping with
$previous,$previous.result, and$steps.N.result toolmux_search_toolsfor downstream tool discovery- schema compression for compact tool summaries
- partial failure handling with
failedIndexes - lightweight TTL cache for read-style tool names
toolmux_parallel is for independent tool calls.
toolmux_batch is for multiple argument sets against the same tool.
toolmux_pipeline is for dependent tool chains where later steps consume earlier outputs.
Tool Exposure Modes
standard exposes meta-tools and qualified downstream tools. This mode is useful when you want transparent tool lists and direct calls such as fake__echo.
meta-only exposes only toolmux_* meta-tools. Downstream tools are discovered through toolmux_search_tools and invoked through toolmux_call, toolmux_parallel, toolmux_batch, or toolmux_pipeline.
Tool Search and Compression
toolmux_search_tools searches downstream tools by tool name, qualified name, description, and server name. It returns compressed summaries instead of full tool definitions by default.
Compressed tool summaries include:
nameserverqualifiedName- truncated
description requiredinputProperties- optional
inputSchema
Not Implemented Yet
- HTTP/SSE listener
- auth, dashboard, and metrics
- advanced policy controls
- persistent cache
The project is still evolving and does not yet include HTTP/SSE listener, auth, dashboard, advanced policy controls, or persistent cache.
Install
npm install
Build
npm run build
CLI Usage
npm install
npm run build
node dist/cli.js --help
node dist/cli.js init --output mcp-toolmux.config.json
node dist/cli.js doctor --config examples/mcp-toolmux.config.json
node dist/cli.js tools --config examples/mcp-toolmux.config.json
node dist/cli.js serve --config examples/mcp-toolmux.config.json
serve starts the stdio MCP server mode. Logs are written to stderr so MCP protocol messages on stdout stay clean.
doctor checks config shape, defaults, command availability, and common mistakes before you start the proxy.
tools briefly connects to downstream MCP servers and prints compressed downstream tool summaries as JSON.
init creates a starter standard-mode config and refuses to overwrite an existing file.
Run the Fake Server
The fake server is meant to be launched by the proxy after build:
npm run build
node dist/examples/fake-mcp-server.js
Run the Proxy
Use the example config:
npm run build
node dist/src/index.js --config examples/mcp-toolmux.config.json
The proxy always exposes six MCP meta-tools:
toolmux_statustoolmux_search_toolstoolmux_calltoolmux_paralleltoolmux_batchtoolmux_pipeline
In standard mode it also exposes qualified downstream tools such as fake__echo.
Example Config
{
"mode": "standard",
"schemaCompression": {
"enabled": true,
"descriptionMaxLength": 180,
"includeInputSchema": false,
"includeRequired": true
},
"servers": {
"fake": {
"command": "node",
"args": ["dist/examples/fake-mcp-server.js"]
}
},
"maxConcurrency": 5,
"cache": {
"enabled": true,
"ttlSeconds": 300,
"maxEntries": 256
}
}
By default, mcp-toolmux reads mcp-toolmux.config.json from the current directory. Pass --config path to use another file.
Tests
npm test
The handler tests use a mock upstream manager to keep the test suite fast. The fake MCP server remains available for manual stdio testing.
Security Note
Only configure trusted MCP server commands. mcp-toolmux never accepts arbitrary commands from tool input, and downstream server commands must come from the config file. Treat downstream MCP servers as executable code with your local privileges.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。