MCP tunnels are in research preview and are available to organizations on the Claude Enterprise plan by request. To request access, contact your Anthropic account team.
Create a Tunnels API key
The setup component that runs alongside the tunnel stack needs a short-lived credential to create the tunnel, register its certificate authority (CA) certificate with Anthropic, and fetch the tunnel token. In claude.ai that credential is a Tunnels API key.- In claude.ai, go to Organization settings > Tunnels. This page appears once Anthropic has enabled MCP tunnels for your organization.
- Open Tunnels API and create a key.
- Copy the key somewhere safe for the next section. You pass it to the setup component once.
Deploy the tunnel stack
Choose Helm if you run Kubernetes. The chart provisions the tunnel, stores the credentials in a Secret, and renews the server certificate automatically. Choose Docker Compose for a single host or a VM, where you run the setup component and certificate renewal yourself. Both paths need at least one route. A route maps a subdomain of your tunnel domain to the internal URL of an MCP server, in the formscheme://host:port with no path. The examples use docs pointing at http://docs-mcp.example.corp:8080. Replace them with your own servers.
- Helm
- Docker Compose
1
Fetch the default values
2
Configure routes
Edit With these routes, Claude reaches the servers at
values.yaml and add a routes entry under gateway.config for each MCP server. Leave tunnel.id empty so the setup component creates the tunnel during install.values.yaml
docs.<your-tunnel-domain> and search.<your-tunnel-domain>. If a route targets an address outside the RFC 1918 private ranges (some managed Kubernetes distributions allocate Service IPs elsewhere), add the range under gateway.config.upstream.allowed_ips as described in Troubleshooting.3
Review the rendered manifests
Render the chart with a placeholder key and review the output according to your organization’s practices for third-party manifests. Rendering makes no API calls.
4
Install
Read the Tunnels API key into an environment variable so it stays out of your shell history and values file, then install into a dedicated namespace.The setup component runs as a pre-install hook, so
helm install blocks until the tunnel is created, the CA is registered, and the credentials are stored in the mcp-tunnel Secret. If the install fails with a hook error, see Troubleshooting.5
Read the tunnel domain
You need the tunnel domain to add connectors later.The value looks like
abc123.tunnel.anthropic.com.networkPolicy.enabled: true in values.yaml and list your MCP servers under networkPolicy.mcpServers. The policy already allows cloudflared to reach the tunnel edge. Your cluster’s network plugin must support NetworkPolicy.For later configuration changes such as routes or replica count, edit values.yaml and run helm upgrade with the same --version and -f values.yaml, without the API key. Keep a complete values.yaml rather than relying on --reuse-values, because Helm’s deep merge can silently keep a route you deleted.Verify the connection
Check the logs on your side first. cloudflared logs fourRegistered tunnel connection lines when it has reached the tunnel edge, and the proxy logs one route configured line per route.
Add tunneled servers as connectors
Each route becomes a custom connector for your organization. The connector URL is the route’s tunnel hostname plus the path your MCP server serves. Many servers serve at/mcp, and the proxy forwards the path unchanged.
- In claude.ai, go to Organization settings > Connectors.
- Select Add, then Custom. If Claude asks for the connector type, choose Web.
- Enter the server URL, for example
https://docs.abc123.tunnel.anthropic.com/mcp. - Configure authentication for the server. If its OAuth authorization server is also inside your network, turn on Tunnel OAuth configuration and follow Authenticate to MCP servers behind a tunnel.
- Select Add.
Add more servers later
Add a route for the new server, apply the change, and register the new hostname as another custom connector. No certificate or cloudflared changes are needed, because the server certificate covers every subdomain of your tunnel domain.Rotate credentials
Three credentials are involved, and each rotates differently. Tunnels API key. Used only while the setup component runs. Revoke it after every use and create a new one in Organization settings > Tunnels > Tunnels API when you next need to run setup. Tunnel token. Authenticates cloudflared’s outbound connection. Rotate it on your regular schedule and immediately if you suspect exposure. Rotation does not sever connections that are already established, so you can rotate, restart cloudflared with the new value, and let the old connections drain.- Helm
- Docker Compose
Increment Revoke the API key once the upgrade completes.
tunnel.tokenVersion in values.yaml, create a fresh Tunnels API key, and upgrade. The setup component re-runs, rotates the token, and updates the Secret.- Helm
- Docker Compose
The chart deploys a CronJob that runs daily and renews the certificate once it is within 30 days of expiry. Monitor the CronJob and the certificate’s expiry date to confirm renewal completes.
Remove a tunnel
Decommission a tunnel when you no longer need it, or as the first steps of responding to a suspected compromise. Archiving a tunnel invalidates its token, detaches its domain, and is permanent.1
Record the tunnel ID
2
Stop the tunnel stack
docker compose down --timeout 0 to sever the connection immediately.3
Remove the connectors
In Organization settings > Connectors, remove each custom connector that points at the tunnel’s hostnames.
4
Archive the tunnel
Create a fresh Tunnels API key and call the archive endpoint of the Tunnels API. Revoke the key when you are done.
5
Delete the stored credentials