One URL and one key for all your MCP servers
Shipped by Brenden Ehlers
Say your team’s agents use three MCP servers: docs search, the ticket tracker, and an internal deploy tool. Each one wants its own URL and its own token in every developer’s config. When someone leaves, you rotate three tokens. When an agent runs a tool it shouldn’t have, you find out from the tool’s owner.
MCP Gateway puts those servers behind AI Gateway. Agents connect to https://mcp.ngrok.ai/ with the same access key they use for models. The gateway adds each server’s credentials, hides the tools a key isn’t allowed to call, and records every call in Activity.
What the gateway does
- One endpoint.
https://mcp.ngrok.ai/lists every tool the key can use, from every server, named<label>__<tool>. Each server also keeps its own URL,https://mcp.ngrok.ai/s-<id>, for clients that want one server at a time. - Upstream credentials stay on the gateway. A server can take no credentials, one stored secret in a header or query parameter, headers forwarded from the client, or the client’s own OAuth token, passed through unchanged. The gateway never sends your access key upstream.
- Per-key tool access. An access key configuration allows servers by label and tools as
docs/searchordocs/*. Tools a key can’t call disappear fromtools/list, and a call to one returns JSON-RPC error-32003, “tool not allowed for this key.” - Tool search. With a dozen servers, the tool list alone can eat an agent’s context. Turn on
mcpSearchEnabled, and the agent getsngrok-gateway__search_toolsto find the tool it needs instead. - Every call in Activity. The new MCP calls view shows each request’s key, server, tool, and outcome, including the calls the gateway denied. Turn on request capture to keep the bodies too.
MCP Gateway works on every AI Gateway account, with no plan to upgrade. You pay for usage from your AI Gateway credits, the same as model requests: $10 per 1 million billable operations. A tools/call that the server answers counts as one, even when the tool reports an error. So does a tool search. initialize, tools/list, and denied calls are free. If your credits run out, billable calls return 402 until you top up, but your agent can still list its tools.
Get started
You need an MCP server with a public HTTPS URL. The MCP Gateway docs cover each authentication mode, the limits, and the API.
Sign in
Register a server
Open MCP Gateway → Servers and click Register server. Give it a Label, such as
docs, its Upstream URL, and an upstream auth Mode.Pick the tools a key can call
Open Keys, create an access key configuration, and under MCP tools allow only
docs/search. Create an access key that uses it.Connect your agent
Add the gateway to Claude Code:
Run
/mcpin Claude Code. The tool list showsdocs__search, plusngrok-gateway__list_servers, and nothing else fromdocs.Check Activity
Ask your agent to search the docs. Then open Activity, select MCP calls, and find the request. It shows the key, the server, the tool, and the outcome.