Skip to content

Add Cloudflare Tunnel option for public HTTPS (claude.ai connectors)#3

Merged
flocom merged 1 commit into
mainfrom
feat/cloudflare-tunnel
Jun 7, 2026
Merged

Add Cloudflare Tunnel option for public HTTPS (claude.ai connectors)#3
flocom merged 1 commit into
mainfrom
feat/cloudflare-tunnel

Conversation

@flocom

@flocom flocom commented Jun 7, 2026

Copy link
Copy Markdown
Owner

Summary

The claude.ai / Claude Desktop custom connector flow requires a publicly reachable HTTPS endpoint on a standard port (443). A http://localhost:3000 URL — or any :3000 URL behind Cloudflare — fails with "Couldn't reach the MCP server" because localhost isn't public, Cloudflare's proxy doesn't forward port 3000, and the endpoint needs valid TLS.

This adds an opt-in Cloudflare Tunnel so the Dockerized server can be exposed over HTTPS with no open ports and automatic DNS + TLS.

Changes

  • docker-compose.yml: optional cloudflared service behind the tunnel profile (docker compose --profile tunnel up -d), driven by TUNNEL_TOKEN. Default up is unchanged. Adds a configurable MCP_CORS_ORIGIN.
  • README.md: "Expose publicly" section explaining the requirement (public HTTPS/443) and the Cloudflare Tunnel steps; connector URL is https://<host>/mcp (no port).
  • .gitignore: ignore .env / .env.* so tunnel tokens aren't committed.

Notes

  • For purely local use (Claude Code / .mcp.json / claude mcp add), none of this is needed — the public route is only for the connector UI / sharing.

🤖 Generated with Claude Code

The claude.ai / Claude Desktop "custom connector" flow needs a publicly
reachable HTTPS endpoint on port 443 — localhost and :3000-behind-Cloudflare
don't work. Add an opt-in `cloudflared` service (compose `--profile tunnel`)
that exposes the server over HTTPS with no open ports, plus README steps and a
configurable MCP_CORS_ORIGIN. Ignore .env so tunnel tokens aren't committed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@flocom
flocom merged commit 4637942 into main Jun 7, 2026
@flocom
flocom deleted the feat/cloudflare-tunnel branch June 7, 2026 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant