
MetaMCP
STDIOAggregate multiple MCP servers into unified endpoints with customizable middlewares
Aggregate multiple MCP servers into unified endpoints with customizable middlewares
MetaMCP is a MCP proxy that lets you dynamically aggregate MCP servers into a unified MCP server, and apply middlewares. MetaMCP itself is a MCP server so it can be easily plugged into ANY MCP clients.
Generally developers can use MetaMCP as infrastructure to host dynamically composed MCP servers through a unified endpoint, and build agents on top of it.
Quick demo video: https://youtu.be/Cf6jVd2saAs
A MCP server configuration that tells MetaMCP how to start a MCP server.
"HackerNews": { "type": "STDIO", "command": "uvx", "args": ["mcp-hn"] }
Similar to the official MCP inspector, but with saved server configs - MetaMCP automatically creates configurations so you can debug MetaMCP endpoints immediately.
Clone repo, prepare .env
, and start with docker compose:
git clone https://github.com/metatool-ai/metamcp.git cd metamcp cp example.env .env docker compose up -d
Still recommend running postgres through docker for easy setup:
pnpm install pnpm dev
If you have questions, feel free to leave GitHub issues or PRs.
⚠️ Cold start issue for hosting stdio
type MCP servers:
🛠️ Solution: Customize the Dockerfile to add dependencies or pre-install packages to reduce cold start time.
Authorization: Bearer <api-key>
headerSince MCP leverages SSE for long connection, if you are using reverse proxy like nginx, please refer to an example setup nginx.conf.example
Note: Prompts and resources follow similar patterns to tools.
sequenceDiagram participant MCPClient as MCP Client (e.g., Claude Desktop) participant MetaMCP as MetaMCP Server participant MCPServers as Installed MCP Servers MCPClient ->> MetaMCP: Request list tools loop For each listed MCP Server MetaMCP ->> MCPServers: Request list_tools MCPServers ->> MetaMCP: Return list of tools end MetaMCP ->> MetaMCP: Aggregate tool lists & apply middleware MetaMCP ->> MCPClient: Return aggregated list of tools MCPClient ->> MetaMCP: Call tool MetaMCP ->> MCPServers: call_tool to target MCP Server MCPServers ->> MetaMCP: Return tool response MetaMCP ->> MCPClient: Return tool response
Potential next steps:
We welcome contributions! See details at CONTRIBUTING.md
MIT
Would appreciate if you mentioned with back links if your projects use the code.
Some code inspired by: