/mcp path is part of the OAuth resource, so the bare origin https://mcp.ngrok.com doesn’t work.
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.- Claude Code
- Codex
- Cursor
- Gemini CLI
- Amp
- Cline
- VS Code
--client-id or --callback-port.
Claude Code finds its client through server discovery.Other clients
If your client supports OAuth client ID metadata documents, addhttps://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:Create a personal access token
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.Send the token as a bearer header
https://mcp.ngrok.com/mcp:headers object next to url.Check that it works
After you sign in, confirm that your client sees the ngrok tools:- Claude Code: run
/mcpand selectngrok. - Codex: run
codex mcp list. - Any client: ask your AI agent “What ngrok tools do you have?”
- 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.
- 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.Show me the 500s on my endpoints by hour for the last day
Show me the 500s on my endpoints by hour for the last day
Who's hammering /login, and from where?
Who's hammering /login, and from where?
/login by client IP, then by country.
You get the top sources with request counts and the countries they come from.Block the top IP hitting /login
Block the top IP hitting /login
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.I got an ngrok error page with request ID 0a1b2c3d…. What happened?
I got an ngrok error page with request ID 0a1b2c3d…. What happened?
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.Rate limit /api on my Cloud Endpoint to 100 requests per minute per IP
Rate limit /api on my Cloud Endpoint to 100 requests per minute per IP
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.Set up api.example.com as a Cloud Endpoint that forwards to my internal service
Set up api.example.com as a Cloud Endpoint that forwards to my internal service
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.Store my Stripe webhook secret in a vault and verify webhooks with it
Store my Stripe webhook secret in a vault and verify webhooks with it
secrets.get().
Tools never return secret values, so the AI agent can confirm the secret exists but can’t read it back.Release the TCP addresses that no endpoint uses
Release the TCP addresses that no endpoint uses
Am I being rate limited? Why are my requests failing?
Am I being rate limited? Why are my requests failing?
Which endpoints used the most data this month?
Which endpoints used the most data this month?
Which of my ngrok agents are out of date, and which endpoints are online?
Which of my ngrok agents are out of date, and which endpoints are online?
Why does my custom domain show TLS errors?
Why does my custom domain show TLS errors?
Who on my team has API keys? Revoke the ones that belong to people who left
Who on my team has API keys? Revoke the ones that belong to people who left
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
Authorizationheader.
Related resources
- Traffic Inspector: The traffic data behind most questions.
- Traffic Policy: The rules your AI agent can write and validate.
- IP policies: How deny and allow rules apply to endpoints.
- Role-based access control: What your role allows the AI agent to do.
- Use ngrok as an MCP gateway: Put your own MCP server online with ngrok.