Installing the Tunnel (step-by-step)

Status: ✅ Current · Last reviewed: 2026-06-18

Use this when you want cloud AI clients (ChatGPT, Codex, Cursor, etc.) to run terminal commands and read/write files on your local machine.


Prerequisites

  • You ran the one-line installer from the Connect page (it installs the tunnel wrapper for you)
  • You have a valid Memeri token from the Connect page
  • Node.js 18+ installed

Step 1 — Start the tunnel

The installer writes a launcher at ~/.memeri/start-tunnel.sh that bakes in your gateway URL and token. Run it inside the project folder you want ChatGPT / Codex to access — that folder becomes the tunnel root (the only place the AI can read or edit):

cd ~/projects/my-project    # the folder you want the AI to work in
~/.memeri/start-tunnel.sh

Expected logs:

✅ Tunnel session created
✅ Connected to gateway tunnel
✅ Tunnel is running! Press Ctrl+C to stop.

Keep this terminal open while using AI tools. Closing it (Ctrl+C) revokes access.

Where to run it matters. The tunnel's root is the current directory. If you run it from your home folder, the AI can see your home folder; run it from the project you actually want it scoped to.


Step 2 — Reconnect AI connector session

In your ChatGPT / Codex client:

  1. Reconnect the Memeri connector (or open a new chat/session)
  2. Run a probe tool call:
    • terminal_execute with command: "pwd"

Step 3 — Verify tunnel routing

You are correctly aligned when tool responses include:

"_source": "tunnel"

and the cwd/path is the local folder you started the tunnel in.


Running from a cloned repo (dev fallback)

If you're developing against a cloned Memeri repo and don't have the installed wrapper, you can run the tunnel binary directly, passing the platform API + token as flags (the tunnel talks to the platform, not the MCP gateway):

cd ~/projects/my-project
node packages/mcp-core/bin/codebridge-tunnel.js \
  --api={{PLATFORM_URL}} \
  --token='<your-token>'

Tip: keep the token inside single quotes. The installed ~/.memeri/start-tunnel.sh wrapper is the recommended path for everyone else — it already has these baked in.


Common failure modes

1) _source: "railway" or mount-path errors

Example error path: /home/dev/memeri-users/.../my-project

Meaning: the connector session is not aligned to an active tunnel session.

Fix: reconnect both the tunnel and the connector session, then retry.

2) Unauthorized during session create

Usually a wrong API target or an expired token.

Fix:

  • confirm the gateway URL is {{GATEWAY_URL}}
  • rotate/regenerate the token on the Connect page and retry

Final test sequence

  1. terminal_execute: command="pwd"
  2. file_read: a file path inside your tunnel-root folder
  3. Confirm both return _source: "tunnel"