metamcp
metatool-ai · metatool-ai/metamcp
This MCP proxy aggregates multiple MCP servers into a unified one, allowing AI agents to interact with them through a single endpoint and apply middlewares.
MCP Aggregator, Orchestrator, Middleware, Gateway in one docker
Preview
What you can do with it
- Consolidate various AI agent tools from different MCP servers into a single interface for easier management.
- Apply custom logic or logging as middleware to all AI agent requests across multiple MCPs.
- Route AI agent queries dynamically to the most appropriate backend MCP server based on context.
Safety check
No risky patterns found in the files we scanned.
Automated scan of the repo files. Always review code you run.
From the README
🚀 MetaMCP (MCP Aggregator, Orchestrator, Middleware, Gateway in one docker)
📢 Latest Update: This ai-dev branch will be the forward onging dev branch which contains ai agent changes. Please test before you build the image based on this branch. There has been many PRs thanks to the community but merging and reviewing them has been a growing effort too. I decided to include ai changes. At least so far the core functionality works. There is also a community maintained fork (ty a lot!): https://github.com/Umbrella-IT-Group/metamcp
📢 Update: [From the author: apologize for some recent maintainence delay, but will at least keep merging PRs, more background here]
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.
For more details, consider visiting our documentation site: https://docs.metamcp.com
English | 简体中文
📋 Table of Contents
- 🎯 Use Cases
- 📖 Concepts
- 🚀 Quick Start
- 🔌 MCP Protocol Compatibility
- 🔗 Connect to MetaMCP
- ❄️ Cold Start Problem and Custom Dockerfile
- 🧾 Log Levels
- 🔐 Authentication
- 🚦 Traffic Management
- 🔗 OpenID Connect (OIDC) Provider Support
- ⚙️ Registration Controls
- 🌐 Custom Deployment and SSE conf for Nginx
- 🏗️ Architecture
- 🗺️ Roadmap
- 🌐 i18n
- 🤝 Contributing
- 📄 License
- 🙏 Credits
🎯 Use Cases
- 🏷️ Group MCP servers into namespaces, host them as meta-MCPs, and assign public endpoints (SSE or Streamable HTTP), with auth. One-click to switch a namespace for an endpoint.
- 🎯 Pick tools you only need when remixing MCP servers. Apply other pluggable middleware around observability, security, etc. (coming soon)
- 🔍 Use as enhanced MCP inspector with saved server configs, and inspect your MetaMCP endpoints in house to see if it works or not.
- 🔍 Use as Elasticsearch for MCP tool selection (coming soon)
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
📖 Concepts
🖥️ MCP Server
A MCP server configuration that tells MetaMCP how to start a MCP server.
"HackerNews": {
"type": "STDIO",
"command": "uvx",
"args": ["mcp-hn"]
}
🔐 Environment Variables & Secrets (STDIO MCP Servers)
For STDIO MCP servers, MetaMCP supports three ways to handle environment variables and secrets:
1. Raw Values - Direct string values (not recommended for secrets):
API_KEY=your-actual-api-key-here
DEBUG=true
2. Environment Variable References - Use ${ENV_VAR_NAME} syntax:
API_KEY=${OPENAI_API_KEY}
DATABASE_URL=${DB_CONNECTION_STRING}
3. Auto-matching - If the expected environment variable name in your tool matches the container's environment variable, you can omit it entirely. MetaMCP will automatically pass through matching environment variables.
🔒 Security Note: Environment variable references (
${VAR_NAME}) are resolved from the MetaMCP container's environment at runtime. This keeps actual secret values out of your configuration and git repository.
⚙️ Development Note: For local development with
pnpm run dev:docker, ensure your environment variables are listed inturbo.jsonunderglobalEnvto be passed to the development processes. This is not required for production Docker deployments.
🏷️ MetaMCP Namespace
- Group one or more MCP servers into a namespace
- Enable/disable MCP servers or at tool level
- Apply middlewares to MCP requests and responses
- Override tool names/titles/descriptions per namespace and attach custom MCP annotations (e.g.
{ "annotations": { "readOnlyHint": false } })
🌐 MetaMCP Endpoint
- Create endpoints and assign namespace to endpoints
- Multiple MCP servers in the namespace will be aggregated and emitted as a MetaMCP endpoint
- Choose between API-Key Auth (in header or query param) or standard OAuth in MCP Spec