gateway · mcprating — Claude Code MCP server: what it does, how to install
Runs MCP servers on demand from an index while blocking access to sensitive environment variables and saving model context.
claude mcp add gateway -- npx -y @mcp-rating/gatewayWhat gateway does
The gateway acts as a meta-server. Instead of loading dozens of tool definitions into every prompt, it exposes 13 meta-tools with a flat overhead of 2,644 tokens. Other servers spin up on demand. Their schemas enter the prompt only after an explicit connection.
Process spawning strips ambient secrets. Child servers receive an allowlist containing PATH, HOME, USER, and explicitly named values. Reading sensitive files like ~/.ssh or .env remains possible unless container isolation with Docker is turned on.
Context savings depend on inventory size. Break-even happens around three to five servers. With just one server, discovery and connection turns make the gateway roughly 2.7 times more expensive than a static configuration.
What it helps with
- Prevent MCP utilities from reading arbitrary environment variables
- Cut context token overhead when keeping many integrations available
- Attach servers on demand without editing client configuration files
- Enforce Docker container sandboxing against local credential files
Example prompts for the agent
- Search the MCP catalog for a Postgres tool and connect to it
- List active gateway meta-tools and currently attached servers
- Find and connect an MCP server for GitHub operations
How to install gateway
Platform CLI
claude mcp add gateway -- npx -y @mcp-rating/gatewayPlatform CLI
codex mcp add gateway -- npx -y @mcp-rating/gatewayConfig file
{
"mcpServers": {
"gateway": {
"command": "npx",
"args": [
"-y",
"@mcp-rating/gateway"
]
}
}
}Config file
{
"servers": {
"gateway": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@mcp-rating/gateway"
]
}
}
}Platform CLI
gemini mcp add gateway npx -y @mcp-rating/gatewayStep by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about gateway
How to install gateway in Claude Code?
Run claude mcp add gateway -- npx -y @mcp-rating/gateway. Claude Code will register the server and run it via npx.
What does gateway do?
It provides an on-demand bridge to an MCP server registry. The proxy restricts child process environment variables and keeps static tool schemas out of the context window until needed.
When does gateway save tokens?
The break-even threshold is three to five servers. Below that count, discovery overhead makes static server declarations cheaper in total token usage.
Similar MCP servers
All MCP servers for Agent setup: memory, context, orchestration →gateway by other authors comes first.