Skip to main content
The ngrok MCP server lets your AI agent read and manage your ngrok account. Connect a client such as Claude Code, Codex, or Cursor, then ask about your endpoints, traffic, usage, and team, or ask it to make changes, in plain language.
The ngrok MCP server is invite-only. You can request access in the dashboard.
This page covers ngrok’s own MCP server. To put your own MCP server online with ngrok, see the guide on using ngrok as an MCP gateway.
The server URL is:
Use this exact URL. The /mcp path is part of the OAuth resource, so the bare origin https://mcp.ngrok.com doesn’t work.
Access isn’t read-only. Your AI agent can create, change, and delete resources in your account, such as Cloud Endpoints, domains, IP policies, and secrets. The AI agent acts as you, with your role’s permissions, so check what it’s about to do before you approve a tool call. See Make changes safely.

Quickstart

Most clients sign in with OAuth. You add the server, then sign in to ngrok in your browser and approve the consent screen. You never paste a token into your AI agent.
Run:
Don’t pass --client-id or --callback-port. Claude Code finds its client through server discovery.

Other clients

If your client supports OAuth client ID metadata documents, add https://mcp.ngrok.com/mcp as a remote HTTP server. Zed, Goose, and OpenCode work this way. Cloud-only clients, such as claude.ai and ChatGPT, can’t connect yet.

Clients without OAuth

If your client can’t sign in with OAuth, use a personal access token (PAT) instead:
1

Create a personal access token

In the dashboard, go to Access Tokens and create a token. Choose the scopes for what you want your AI agent to do, and set an expiration. Read scopes, such as endpoints:read, let the AI agent look things up. Write scopes, such as endpoints:write and ip-policies:write, let it make changes. Copy the token right away. It starts with ngrok_pat_ and the dashboard shows it only once.
2

Send the token as a bearer header

Configure your client to send this header with every request to https://mcp.ngrok.com/mcp:
For example, with Claude Code:
Most clients that take a JSON configuration accept a headers object next to url.
API keys and authtokens don’t work with the MCP server. Store the PAT the way you store other secrets, such as in an environment variable, and don’t paste it into a chat with your AI agent.

Check that it works

After you sign in, confirm that your client sees the ngrok tools:
  • Claude Code: run /mcp and select ngrok.
  • Codex: run codex mcp list.
  • Any client: ask your AI agent “What ngrok tools do you have?”
Then ask “Which ngrok account am I signed in to?” The AI agent replies with your user, account, role, and plan. Your AI agent can look up:
  • Endpoints, ngrok agents, and Traffic Inspector traffic.
  • Gateway resources, such as domains, TCP addresses, IP policies, certificates, vaults, and event destinations.
  • Your account, team, credentials, usage, and limits.
  • The ngrok documentation.
Your AI agent can change:
  • Cloud Endpoints, including their URL, bindings, pooling, and Traffic Policy.
  • Reserved domains and TCP addresses.
  • IP policies and their allow and deny rules.
  • Vaults and secrets.
  • Credentials: it can revoke authtokens, API keys, and SSH keys.
  • Traffic Policy: it can write a policy and validate it before applying it.

What you can ask

These examples show what a conversation with the ngrok MCP server looks like. Your AI agent picks the tools, so the exact steps can differ.
The AI agent queries Traffic Inspector for status 500 over the last 24 hours, counted per hour in your time zone. You get an hourly breakdown, plus the paths and client IPs behind the spikes. Follow up with “Show me one of those requests” to see its headers, timing, and error detail.
The AI agent groups requests to /login by client IP, then by country. You get the top sources with request counts and the countries they come from.
The AI agent finds the source, checks which IP policy your endpoint’s restrict-ips action uses, and asks to add a deny rule to it. This call changes your account, so your client asks you to approve it first. If no restrict-ips action names the policy yet, the AI agent tells you that the rule doesn’t block anything until one does.
The AI agent looks up that request and reads the ERR_NGROK code in the docs. You get what failed, where it failed (ngrok, your ngrok agent, or your upstream), and how to fix it.
The AI agent reads the rate-limit action docs, writes the policy, and validates it. If validation fails, it fixes the errors and validates again. Then it asks to update your Cloud Endpoint’s Traffic Policy.
The AI agent reserves the domain and replies with the CNAME record to add at your DNS provider. Then it creates a Cloud Endpoint for https://api.example.com with a Traffic Policy that forwards to your internal endpoint. The endpoint serves traffic once your DNS record and certificate are ready.
The AI agent creates a vault, or uses one you name, and adds the secret to it. Then it updates your endpoint’s Traffic Policy to verify webhooks with secrets.get(). Tools never return secret values, so the AI agent can confirm the secret exists but can’t read it back.
The AI agent compares your reserved TCP addresses with your endpoints and lists the ones that are unused. After you confirm the list, it releases each one. A released address might not be available again, so the AI agent asks before it deletes anything.
The AI agent checks which limits are blocking your account right now. You get each limit’s current value and cap, when the block lifts, and the exact error your callers saw.
The AI agent reads your account’s usage beside what your plan includes, then ranks your endpoints by data transfer out. You get the top endpoints with their requests, connections, and data transfer.
The AI agent lists connected ngrok agents with their versions and any deprecation deadlines, and the endpoints they serve. You get the ngrok agents that need an upgrade and by when. An Agent Endpoint that’s missing from the list means its ngrok agent isn’t connected.
The AI agent checks the domain’s certificate status. If provisioning failed, you get the DNS record to fix.
The AI agent joins your team with your API keys. You get each key’s owner, description, and status. For keys whose owner is no longer on the team, it asks to revoke each one. Tools never return the key, token, or secret values themselves.
Traffic questions use Traffic Inspector data, so the window your AI agent can see depends on your plan’s retention. Request headers and bodies are available only when full capture is turned on.

Make changes safely

The MCP server marks each tool as read-only or as one that makes changes, and marks deletes as destructive. Most clients use these markers to ask you before the AI agent runs a tool that changes your account. Keep those prompts on, and read what the AI agent is about to do before you approve it. To keep an AI agent read-only, connect with a personal access token that has only read scopes. See Clients without OAuth.

Troubleshooting

  • “Got new credentials, but ngrok rejected them”: Your account doesn’t have access to the MCP server. Contact ngrok support.
  • Sign-in fails or the server isn’t found: Check that the URL ends in /mcp.
  • Claude Code uses an old callback port: Run claude mcp remove ngrok --scope user, then add the server again.
  • A PAT is rejected: The token is invalid, expired, or revoked. Create a new one and update the Authorization header.