# MCP Gateway

MCP Gateway is an MCP server that keeps the tool catalog behind a small set of meta-tools and calls backends on demand.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 91 repo stars
- Author: MikkoParkkola
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/MikkoParkkola/mcp-gateway
- Updated: 2026-10-24
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/mcp/mcp-gateway

## What it does

MCP Gateway keeps the full tool catalog off the context window. Instead of loading every backend definition, the agent works with 9 to 17 meta-tools: `gateway_search_tools` locates a backend tool and `gateway_invoke` calls it. Only the tools actually used end up in context.

Each connected MCP tool costs around 150 tokens of overhead per request, whether it runs or not. Twenty servers with a hundred tools burn about 15 000 tokens before the conversation even starts. The gateway removes that constant drain, but the search step adds a hop: a benchmark in the repo found no completed-task token saving. So the real reason to run it is catalog capacity, policy and routing.

The binary is written in Rust with no `unsafe` code. Behind it you can connect MCP servers over stdio or HTTP plus more than 110 REST capabilities such as GitHub or Stripe. Personal use is free; running it commercially needs a separate license.

## Requirements
- Needs: Docker

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add mcp-gateway -- docker run -i --rm ghcr.io/mikkoparkkola/mcp-gateway:3.5.1
```

### Codex

**Platform CLI**
```bash
codex mcp add mcp-gateway -- docker run -i --rm ghcr.io/mikkoparkkola/mcp-gateway:3.5.1
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "mcp-gateway": {
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "ghcr.io/mikkoparkkola/mcp-gateway:3.5.1"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "mcp-gateway": {
            "type": "stdio",
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "ghcr.io/mikkoparkkola/mcp-gateway:3.5.1"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add mcp-gateway docker run -i --rm ghcr.io/mikkoparkkola/mcp-gateway:3.5.1
```

## When to use it
- keep hundreds of tools out of the context window
- find backend tools with a search call instead of loading all definitions
- route calls across MCP and REST backends from one place
- drop the fixed token cost of unused tools

## Example prompts
- Search for a documentation tool with `gateway_search_tools` and call it through `gateway_invoke`.
- Put all my MCP servers behind MCP Gateway and list what tools are reachable.
- Run `mcp-gateway doctor` and tell me what is failing.

## Similar
- [Agent MCP Gateway](https://affpapa.org/en/nevibecode/mcp/agent-mcp-gateway.md) — MCP server · ★ 42 repo stars
- [mcp-gateway](https://affpapa.org/en/nevibecode/mcp/rupinder2-mcp-gateway.md) — MCP server · ★ 6 repo stars
- [gateway-workers](https://affpapa.org/en/nevibecode/skills/gateway-workers.md) — skill · 25500 installs
- [gpt2api-openai-gateway](https://affpapa.org/en/nevibecode/skills/gpt2api-openai-gateway.md) — skill · 385 installs
- [llm-gateway](https://affpapa.org/en/nevibecode/skills/llm-gateway.md) — skill · 370 installs
- [logfire-gateway](https://affpapa.org/en/nevibecode/skills/logfire-gateway.md) — skill · 232 installs

## Other versions with the same name
- [MCP Gateway · panossalt](https://affpapa.org/en/nevibecode/mcp/panossalt-mcp-gateway.md) — ★ 6 repo stars

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
