MagnusCole/mcp-gateway
Unify multiple MCP servers behind a single endpoint. Lazy loading, auto-cleanup, Python @tool plugins, role-based filtering.
[](https://pypi.org/project/mcp-unify/) [](LICENSE) [](https://pypi.org/project/mcp-unify/)
Unify multiple MCP servers behind a single endpoint. Lazy loading, auto-cleanup, Python plugins, role-based filtering.
If you use Claude Code or any MCP client with 3+ servers, you get:
mcp-gateway runs one process that proxies N MCP servers on-demand:
Claude Code / MCP Client
│
▼
mcp-gateway (1 process)
├─ [plugin] Python @tool functions ← in-process, 0 overhead
├─ [lazy] filesystem-server ← subprocess spawned on first call
├─ [lazy] github-server ← subprocess spawned on first call
└─ [lazy] playwright ← subprocess spawned on first call
↑
5 min idle → auto-killpip install mcp-gatewaygateway.yamlservers:
filesystem:
command: npx
args: ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"]
github:
command: npx
args: ["-y", "@modelcontextprotocol/server-github"]
env:
GITHUB_TOKEN: "${GITHUB_TOKEN}"
enabled: false
idle_timeout: 300stdio (for Claude Code):
mcp-gateway stdio --config gateway.yamlSSE (for remote clients):
mcp-gateway serve --config gateway.yaml --port 8765{
"mcpServers": {
"gateway": {
"command": "mcp-gateway",
"args": ["stdio", "--config", "/path/to/gateway.yaml"]
}
}
}Add custom tools with zero boilerplate:
from mcp_gateway import tool
@tool(description="AdLoading reviews...