mcpTunnel Docs
Expose your local MCP servers to any AI client over the internet. One command, one URL, all your tools.
Getting Started
mcpTunnel discovers your locally configured MCP servers, aggregates their tools into a single endpoint, and tunnels it to the internet via Cloudflare. Any MCP-compatible AI client — ChatGPT, Claude, Cursor, and more — can then access your local tools remotely.
Installation
Pre-built Binaries
Download the latest release for your platform from GitHub Releases:
# Linux & macOS — auto-detect platform
curl -L https://github.com/appsecsanta/mcp-tunnel/releases/latest/download/mcptunnel-$(uname -s | tr A-Z a-z)-$(uname -m) -o mcptunnel
chmod +x mcptunnel
sudo mv mcptunnel /usr/local/bin/From Source (Go)
Requires Go 1.21 or later:
go install github.com/appsecsanta/mcptunnel@latestVerify Installation
mcptunnel --versionQuick Start
The fastest way to expose your MCP servers to an AI client:
Start the tunnel
This auto-discovers your MCP servers and creates a public tunnel:
mcptunnel startCopy the tunnel URL
mcpTunnel outputs a public URL like:
https://api.mcptunnel.sh/mcpConnect your AI client
Paste the URL into your AI client's MCP server configuration. See the Platform Setup section for specific instructions.
--named-tunnel for a persistent URL.Auto-Discovery
mcpTunnel automatically discovers MCP servers from your existing AI tool configurations. No manual setup required.
Supported Sources
| Source | Config Path | Flag |
|---|---|---|
| Claude Desktop | ~/Library/Application Support/Claude/claude_desktop_config.json | --source claude |
| Cursor | ~/.cursor/mcp.json | --source cursor |
| Continue | ~/.continue/config.json | --source continue |
| Custom | ~/.mcptunnel/servers.json | --source mcptunnel |
By default, mcpTunnel scans all sources. Use --source to limit discovery to a specific one:
# Only discover from Claude Desktop config
mcptunnel start --source claudeConfiguration
For servers not defined in any supported config file, create a custom definition at ~/.mcptunnel/servers.json:
{
"mcpServers": {
"my-custom-server": {
"command": "node",
"args": ["/path/to/server.js"],
"env": {
"API_KEY": "your-key"
}
},
"python-tools": {
"command": "python",
"args": ["-m", "my_mcp_server"],
"env": {}
}
}
}Server Definition Fields
| Field | Type | Description |
|---|---|---|
| command | string | The executable to run (e.g., node, python, npx) |
| args | string[] | Command-line arguments passed to the executable |
| env | object | Environment variables set when spawning the server process |
CLI Reference
mcptunnel start
Discovers MCP servers, starts the aggregating HTTP server, and opens a tunnel.
| Flag | Default | Description |
|---|---|---|
| --source | all | Config source to discover from: claude, cursor, continue, mcptunnel |
| --port | 3000 | Local HTTP server port |
| --quick-tunnel | true | Use a temporary Cloudflare tunnel with random URL |
| --named-tunnel | - | Use a persistent named Cloudflare tunnel |
| --safe-only | false | Skip servers whose env vars contain detected credentials |
| --no-tunnel | false | Run the local HTTP server only, without opening a tunnel |
| --verbose | false | Enable detailed logging output |
mcptunnel login
Authenticate with the mcpTunnel service for named tunnels and dashboard access.
mcptunnel loginmcptunnel --version
Print the installed version of mcpTunnel.
Tunneling
mcpTunnel uses Cloudflare tunnels to expose your local server to the internet without port forwarding, firewall rules, or a public IP address.
Quick Tunnel (default)
Generates a temporary random URL. No account required.
mcptunnel start --quick-tunnelNamed Tunnel
Persistent URL that stays the same across restarts. Requires authentication.
mcptunnel login
mcptunnel start --named-tunnel my-dev-machineLocal Only (No Tunnel)
Run the HTTP server on localhost without creating a tunnel. Useful for LAN access or when using your own reverse proxy.
mcptunnel start --no-tunnel --port 8080Tool Aggregation
mcpTunnel merges tools, resources, and prompts from all discovered MCP servers into a single endpoint. Tool names are prefixed with the server name to prevent collisions.
Naming Convention
Tools are namespaced with a double-underscore prefix: servername__toolname
# Example: 3 servers aggregated
filesystem__read_file
filesystem__write_file
filesystem__list_directory
git__log
git__diff
git__status
postgres__query
postgres__list_tablesMCP Endpoint
The aggregated server is available at /mcp using Streamable HTTP transport (MCP 2025-03-26 spec). JSON-RPC over HTTP with session management headers.
Security
Credential Guard
mcpTunnel scans each server's environment variables for patterns that look like secrets (API keys, tokens, passwords). Servers with detected credentials trigger a warning.
# Skip any server with detected credentials
mcptunnel start --safe-onlyOAuth Authentication
Named tunnels support OAuth 2.0 authentication, requiring clients to authenticate before accessing your MCP servers. Quick tunnels are publicly accessible by URL — treat the URL as a secret.
Best Practices
- Use --safe-only in production to skip servers with credentials
- Prefer named tunnels with OAuth for persistent access
- Never share quick tunnel URLs publicly — they grant full tool access
- Review discovered servers before starting the tunnel
- Use --verbose to inspect what tools and resources are being exposed
Platform Setup
Instructions for connecting mcpTunnel to each supported AI client.
ChatGPT
Web and Desktop app- 1.Start mcpTunnel: mcptunnel start
- 2.Copy the tunnel URL (e.g., https://api.mcptunnel.sh/mcp)
- 3.In ChatGPT, go to Settings → Connected Apps → Add MCP Server
- 4.Paste the tunnel URL and save
Claude Desktop
macOS and Windows app- 1.Start mcpTunnel: mcptunnel start
- 2.Copy the tunnel URL
- 3.In Claude Desktop, open Settings → MCP Servers → Add Server
- 4.Select "Streamable HTTP" as the transport type
- 5.Paste the tunnel URL and save
Claude Code
CLI and IDE extension- 1.Start mcpTunnel: mcptunnel start
- 2.Copy the tunnel URL
- 3.Run: claude mcp add mcptunnel --transport http <tunnel-url>
Cursor
AI Code Editor- 1.Start mcpTunnel: mcptunnel start
- 2.Copy the tunnel URL
- 3.In Cursor, open Settings → MCP → Add new MCP Server
- 4.Set type to "streamablehttp" and paste the URL
Troubleshooting
mcpTunnel doesn't find any servers
Check that your AI tool configs exist at the expected paths. Use --verbose to see which paths are being scanned. You can also define custom servers in ~/.mcptunnel/servers.json.
Tunnel URL not working
Quick tunnel URLs are temporary and expire when mcpTunnel stops. Restart mcpTunnel to get a new URL, or use --named-tunnel for a persistent one.
Connection refused errors
Make sure the MCP server process starts successfully. Use --verbose to see server spawn logs. Check that the command and args in your config are correct.
Credential warning appears
mcpTunnel detected environment variables that look like secrets (API keys, tokens, etc.). Use --safe-only to skip those servers, or review the warning and proceed if intended.
Port already in use
Another process is using port 3000. Use --port to specify a different port: mcptunnel start --port 8080
Need help?
Open an issue on GitHub or check the README for the latest updates.