47 lines
1.7 KiB
Markdown
47 lines
1.7 KiB
Markdown
# Publishing mcp-browser with ngrok
|
||
|
||
The `scripts/run_mcp_ngrok.sh` helper launches `mcp-browser` in
|
||
streamable-http mode and exposes it through an ngrok tunnel. If you do not
|
||
provide `--config`, the script spins up an ephemeral config that exposes only
|
||
the built-in tools. Otherwise it will respect your chosen server (or the
|
||
default entry in your config).
|
||
|
||
```bash
|
||
./scripts/run_mcp_ngrok.sh \
|
||
--allow-origin https://platform.openai.com \
|
||
--ngrok-oauth-provider google \
|
||
--ngrok-oauth-allow-email you@example.com
|
||
```
|
||
|
||
Key behaviours:
|
||
|
||
- Picks a free local port and starts `mcp-browser --mode streamable-http` with
|
||
`--http-path /mcp`.
|
||
- Starts `ngrok http` pointing at that port and prints the public URL once the
|
||
tunnel is ready.
|
||
- Writes logs to temporary files (paths shown on startup).
|
||
- Cleans up both processes when interrupted.
|
||
|
||
Useful options:
|
||
|
||
- `--config ~/.claude/mcp-browser/config.yaml` – point at your own config file
|
||
(often combined with `--server <name>`).
|
||
- `--ngrok-region eu` or `--ngrok-domain your-name.ngrok.app` – choose a region
|
||
or reserved domain.
|
||
- `--ngrok-oauth-provider google --ngrok-oauth-allow-email you@example.com` –
|
||
gate the tunnel behind ngrok’s OAuth support (recommended when exposing the
|
||
gateway).
|
||
|
||
Additional `mcp-browser` arguments can be passed after `--`, for example to
|
||
connect to a streamable HTTP upstream:
|
||
|
||
```bash
|
||
./scripts/run_mcp_ngrok.sh -- \
|
||
--transport streamable-http \
|
||
--transport-url http://127.0.0.1:12306/mcp
|
||
```
|
||
|
||
The resulting public URL terminates at `/mcp` and is served via HTTPS by ngrok
|
||
automatically. Configure your MCP client (e.g. OpenAI’s MCP interface) with
|
||
that URL plus any OAuth restrictions you defined.
|