🧠the-brain

Remote Mode

Run the-brain on a Linux server, connect from macOS

Remote mode lets you run the-brain on a headless Linux server while using your Mac as a client.

Architecture

β”Œβ”€ Linux Server ──────────────────────┐
β”‚  the-brain daemon start              β”‚
β”‚  β”œβ”€ API :9420   ← Bearer mb_xxx    β”‚
β”‚  β”œβ”€ MCP SSE :9422 ← Bearer mb_xxx β”‚
β”‚  └─ Storage: SQLite or LibSQL     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β–²              β–²
         β”‚              β”‚
    β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚ Agent     β”‚  β”‚ MCP Client    β”‚
    β”‚ (Mac)     β”‚  β”‚               β”‚
    β”‚ Cursor    β”‚  β”‚ Claude Desktopβ”‚
    β”‚ Claude CD β”‚  β”‚ Cursor, Zed   β”‚
    β”‚ Windsurf  β”‚  β”‚               β”‚
    β”‚ β†’ push 60sβ”‚  β”‚ β†’ SSE + auth  β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Server Setup

# On Linux server
the-brain init --remote
# β†’ Generates auth token, sets bindAddress: 0.0.0.0

the-brain daemon start
# β†’ API on 0.0.0.0:9420, MCP SSE on 0.0.0.0:9422

cat ~/.the-brain/config.json | grep authToken
# β†’ Save this token!

Client Setup

# On macOS
export THE_BRAIN_REMOTE_URL="http://<server-ip>:9420"
export THE_BRAIN_AUTH_TOKEN="mb_<token>"

# Start push agent (polls local IDE logs, pushes to server)
the-brain agent

# Or one-shot
the-brain agent --once

Auth

All endpoints except /api/health require:

Authorization: Bearer mb_<token>

The agent automatically adds this header.

Storage Options

  • SQLite (default): Local to server
  • LibSQL (Turso): Shared across multiple servers
the-brain backend set --slot storage --backend libsql

On this page