# One URL and one key for all your MCP servers

> Register your MCP servers with AI Gateway, connect agents to mcp.ngrok.ai with the access key they already use for models, and choose which tools each key can call.

- Date: 2026-12-02
- Shipped by: Brenden Ehlers
- Products: AI Gateway
- URL: https://ngrok.com/changelog/ai-gateway-mcp-gateway

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/search` or `docs/*`. Tools a key can't call disappear from `tools/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 gets `ngrok-gateway__search_tools` to 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](https://ngrok.com/docs/ai-gateway/mcp-gateway) cover each authentication mode, the limits, and the API.

<Steps>
<Step title="Sign in">

[Create an ngrok account or sign in](https://app.ngrok.ai/).

</Step>
<Step title="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**.

</Step>
<Step title="Pick the tools a key can call">

Open [**Keys**](https://app.ngrok.ai/keys), create an access key configuration, and under **MCP tools** allow only `docs/search`. Create an access key that uses it.

</Step>
<Step title="Connect your agent">

Add the gateway to Claude Code:

```bash
claude mcp add --transport http ngrok-mcp-gateway https://mcp.ngrok.ai/ \
  --header "Authorization: Bearer $MCP_GATEWAY_API_KEY"
```

Run `/mcp` in Claude Code. The tool list shows `docs__search`, plus `ngrok-gateway__list_servers`, and nothing else from `docs`.

</Step>
<Step title="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.

</Step>
</Steps>
