MCP of MCPs
A meta-server that aggregates multiple MCP servers into a single interface, reducing token usage by 98%+ through progressive tool discovery and direct code execution that processes data between tools without consuming context window space.
README
MCP of MCPs
A meta-server that aggregates multiple MCP servers and enables efficient code execution for AI agents. Reduces token usage, improving speed and reliability.
The Problem
When AI agents connect to multiple MCP servers, they face three critical issues:
1. 🔥 Burns Tokens
Every tool definition and intermediate result consumes valuable context window space. With hundreds of tools across multiple servers, agents can waste 150,000+ tokens on a single workflow.
2. ⏱️ Slows Everything Down
The model must process and reason about all tool definitions upfront, even for tools it won't use. This adds significant latency before the agent can even start working.
3. 🤯 Increases Hallucinations
When models see too much irrelevant information, they're more likely to get confused and make mistakes. Loading all tools upfront reduces accuracy.
The Solution
MCP of MCPs is a meta-server that provides three powerful tools for efficient agent orchestration:
Tool 1: get_mcps_servers_overview
Discovery Tool - This tool returns only tool names without full schemas, giving agents a lightweight overview in seconds instead of loading hundreds of detailed definitions upfront. By showing just what's available without overwhelming details, it prevents confusion and hallucinations while eliminating loading delays.
// Returns:
// google_drive/download_file
// google_drive/upload_file
// slack/send_message
// database/execute_query
// ...
Tool 2: get_tools_overview
Introspection Tool - Load only the tools you actually need instead of all 30+ tools, saving thousands of tokens through selective loading. This on-demand approach provides faster responses and focused context that reduces confusion and improves accuracy.
// Input: ["google_drive/download_file", "slack/send_message"]
// Returns: Full tool definitions with:
// - Parameter schemas
// - Required vs optional fields
// - Example usage code
Tool 3: run_functions_code
Execution Tool - Data flows directly between tools without round-trips through the model, so a 2MB file transfer uses ~100 tokens instead of 50,000+. The model only sees clean final results instead of noisy intermediate data, executing complex workflows in one shot without processing delays.
// Write code that:
// - Calls multiple tools in sequence or parallel
// - Processes and transforms data
// - Implements complex logic and error handling
// - Returns only final results to the model
How The Full Flow Solves All Problems
The three tools work together through progressive disclosure: first, get_mcps_servers_overview returns just tool names (not full schemas), so the model scans a simple list instead of parsing 500KB of definitions. Next, get_tools_overview loads only the 2-3 tools you need instead of all 30+, reducing tokens and giving the model focused context without confusing irrelevant options. Finally, run_functions_code executes workflows where data flows directly between tools in memory—intermediate results not get serialized into tokens, they stay as native objects passing from one tool to another while the model only sees the final result. This pattern cuts token usage, speeds up execution by avoiding unnecessary model processing, and eliminates hallucinations by showing only relevant information at each step.
Real-World Example
Traditional Approach:
TOOL CALL: gdrive.getDocument(documentId: "abc123")
→ returns full transcript text (loads into context: 50,000 tokens)
TOOL CALL: salesforce.updateRecord(...)
→ model writes entire transcript again (doubles the tokens: +50,000 tokens)
Total: 100,000+ tokens processed, slow response time
With MCP of MCPs:
const transcript = (await gdrive.getDocument({ documentId: 'abc123' })).content;
await salesforce.updateRecord({
objectType: 'SalesMeeting',
data: { Notes: transcript }
});
The code executes in one operation. Data flows directly between tools. Only the final result returns to the model.
Total: 2,000 tokens processed (98.7% reduction) ⚡
Key Benefits
✅ Faster Response Time - No need to load all tools upfront
✅ Reduced Hallucinations - Model sees only relevant information
✅ Progressive Disclosure - Load tools on-demand as needed
✅ Code Composition - Orchestrate complex workflows with familiar JavaScript
Setup
Prerequisites
- Node.js
- npm or yarn
- Configured MCP servers you want to aggregate
Installation
- Clone the repository
git clone https://github.com/eliavamar/mcp-of-mcps.git
cd mcp-of-mcps
- Install dependencies
npm install
- Build the project
npm run build
Add to Cline
Add this to your Cline MCP settings file:
Option 1: Using inline configuration (recommended)
{
"mcpServers": {
"mcp-of-mcps": {
"autoApprove": [],
"disabled": false,
"timeout": 60,
"type": "stdio",
"command": "node",
"args": [
"/absolute/path/to/mcp-of-mcps/build/index.js",
"--config",
"[{\"name\":\"weather\",\"command\":\"npx\",\"args\":[\"-y\",\"@h1deya/mcp-server-weather\"]},{\"name\":\"time\",\"command\":\"uvx\",\"args\":[\"mcp-server-time\"]}]"
]
}
}
}
Option 2: Using a config file
First, create a config.json file that specifies which MCP servers to connect to:
[
{
"name": "weather",
"command": "npx",
"args": ["-y", "@h1deya/mcp-server-weather"]
},
{
"name": "time",
"command": "uvx",
"args": ["mcp-server-time"]
}
]
Then reference this file in your Cline settings:
{
"mcpServers": {
"mcp-of-mcps": {
"autoApprove": [],
"disabled": false,
"timeout": 60,
"type": "stdio",
"command": "node",
"args": [
"/absolute/path/to/mcp-of-mcps/build/index.js",
"/absolute/path/to/your/config.json"
]
}
}
}
Configuration Options:
autoApprove: Array of tool names that don't require approval (e.g.,["get_mcps_servers_overview"])disabled: Set tofalseto enable the servertimeout: Timeout in seconds for tool execution (default: 60)type: Connection type, always"stdio"for MCP servers
Learn More
This implementation follows the patterns described in Anthropic's article on code execution with MCP:
📖 Code execution with MCP: Building more efficient agents
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
ISC
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.