Skill DevOps Limited info

mcp-tunnels

A Claude Code plugin that connects Claude to an MCP server inside your private network through an Anthropic MCP tunnel, over an outbound-only connection. Its /create-docker-mcp-tunnel command drives the Docker Compose quickstart end to end: certificates, proxy config, cloudflared, and an optional verifiable sample server.

  • 37.6k GitHub stars
mcp-tunnels — illustration

What it is

mcp-tunnels connects Claude to an MCP server running inside your private network through an Anthropic MCP tunnel. It needs no inbound ports, no public exposure, and no IP allowlisting on your origin, because traffic flows over an outbound-only connection. MCP tunnels is a research preview. It is provided "as-is" with no uptime or support commitment and depends on a third-party transport provider (Cloudflare). Users are advised to review the security model before sending anything sensitive. The plugin's main command, /create-docker-mcp-tunnel [deployment-dir], drives the MCP tunnels quickstart end to end on your machine. It uses Docker Compose with manually supplied credentials, which the README calls the shortest path for local testing. It walks you through the parts only you can do in the Claude Console and runs everything else. The steps are: 1. Preflight checks for Docker, Docker Compose, OpenSSL, and outbound connectivity. 2. You create the tunnel in the Console. The token stays out of the chat and goes into a locked-down, gitignored .env file. 3. It generates a CA and a server certificate with OpenSSL, using the exact extensions the tunnel requires. 4. You register the CA by uploading ca.crt, and the tunnel goes Active. 5. It scaffolds a verifiable FastMCP sample server or wires up an MCP server you already have. 6. It writes mcp-proxy.yaml and a docker-compose.yaml with digest-pinned images and the cloudflared agent. 7. It starts the stack and verifies the proxy and tunnel logs. 8. It shows how to call the server from Managed Agents and the Messages API. The stack it builds runs on your host and has these containers: - mcp-proxy: Anthropic's proxy, which terminates inner TLS with a cert you control, validates upstream IPs, and routes by hostname. - cloudflared: the tunnel agent, which connects outbound-only to the Anthropic tunnel edge and shares the proxy's network namespace. - hello-mcp (optional): a FastMCP sample server, used only if you don't have an MCP server to expose yet. Once running, the routed server is reachable from Claude at https://<subdomain>.<your-tunnel-domain>/<path> with nothing listening on a public port. The command also includes a troubleshooting matrix and the operational basics for token rotation and certificate renewal. The plugin targets the manual-credentials, single-host, local-testing path. For other setups, the README points to the official Deploy with Docker Compose and Deploy with Helm guides. These cover hardened single-host deployments (non-root, read-only rootfs, dropped capabilities), Kubernetes deployments, and programmatic access via Workload Identity Federation.

Who it's for

  • Developers who want Claude to reach an MCP server inside a private network without opening inbound ports
  • Teams testing Anthropic MCP tunnels locally on a single host with Docker Compose
  • Users who need to expose an existing MCP server, or try a FastMCP sample server, to Managed Agents or the Messages API

Requirements

Requirements

  • Docker and Docker Compose
  • OpenSSL 1.1.1 or newer
  • A Claude Console role that can manage MCP tunnels
  • Outbound access to api.anthropic.com:443 and the tunnel edge on 7844 TCP/UDP (no inbound ports are opened)

بلاجن لـ Claude Code بيوصّل Claude بسيرفر MCP جوّا شبكتك الخاصة عن طريق نفق MCP من Anthropic، بدون ما تفتح ولا بورت داخلي. الأمر /create-docker-mcp-tunnel بيمشّيك بالـ quickstart تبع Docker Compose من أولو لآخرو.

Examples

Run the tunnel quickstart

text
text
/create-docker-mcp-tunnel
/create-docker-mcp-tunnel ~/work/my-tunnel

What it does: Starts the guided Docker Compose quickstart. You can optionally pass a deployment directory; the default is ~/mcp-tunnel.

Print the CA certificate to paste into the Console

bash
bash
cat <deployment-dir>/data/ca.crt   # default: ~/mcp-tunnel/data/ca.crt

What it does: The simplest way to register the CA from a browser on another machine: print the small PEM file and paste it into the Console's certificate field.

Pull the CA certificate from a homespace with scp

bash
bash
scp coder.<workspace>:<deployment-dir>/data/ca.crt .
# generic form: scp <homespace-ssh-host>:~/mcp-tunnel/data/ca.crt .

What it does: Copies only ca.crt from the host running the stack to your devbox. Run this from the machine that can SSH to the other.

Push the CA certificate to a devbox

bash
bash
scp <deployment-dir>/data/ca.crt <user>@<devbox-host>:~/

What it does: An alternative when the host running the stack can reach your devbox directly.