https://mcp.ngrok.ai, and the same AI Gateway access key your agents already send for models.
The gateway holds each server’s upstream credentials, hides tools a key is not allowed to call, and records every MCP call in Activity.
It is available on every AI Gateway account and bills per operation.
This page covers MCP servers that AI Gateway fronts for your agents.
To give one MCP server of your own a public HTTPS URL with an ngrok endpoint and Traffic Policy, see Use ngrok as an MCP Gateway.
How it works
- You register each upstream MCP server with a label, such as
docs, its HTTPS URL, and how the gateway authenticates to it. - The gateway syncs each server’s tool catalog.
- Your agent connects to
https://mcp.ngrok.aiwith an access key. It sees the tools of every server the key may reach, named<label>__<tool>, such asdocs__search. - On each
tools/call, the gateway checks the key’s access configuration, removes the client’s ngrok key, adds the upstream credential, and forwards the call.
https://mcp.ngrok.ai/<route>, shown on the server in the dashboard and in the API url field.
Use it when a client should see only that server’s tools, without the <label>__ prefix.
Set up an MCP gateway
You need an MCP server with a public HTTPS URL.Register a server
- Open app.ngrok.ai → MCP Gateway → Servers and click Register server.
- Set a Label, such as
docs. A label is 1 to 64 lowercase letters, digits,-, or_, starts with a letter or digit, and can’t contain__.ngrok-gatewayis reserved. - Set the Upstream URL.
- Choose an upstream auth Mode. See Upstream authentication.
- Save the server and turn it on.
The server’s status shows
readyonce its catalog syncs.
Choose the tools a key can call
- Open Keys → Configurations and create an access key configuration.
- Under MCP tools, allow
docs/search. - Create an access key that uses the configuration.
Connect your agent
Export the key, then add the gateway to your client.
For Claude Code:The MCP Gateway page in the dashboard has the same step for Codex, Cursor, VS Code, Windsurf, Amp, and more clients.Run
/mcp in Claude Code.
The tool list shows docs__search and ngrok-gateway__list_servers, and no other tools from docs.Control tool access
An access key configuration has two optional MCP lists:- A key with no access configuration, or a configuration with no MCP lists, reaches every server and tool on the account.
- An empty list denies everything in that list.
- When both lists are set, a call must pass both.
- MCP lists are separate from the provider and model lists. A key restricted to one model is not restricted for MCP.
- A server can also have its own allowed tools list. A tool outside it is hidden from every key.
tools/list.
A call to one returns JSON-RPC error -32003 with the message tool not allowed for this key, and the gateway never contacts the upstream.
A call to a server the key can’t reach returns -32003 with mcp server not allowed for this key.
Built-in tools
The gateway adds its own tools under thengrok-gateway label:
Search is off by default.
Turn it on in the access key configuration, or set
mcpSearchEnabled with the API.
Upstream authentication
Your agent never sends upstream credentials. The gateway strips the client’s ngrok key before it calls the upstream, and it refuses an ngrok key or personal access token as an upstream credential.Captures
Each server has a capture level:off, metadata, or full.
At full, the gateway stores request and response bodies when captures are on for the account, except for tools in the server’s exclusion list.
Read captures from the request in Activity.
Pricing
MCP Gateway costs **$10 per 1 million billable operations** ($0.00001 each), paid from credits.- A completed
tools/callis one operation, including a result withisError, because the upstream answered. - A successful
ngrok-gateway__search_toolscall is one operation. initialize,tools/list,list_servers, anddescribe_toolsare free.- A denied call, an upstream failure, a timeout, or a call the client cancels is not billed.
Limits
Manage servers with the API
The AI Gateway API athttps://api.ngrok.ai manages servers:
revision and fails if the server changed since you read it.
A personal access token calls https://mcp.ngrok.ai only when it has the ai-gateway:mcp:request scope.
A server binding a provider key also needs ai-gateway:providers:read.
The ngrok MCP server has AI Gateway tools that manage MCP servers and access key configurations from your agent.
Related
- Access key configurations
- Credits
- Use ngrok as an MCP Gateway, for one MCP server behind an ngrok endpoint
- ngrok MCP server