Cloudflare Tunnel¶
A remote MCP client needs a public HTTPS endpoint. Cloudflare Tunnel can forward a public hostname to the local local-shell-mcp service while the server's own OAuth flow protects /mcp.
Create the tunnel and obtain its token¶
Follow Cloudflare's Create a tunnel in the dashboard guide:
- sign in to Cloudflare and open Networking → Tunnels;
- create a remotely managed tunnel and give it a recognizable name;
- copy the installation command shown for the connector; the long
eyJ...value after--tokenis the tunnel token; and - add a Published application route for a hostname such as
mcp.example.com.
The token authorizes a connector to run this tunnel, so keep it private. Cloudflare also documents how to retrieve a tunnel token later.
Choose the service target¶
For the local source setup, set the published application's service URL to:
For the repository's Docker Compose setup, set it to:
Add the public origin and copied token to .env:
LOCAL_SHELL_MCP_BASE_URL is the origin only. Do not append /mcp. Return to Quickstart or Docker Compose to start the selected deployment.
Verify¶
From another network, check:
Use this URL in the MCP client:
Common mistakes¶
- The connector URL does not end in
/mcp. LOCAL_SHELL_MCP_BASE_URLincorrectly includes/mcp.- The tunnel target uses the wrong hostname for local versus Compose deployment.
- The public hostname changed but
.envstill contains the old origin. - OAuth is disabled on a public hostname.
Continue with ChatGPT connector or see Troubleshooting.