MCPGateway
Open-source MCP server — progressive tool discovery, code execution, intelligent routing & token optimization across 50+ tools
claude mcp add --transport stdio abdullah1854-mcpgateway node server.js \ --env LOG_LEVEL="info" \ --env MCP_API_KEY="your-api-key"
How to use
MCP Gateway acts as a universal front-end for multiple MCP servers, providing token-efficient routing, result filtering, and batch execution across all backends. It aggregates tools from the MCP ecosystem and exposes them through a single API and transport, enabling clients to discover and call tools with optimized payloads. With features like progressive disclosure, server-side aggregations, delta responses, and skilled code execution, you can route complex tool calls through the gateway while enjoying significant token and round-trip reductions. Use it to manage large tool catalogs, perform multi-tool operations in parallel, and apply consistent result shaping (maxRows, fields, format) before returning results to clients.
How to install
Prerequisites:\n- Node.js v18+ (or compatible runtime)\n- npm v8+ (comes with Node.js)\n\n1) Install MCP Gateway globally (or install locally in your project):\nbash\nnpm install -g mcp-gateway\n\n\n2) Prepare a minimal configuration file (config.json):\njson\n{ "mcpServers": { "MCPGateway": { "command": "node", "args": ["server.js"], "env": { "MCP_API_KEY": "your-api-key", "LOG_LEVEL": "info" } } } }\n\n\n3) Run the gateway with your config:\nbash\nmcp-gateway --config config.json\n\nIf you prefer a direct Node.js startup, you can run the server script directly (from the gateway package or your project):\nbash\nnode path/to/server.js --config config.json\n\n\n4) Optional: Docker deployment (example)\nbash\ndocker run -d --name mcp-gateway -e MCP_API_KEY=your-api-key -p 8080:8080 mcp-gateway:latest\n
Additional notes
Tips and common considerations:\n- Security: Protect your MCP_API_KEY with proper secrets management. Use OAuth/JWT where supported and enable API key authentication on the gateway.\n- Transport: Gateway supports HTTP streamable transport and SSE; ensure clients use the appropriate transport channel.\n- Performance: Leverage progressive tool disclosure and delta responses to minimize token usage when polling or updating long-running operations.\n- Configuration: Use maxRows, fields, and format to tailor results to client needs. Consider session context and schema deduplication to keep payloads compact across calls.\n- Debugging: Check gateway logs for tool loading status, back-end health, and rate-limiting events. Enable verbose logs during setup for easier troubleshooting.\n- Expansion: Add more MCP servers by editing the config and reloading the gateway via dashboard or hot-reload if supported.\n
Related MCP Servers
Remote
A type-safe solution to remote MCP communication, enabling effortless integration for centralized management of Model Context.
mobile
A Model Context Protocol (MCP) server that provides mobile automation capabilities.
codemesh
The Self-Improving MCP Server - Agents write code to orchestrate multiple MCP servers with intelligent TypeScript execution and auto-augmentation
mcp-frontend
Frontend for MCP (Model Context Protocol) Kit for Go - A Complete MCP solutions for ready to use
vscode-context
MCP Server to Connect with VS Code IDE
mcp-star
⭐ Curated collection of high-quality Model Context Protocol (MCP) servers