/ngrok:run-mcp-gatewayfrom ngrok
Exposes a local MCP server for remote testing against AI model providers (Claude, OpenAI) with per-provider authentication and traffic inspection via ngrok.
Ships in ngrok. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Expose an in-development MCP (Model Context Protocol) server for remote testing against multiple AI model providers at once, with per-provider authentication and traffic inspection.
Auth is required (ngrok-setup). This job uses a cloud endpoint + internal endpoint and a Traffic Policy with per-provider auth + forward-internal - both from ngrok-engine. A working reference implementation ships in references/: http-transport.ts and traffic-policy.yaml.
MCP client (Claude/OpenAI) --Bearer token--> Cloud Endpoint (public, runs the policy)
--forward-internal--> Agent Endpoint (bound internal, e.g. https://mcp.internal)
--HTTP--> your MCP server (streamable HTTP transport)
Cloud endpoint (not agent) is required here: providers connect on their own schedule, so the public URL must persist independently of your dev process.
Give your MCP server an HTTP transport. MCP dev servers are usually stdio; providers need streamable HTTP. Drop in references/http-transport.ts and call it alongside your existing stdio path:
await runHttp(buildServer, port); // POST /mcp, bound to 127.0.0.1
It needs express and @modelcontextprotocol/sdk. It binds loopback by default, so the process is reachable only through the local ngrok agent - pass { host } to change that. stdio keeps working for local clients.
Run the server as an internal endpoint. The .internal URL is what makes it internal - no extra binding flag:
NGROK_CLIENT_SOURCE=skills/run-mcp-gateway ngrok http <port> --url https://mcp.internal --host-header=rewrite
The --host-header=rewrite matters: traffic arriving via forward-internal carries Host: mcp.internal, which the MCP SDK's DNS-rebinding protection rejects by default.
Create a vault + one secret per provider. These are tokens you generate (not the provider's API key), so you can tell providers apart:
NGROK_CLIENT_SOURCE=skills/run-mcp-gateway ngrok api vaults create --name "mcp-callers"
NGROK_CLIENT_SOURCE=skills/run-mcp-gateway ngrok api secrets create --name "claude-key" --value "$(openssl rand -hex 32)" --vault-id "$VAULT_ID"
When ngrok-surfaces ("Account resources") picks the ngrok MCP server, use gw_create_vault and gw_create_secret instead, and do not ask for an API key. gw_create_secret sends the user to a dashboard form to type the value. Have the user make each token on their machine with openssl rand -hex 32, paste it into that form, and keep it for the provider's settings in step 5. Never ask for the token in the chat.
Create a cloud endpoint with the policy (references/traffic-policy.yaml). Its shape is security-critical, so use it as-is rather than re-deriving it: one rule per provider that matches that provider's bearer token, tags the caller, and forward-internals - which is terminating - followed by an unconditional catch-all that returns 401. Anything without a valid token matches no provider rule and falls through to the 401.
Do not restructure it so the rejection tests the x-mcp-caller tag instead. That header is added by the policy but is also a request header, so a client can send it and skip the check entirely.
Attach via whichever surface fits (see ngrok-surfaces: Terraform or the operator for a durable setup, gw_create_cloud_endpoint on the ngrok MCP server or ngrok api from the CLI for a quick one).
Point each provider at https://<your-cloud-endpoint>/mcp with its bearer token as a custom header. Add a provider later by adding a secret and copying its policy rule.
references/http-transport.ts follows this.x-mcp-caller tells your server which provider called, but a client holding any valid token can also send that header itself. Trust it for logging, not for authorization./mcp path. Providers expect the MCP endpoint at a path (commonly /mcp); make sure the transport and the URL you hand out agree.Prefix each ngrok command you run with NGROK_CLIENT_SOURCE=skills/run-mcp-gateway, as the examples do. Leave it out of files you write for the user. See "Attribution" in ngrok-surfaces.
expose-localhost: it needs per-provider auth and a persistent cloud endpoint, not a plain tunnel.ngrok-setup.http-transport.ts and adapt the user's buildServer.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
mcp, model-context-protocol, ngrok, ai-provider-testing, remote-testing
9 skills in this plugin
/expose-localhostExpose a local service to the public internet using ngrok. Starts a tunnel, optionally adds OAuth or WAF via Traffic Policy. Handles HTTP services and raw TCP (SSH, RDP, databases). Use when asked to expose, tunnel, share, or make a local service publicly accessible, or to reach a machine that has no public IP. Also covers sharing work-in-progress with a specific person and the dev-server quirks that break a shared preview./ngrok-engineReference for ngrok's traffic model - what an endpoint is and what happens to traffic at the edge. Covers endpoint types (agent, cloud, internal), bindings and protocols (HTTP, TLS, TCP), and Traffic Policy - the YAML rule language of phases, CEL expressions, and actions, with a generated catalog of all 26 actions. Other ngrok skills point here to decide what to build, then to ngrok-surfaces to apply it. Not a standalone task - load when another skill references it./npx claudepluginhub ngrok/skills --plugin ngrokOther plugins' skills for the same job