MCP Gateway
A single Rust gateway between an agent and all its MCP servers: the client sees 9 to 17 meta-tools and finds the rest on demand.
- 84 ★ on the repository
- Last commit
Broad access
Why this level
- The gateway holds environment variables and keys of every connected server
- The setup wizard rewrites Claude Code, Cursor and other client configurations
- A network-bound run opens a port protected only by a token
Install
- Works in
Manual install
brew install MikkoParkkola/tap/mcp-gatewayThe recommended route for macOS and Linux. On Homebrew 6.0 and newer run `brew trust --tap MikkoParkkola/tap` first.
Access and checks
How we reviewBroad accessThe tool can change data, run commands or handle secrets.
- The gateway holds environment variables and keys of every connected server
- The setup wizard rewrites Claude Code, Cursor and other client configurations
- A network-bound run opens a port protected only by a token
This is third-party code. Review the repository files before installing.
What it does
MCP Gateway runs as one binary and connects to a client as a single MCP server. Your MCP servers and REST APIs stand behind it. Instead of hundreds of tool definitions the agent gets a compact set: `gateway_search_tools` finds the tool it needs, `gateway_invoke` calls it. It ships with more than 110 ready REST capability definitions, and another API is added through a YAML file or an OpenAPI import. The `mcp-gateway setup wizard --configure-client` wizard finds servers in Claude Desktop, Claude Code, Cursor, Zed, Continue.dev and Codex, imports them into `gateway.yaml` and writes the gateway into client configs with a backup. `mcp-gateway doctor` checks the configuration, port, environment variables and server health. A tool poisoning check scans tool descriptions before they reach the agent.
Who it is for. People who connected dozens of MCP servers to Claude Code, Cursor or Codex and lose context to tool definitions.
Good fit when
- Twenty servers and a hundred tools are connected, and their definitions eat the context before the first question
- The same servers are needed in Claude Code, Cursor and Codex and configuring each client separately is tedious
- An internal REST API has to reach the agent without wrapping it in a dedicated MCP server
- Before a run you want to check configuration, port and server health with `mcp-gateway doctor`
Not a fit when
- You have two or three servers whose definitions fit the context: the extra search hop adds turns
- You need token savings on every task: in the author benchmark the meta mode used 1.2 to 16.1 percent more input tokens and added one turn
- The gateway is needed in a commercial project without a separate license: there is no free permission for that case
Example request
Install mcp-gateway, move my MCP servers behind one gateway and show which tools remain visible to the agent.MCP
- Transport
- stdio, http
- Authentication
- not required
Environment variables
MCP_GATEWAY_CONFIG_DIR- Gateway data and configuration directory, `~/.mcp-gateway` by default.
Limitations
The license is PolyForm Noncommercial 1.0.0: personal and nonprofit use is free, commercial use needs a separate license. The author states that the gain is catalog capacity, policy and routing, and that overall token savings are not proven. The gateway holds access to all your servers and rewrites client configs. A network-bound run needs a token; use `--dry-run` before writing to a client configuration.
How to disable. Restore client configs with `mcp-gateway setup export --rollback <backup file>`, then stop the gateway and delete its binary. The default data directory is `~/.mcp-gateway`.
FAQ
How do I connect the gateway to Claude Code?
Run the `mcp-gateway setup wizard --configure-client` wizard or `mcp-gateway setup export --target claude-code`. The gateway is written to `~/.claude.json`, the old file is backed up and the restore command is printed alongside.
How do I add a new server?
The `mcp-gateway add tavily` command takes a known server from the built-in registry of 48. An arbitrary command is added like this: `mcp-gateway add my-server -- npx -y @some/mcp-server`. It is compatible with `claude mcp add`.
Does the gateway really save tokens?
Not in the author benchmark: both modes completed every task, and the meta mode used 1.2 to 16.1 percent more input tokens and added one turn. The value is a large catalog without a bloated tool list.
Where do I see gateway status?
After `mcp-gateway serve` the web dashboard opens at `http://localhost:39400/ui`. The operator dashboard `/dashboard` needs admin credentials and the serve command prints a login link.
Which install methods exist?
Homebrew, `cargo install mcp-gateway`, `cargo binstall mcp-gateway`, a prebuilt Windows x64 binary and a Docker image. Docker with npx or uvx backends needs the `latest-full` tag.
Discussion
No questions or reviews yet.
Related
MCP serversA local MCP gateway: set servers up once and use them in Claude Code, Codex, Cursor and other agents, with keys in the OS keychain
A Rust manager that brings MCP services under one daemon: a CLI, a web UI, an HTTP API and SDKs for Python and Rust
A mail server for agents sharing one repository: messages, threads, file reservations and a 16-screen TUI
A CLI for any MCP server: list and call tools, resources and prompts, run mock and proxy modes, guard access and manage agent configs
The mcpl CLI searches tools across several MCP servers and calls them from the terminal, with OAuth sign-in done by a human
A CLI that turns any MCP server, OpenAPI spec or GraphQL endpoint into commands at runtime, with no codegen
Comparison with similar tools
Cards that share the main search query, and how they differ.
README in short
The page opens with the problem: every connected tool costs about 150 tokens of context in each request. Then come the architecture, a four-command quick start, three ways to configure, a table of client config paths and a security section. License and commercial terms have their own section.