MCP of MCPs

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.

Category
访问服务器

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

  1. Clone the repository
git clone https://github.com/eliavamar/mcp-of-mcps.git
cd mcp-of-mcps
  1. Install dependencies
npm install
  1. 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 to false to enable the server
  • timeout: 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

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选