Tunneling with ngrok
Some MCP integrations cannot use localhost. ChatGPT Developer Mode runs in the browser and requires a remote HTTPS URL. OpenClaw and Claude Cowork may need to reach PiecesOS from another machine. ngrok creates a public HTTPS URL that forwards traffic to your local PiecesOS instance. The tunnel is active only while ngrok is running, and ngrok handles TLS certificates automatically.
Prerequisites
<pos-download-guide />
Installing ngrok
```bash
brew install ngrok
```
```bash
curl -sSL https://ngrok-agent.s3.amazonaws.com/ngrok.asc \
| sudo tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null \
&& echo "deb https://ngrok-agent.s3.amazonaws.com buster main" \
| sudo tee /etc/apt/sources.list.d/ngrok.list \
&& sudo apt update \
&& sudo apt install ngrok
```
Verify the installation:
ngrok help
Setting Up the Tunnel
```bash
ngrok config add-authtoken YOUR_AUTH_TOKEN
```
Replace `YOUR_AUTH_TOKEN` with the token from your [ngrok dashboard](https://dashboard.ngrok.com/get-started/your-authtoken).
```bash
ngrok http 39300
```
Replace `39300` with your actual port if different. ngrok will display a forwarding URL like `https://abc123.ngrok-free.app`. Copy the **HTTPS** URL.
MCP Endpoint URLs
Append the correct path to your ngrok URL:
| Endpoint | Path | Use for |
|---|---|---|
| Streamable HTTP (MCP) | /model_context_protocol/2025-03-26/mcp |
ChatGPT, Claude Cowork Connectors UI, OpenClaw (MCPorter + mcp-remote) |
| SSE | /model_context_protocol/2024-11-05/sse |
MCP Bridge and other clients that require the legacy SSE endpoint |
Example: if ngrok shows https://abc123.ngrok-free.app, use https://abc123.ngrok-free.app/model_context_protocol/2025-03-26/mcp for ChatGPT, Claude Cowork, or OpenClaw, or https://abc123.ngrok-free.app/model_context_protocol/2024-11-05/sse for MCP Bridge.
Configuring Your MCP Client
ChatGPT Developer Mode
See ChatGPT Developer Mode integration for full setup.
Claude Cowork (Connectors UI)
See Claude Cowork integration for full setup.
OpenClaw (Remote)
Install mcp-remote globally (npm install -g mcp-remote@0.1.38), then edit ~/.openclaw/workspace/config/mcporter.json:
{
"mcpServers": {
"pieces": {
"command": "mcp-remote",
"args": [
"https://YOUR_NGROK_URL.ngrok-free.app/model_context_protocol/2025-03-26/mcp"
]
}
}
}
See OpenClaw integration for full setup.
Tips & Troubleshooting
The tunnel is active only while ngrok http 39300 is running. Start ngrok when you need remote access, or keep it running in a dedicated terminal for regular use.
Troubleshooting
Security
ngrok exposes PiecesOS to the internet—use it only when required. Keep your ngrok auth token private. For private network access, consider Tailscale or a VPN instead of a public tunnel.
Next Steps
Configure your MCP client with the ngrok URL: ChatGPT Developer Mode, Claude Cowork, OpenClaw, or MCP Bridge.