Universal MCP aggregation server with 15 layers of token optimization
MCP Gateway
![LobeHub MCP listing badge][lobehub-mcp-badge]
Universal MCP aggregation server that routes 300+ tools from multiple MCP servers through a single endpoint with 15 layers of token optimization (95-98% reduction). Works with Claude Desktop, Claude Code, Cursor, OpenAI Codex, and VS Code Copilot.
Key Features
- Multi-Server Aggregation — Connect multiple MCP servers (STDIO, HTTP, SSE) through one gateway endpoint
- 15 Token Optimization Layers — Progressive disclosure, smart filtering, aggregations, code batching, delta responses, auto-summarization, and more
- Web Dashboard — Real-time UI to manage tools, backends, and server lifecycle with hot-reload
- Sandboxed Code Execution — Execute TypeScript/JavaScript in secure Node.js VM for batch operations
- Skills System — Save and reuse code patterns for zero-shot task execution
- Authentication — API Key and OAuth/JWT support with rate limiting
- Docker Ready — Easy deployment with Docker/Compose
Quick Install
git clone https://github.com/abdullah1854/MCPGateway.git
cd MCPGateway
npm install
cp config/servers.example.json config/servers.json
npm run dev
Connect Your AI Client
Claude Desktop / Cursor / VS Code Copilot — Add as remote MCP server:
http://localhost:3010/mcp
Claude Code — Add to settings:
{
"mcpServers": {
"mcp-gateway": {
"type": "url",
"url": "http://localhost:3010/mcp"
}
}
}
Dashboard: http://localhost:3010/dashboard
Best for: teams that want one MCP endpoint, a browser dashboard, and aggressive token savings when working across many tools.
Quick Links
- Quick start
- Supported clients
- Dashboard screenshots
- Backend configuration
- Security modes
- Examples
- Issues & support
Quick Start in 3 Commands
npm install
cp config/servers.example.json config/servers.json
npm run dev
Then open http://localhost:3010/dashboard, connect your preferred client, and continue with the full Quick Start below for server configuration and production setup.
Supported MCP Clients
| Client | Support | Notes |
|---|---|---|
| Claude Desktop | ✅ | Connect through the gateway's HTTP or SSE endpoints |
| Claude Code | ✅ | Reduces context overhead for large tool catalogs |
| Cursor | ✅ | Use one gateway to expose hundreds of backend tools |
| OpenAI Codex | ✅ | Works with the gateway's standard MCP endpoints |
| VS Code Copilot | ✅ | Centralizes MCP tooling across local and remote servers |

How MCP Gateway Complements Anthropic's Tool Search
January 2025: Anthropic released Tool Search Tool - a native server-side feature for discovering tools from large catalogs using
defer_loadingand regex/BM25 search.
MCP Gateway and Anthropic's Tool Search solve different problems:
| Problem | Anthropic Tool Search | MCP Gateway |
|---|---|---|
| Tool Discovery (finding the right tool from 100s) | ✅ Native defer_loading + search |
✅ Progressive disclosure |
| Result Filtering (trimming large results) | ❌ Not available | ✅ maxRows, fields, format |
| Auto-Summarization (extracting insights) | ❌ Not available | ✅ 60-90% token savings |
| Delta Responses (only send changes) | ❌ Not available | ✅ 90%+ savings for polling |
| Aggregations (count, sum, groupBy) | ❌ Not available | ✅ Server-side analytics |
| Code Batching (multiple ops in one call) | ❌ Not available | ✅ 60-80% fewer round-trips |
| Skills (reusable code patterns) | ❌ Not available | ✅ 95%+ token savings |
Bottom line: Anthropic's Tool Search helps you find the right tool. MCP Gateway helps you use tools efficiently by managing large results, batching operations, and providing reusable patterns.
You can use both together - let Anthropic handle tool discovery while routing tool calls through MCP Gateway for r
Configuration
{"mcpServers": {"mcp-gateway": {"type": "url", "url": "http://localhost:3010/mcp"}}}