# MetaMCP — Aggregate Many MCP Servers as One > MetaMCP aggregates multiple MCP servers into namespaces and exposes a single endpoint with tool overrides, middleware, and an inspector for debugging. ## Install Merge the JSON below into your `.mcp.json`: ## Quick Use 1. Clone + create env file: ```bash git clone https://github.com/metatool-ai/metamcp.git cd metamcp cp example.env .env ``` 2. Start with Docker Compose: ```bash docker compose up -d ``` 3. Add servers to a namespace, then expose a MetaMCP endpoint for clients. ## Intro MetaMCP aggregates multiple MCP servers into namespaces and exposes a single endpoint with tool overrides, middleware, and an inspector for debugging. - **Best for:** teams building an MCP ‘hub’ with per-namespace policies, overrides, and debugging tools - **Works with:** Docker + docker compose, Postgres (bundled), MCP servers as upstreams - **Setup time:** 20–45 minutes ## Practical Notes - Data point: the recommended path is Docker Compose + a bundled Postgres volume. - Quant: keep namespaces small (5–15 tools) so tool context stays usable for LLMs. ## Pattern: enforce policy at the namespace boundary When you combine many upstream servers, the namespace becomes your policy layer: - filter or hide tools, - normalize tool names/descriptions, - and add logging. ## Pattern: create an “inspection loop” Run your client against the MetaMCP endpoint, then use the inspector to replay calls with saved configs. This turns tool integration from guesswork into a debuggable loop. ### FAQ **Q: Is MetaMCP a single binary?** A: It’s designed to run via Docker Compose (recommended) with supporting services. **Q: Why do tool overrides matter?** A: Small metadata tweaks can drastically improve tool selection quality. **Q: How do I avoid tool explosion?** A: Use namespaces + filters to keep only the tools users actually need. ## Source & Thanks > Source: https://github.com/metatool-ai/metamcp > License: MIT > GitHub stars: 2,315 · forks: 339 --- ## 快速使用 1. 克隆并准备环境变量: ```bash git clone https://github.com/metatool-ai/metamcp.git cd metamcp cp example.env .env ``` 2. 用 Docker Compose 启动: ```bash docker compose up -d ``` 3. 把多个 server 加进 namespace,再对外发布一个 MetaMCP endpoint。 ## 简介 MetaMCP 可以把多个 MCP server 聚合到 namespace,再对外输出一个统一端点;支持 tool 覆盖、middleware,并提供可保存配置的调试 inspector 便于复盘。 - **适合谁:** 想做 MCP ‘中枢’、并按 namespace 管理策略/覆盖/调试能力的团队 - **可搭配:** Docker + docker compose、内置 Postgres、上游 MCP servers - **准备时间:** 20–45 分钟 ## 实战建议 - 数据点:推荐路径是 Docker Compose,并带一个 Postgres volume。 - 量化建议:让每个 namespace 的工具数量保持在 5–15 个,避免上下文膨胀。 ## 常用打法:在 namespace 边界做策略 聚合多个上游时,namespace 就是策略层: - 过滤/隐藏工具, - 统一工具命名与描述, - 增加日志与可观测性。 ## 常用打法:建立“可复现的调试闭环” 让客户端调用 MetaMCP endpoint,再用 inspector 复盘调用并保存配置,把工具接入从“猜”变成可调试的流程。 ### FAQ **MetaMCP 是单个二进制吗?** 答:推荐用 Docker Compose 运行,并带配套服务。 **为什么要做 tool 覆盖?** 答:少量元数据调整就能显著改善模型选工具的准确率。 **怎么避免工具爆炸?** 答:用 namespace + filter 只暴露真正需要的工具。 ## 来源与感谢 > Source: https://github.com/metatool-ai/metamcp > License: MIT > GitHub stars: 2,315 · forks: 339 --- Source: https://tokrepo.com/en/workflows/metamcp-aggregate-many-mcp-servers-as-one Author: MCP Hub