Documentation Index
Fetch the complete documentation index at: https://docs.runlayer.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Anthropic MCP Tunnels let Claude reach MCP servers that are not directly reachable from Anthropic’s backend. Use this when your Runlayer tenant or upstream MCP servers sit behind private networking, VPN access, or strict inbound firewall rules. With this setup, Claude connects through an Anthropic-managed tunnel hostname. The tunnel forwards traffic to Runlayer, and Runlayer continues to enforce connector auth, policies, ToolGuard scanning, and audit logs.What You Need
Before starting, make sure you have:- A Runlayer single-tenant deployment with the connectors you want to expose to Claude, where Runlayer can deploy the tunnel components.
- Claude organization admin access with MCP Tunnels enabled.
- Outbound network access from the tunnel deployment to Anthropic’s API, Cloudflare tunnel edge, and your Runlayer tenant URL. Anthropic’s guide currently calls for setup access to
api.anthropic.com:443and runtimecloudflaredaccess to Cloudflare edge on port7844TCP/UDP. Use Cloudflare’s current tunnel firewall documentation as the source of truth for IP allowlists. - A secure channel for sharing the short-lived Claude Tunnels API token with Runlayer.
Shared Responsibilities
Customer team
Your team owns the Claude organization and approves the tunnel setup:- Enable MCP Tunnels in Claude and create a short-lived Tunnels API token.
- Confirm that Runlayer should deploy
cloudflaredand the Anthropic MCP Gateway in your Runlayer-operated single-tenant account. - Allow outbound traffic required by Anthropic’s tunnel guide.
- Share the short-lived Tunnels API token with Runlayer through an approved secure channel.
- Register Runlayer connector URLs in Claude once Runlayer provides the tunnel hostname and connector URLs.
- Revoke the Tunnels API token after provisioning is complete.
Runlayer team
Runlayer owns the tenant-side tunnel deployment:- Deploy
cloudflaredand the Anthropic MCP Gateway in the Runlayer-operated single-tenant account. - Configure the gateway to forward tunnel traffic to your Runlayer tenant.
- Store and protect generated tunnel credentials, CA keys, TLS private keys, and tunnel data in the tenant account.
- Set
MCP_TUNNEL_BASE_URLon the Runlayer deployment so OAuth discovery works through the tunnel. - Provide Claude connector URLs for the Runlayer connectors you want to expose.
- Help validate OAuth, connector discovery, and end-to-end tool calls from Claude.
Create a Claude Tunnels API Token
Runlayer needs a short-lived Anthropic Tunnels API token during initial tunnel provisioning. The token is not needed at runtime.Open Claude tunnel settings
Create a Tunnels API token
Share the token securely with Runlayer
Deployment Shape
Anthropic’s tunnel deployment has two runtime components:cloudflaredopens an outbound-only tunnel to Cloudflare. No inbound listener is required.- Anthropic MCP Gateway terminates the inner TLS layer and forwards requests to Runlayer.
cloudflared dials out to Cloudflare.
The transport is protected in layers: Anthropic controls access to the tunnel, the gateway terminates the inner TLS connection, and Runlayer/OAuth controls user-level connector access.
Runlayer recommends one gateway route to the Runlayer tenant and path-based Claude connector URLs. You should not need one tunnel route per connector.
Example gateway route shape:
:443 port and system CA trust.
Runlayer Configuration
Runlayer must know the tunnel origin so its OAuth metadata points Claude to the right backend-to-backend endpoints. Set:resource parameter during authorization.
Add Runlayer Connectors to Claude
After the tunnel is running, add each Runlayer connector as a custom web connector in Claude.Get the connector server ID
Build the Claude connector URL
runlayer subdomain must match the gateway route key. The path identifies the specific Runlayer connector.Register the connector in Claude
<server_id>. It should not require changing tunnel infrastructure.
Validation Checklist
Use this checklist before rolling out to users:- Tunnel containers or pods are healthy.
cloudflaredis connected to Cloudflare.- Anthropic MCP Gateway logs show requests reaching the Runlayer tenant.
MCP_TUNNEL_BASE_URLmatches the tunnel origin used in Claude connector URLs.- Claude can discover the connector tools.
- A test user can complete OAuth and run a low-risk tool call.
- Runlayer audit logs show the Claude-originated MCP request.
curl requests to the tunnel hostname may return a Cloudflare or Anthropic access error. Validate through Claude connector traffic and tunnel logs.Operations
Token handling
The Tunnels API token is only needed for provisioning and some rotation operations. Revoke it after setup. Do not store it in long-lived Runlayer configuration. If Runlayer needs to rotate the tunnel token or archive/recreate a tunnel later, we may ask a Claude organization admin to create a fresh short-lived Tunnels API token.Certificate renewal
Anthropic’s setup tooling generates 90-day server certificates. Renew before expiry using the deployment method from Anthropic’s guide. The gateway can reload renewed certificates without recreating the tunnel.Connector changes
Normal connector additions or removals happen in Claude and Runlayer. Keep the gateway route pointed at Runlayer and use path-based connector URLs.Security practices
- Require SSO for Claude organization admins who can create Tunnels API tokens.
- Keep connector scope minimal; expose only the Runlayer connectors and tools needed by Claude users.
- Keep OAuth required for Runlayer connectors. The tunnel secures transport, not end-user authorization.
- Monitor Runlayer audit logs and tunnel runtime logs for warnings, errors, and unusual traffic.
- Rotate tunnel credentials immediately if compromise is suspected.
Incident response
If tunnel credentials or TLS keys may be compromised:- Stop the tunnel deployment.
- Remove affected custom connectors from Claude.
- Archive or rotate the tunnel through Anthropic’s Tunnels API.
- Rotate affected Runlayer and upstream MCP credentials.
- Review Runlayer audit logs and tunnel logs before restoring service.
Troubleshooting
The Claude Tunnels API token page is missing
The Claude Tunnels API token page is missing
Direct curl or local client testing returns 403
Direct curl or local client testing returns 403
curl or Claude Code.Claude OAuth fails with a missing resource parameter
Claude OAuth fails with a missing resource parameter
MCP_TUNNEL_BASE_URL is set to the tunnel origin used in Claude, for example https://runlayer.<tunnel-id>.tunnel.anthropic.com. The value must not include /api/v1/proxy/....Gateway rejects the upstream URL
Gateway rejects the upstream URL
https://<your-runlayer-tenant-domain>:443.Gateway blocks the Runlayer upstream IP
Gateway blocks the Runlayer upstream IP
The tunnel is not connecting
The tunnel is not connecting
cloudflared can reach Cloudflare edge on port 7844 TCP/UDP, and confirm the tunnel token has not been rotated or revoked. Runlayer handles this check for Runlayer-operated single-tenant deployments.cloudflared logs UDP buffer warnings
cloudflared logs UDP buffer warnings
cloudflared can log UDP receive buffer warnings when using QUIC. This is usually host/network tuning rather than a Runlayer connector issue. Runlayer can tune the host if the tunnel is otherwise unstable.TLS errors occur between the gateway and Runlayer
TLS errors occur between the gateway and Runlayer
Users can see the connector but cannot run tools
Users can see the connector but cannot run tools