mcp-gateway

MCP Gateway

Unlimited MCP servers, tools and APIs. One fixed context cost.

Plug every tool you own into Claude, Cursor, Codex or any MCP client. MCP Gateway is a single Rust binary that sits between an AI client and all of its tools. The agent sees a compact set of meta-tools (11 in the default setup) instead of hundreds of tool definitions, and finds and calls the right backend tool when it needs it.

Context cost on a 100-tool stack

~1,100 tokens of tool definitions per request through the gateway, against ~15,000 when every tool is loaded directly.

Modeled, not measured: about 150 tokens per tool and 100 per meta-tool, from the project's published benchmark claims. A client that loads definitions lazily pays less either way, and a task that searches before it calls can spend more tokens over the whole task. Method

How it works

  1. Your AI client connects once

    Claude, Cursor, Codex or any MCP client talks to one gateway and loads its small, fixed set of meta-tools.

  2. The agent searches the catalog

    gateway_search_tools finds the right tool across every connected server and API.

  3. It calls the tool on demand

    gateway_invoke routes the call to the backend: an MCP server over stdio or HTTP, or one of 130+ built-in REST capabilities.

One binary

Self-hosted gateway and proxy in one Rust binary. No runtime to install.

Import what you have

One command imports the MCP servers you already use and wires up your clients.

130+ capabilities built in

REST APIs such as GitHub and Stripe are ready to call without writing a server.

Security in the path

A firewall checks requests and responses, and access rules decide which caller sees which tools.

Install

This page describes 4.0. Until 4.0.0 is released, these commands install the current 3.x release.

brew trust --tap MikkoParkkola/tap   # Homebrew 6.0+
brew install MikkoParkkola/tap/mcp-gateway
mcp-gateway setup wizard --configure-client
mcp-gateway serve
mcp-gateway doctor   # in a second terminal, while serve runs

Also on crates.io: cargo install mcp-gateway. Nothing to import yet? mcp-gateway init writes a working configuration with public capabilities.

License

Personal and noncommercial use is free, including running the full gateway. Commercial use needs a commercial license. From 4.0 the gateway is under PolyForm Noncommercial; MIT grants on earlier 3.x releases are unchanged. License details