Listed from the MCP registry; nobody on Odel publishes it.
Drive hosted Pi and Claude Code sessions on your Mac from another machine, end-to-end encrypted.
Runs on your machine from its package; the steps are below.
At most: moves money, runs code or commands, deletes data, or sends messages for you.
Odel charges nothing per call. The publisher may charge for its own service.
Runs locally over stdio
This server isn't hosted — your MCP client launches it from a package registry. Use one of the commands below, or drop the config into your client (e.g. Claude Desktop).
Run
npx -y @craftstead/agent-bridge-mcp
MCP client config
{
"mcpServers": {
"agent-bridge": {
"command": "npx",
"args": [
"-y",
"@craftstead/agent-bridge-mcp"
]
}
}
}Browser access to the desktop AI coding-agent sessions running on your Mac.
Agent Bridge installs a small daemon and a menu bar app on the Mac. The daemon enumerates the sessions of the agents you already use — Claude Desktop's Code panel, Claude Code CLI, ChatGPT Desktop's Codex panel, Codex CLI, Antigravity, DeepSeek Harness — and lets you read and reply to them from a phone or any other browser. It can also host its own Claude Code processes so the browser can create sessions that do not depend on a desktop app.
The Mac dials out to a Cloudflare relay. Nothing listens on an inbound port, no tunnel is installed, and no firewall rule is needed. Every byte between the browser and the Mac is end-to-end encrypted with Noise; the relay only sees opaque ciphertext and routing metadata.
Phone / laptop browser Cloudflare Your Mac
┌──────────────────────┐ ┌──────────────────┐ ┌──────────────────────┐
│ web client (PWA) │ WSS │ relay Worker │ WSS │ bridge daemon │
│ Noise initiator │◀────────▶│ Room DO / room │◀────────▶│ Noise responder │
│ E2E: ciphertext │ │ ciphertext only │ │ adapters + SQLite │
└──────────────────────┘ └──────────────────┘ └──────────┬───────────┘
│ local files,
│ sockets, CLI
┌─────────▼──────────┐
│ Claude Desktop, │
│ claude, codex, │
│ agy, dsh, hosted │
└────────────────────┘
bridge init creates a room on the relay and stores the room id, a bridge
token and a Noise static identity in a local state directory.bridge serve (or the menu bar app) opens one outbound WebSocket to the
relay and keeps it open, reconnecting with 1 s → 30 s backoff.bridge invite mints a one-time invite token locally. Only its SHA-256 hash
is uploaded to the relay. The invite link carries the token in the URL
fragment, which browsers never send to a server.xxpsk3 handshake with the Mac, with the PSK
derived by HKDF-SHA256 from the invite token and the room id. Both sides
display a 6-digit confirmation code derived from the two public keys; the
user compares them and confirms.ik pattern — the Mac authenticates the device cryptographically, so no
token is needed and a stolen relay cannot impersonate either side.The web client polls for new messages (5 s in a chat or list view, 10 s for the background session watcher) rather than receiving server-pushed deltas. Push notifications use Web Push/VAPID so the phone still gets an alert when the tab is closed.
Each adapter is a separate module in apps/bridge/src/adapters/. Capability
differs by agent because each one stores and accepts messages differently.
| Adapter key | Display name | List | Read | Send | Create | Notes |
|---|---|---|---|---|---|---|
hosted | Claude Code · Bridge 托管 | full | full | ✅ | ✅ | Bridge owns the CLI process; approvals work end to end |
claude-code | Claude Desktop · Code | partial | partial | ✅ | ❌ | Wakes the desktop app and injects a peer message |
claude-code-cli | Claude Code · CLI | partial | partial | ✅ | ❌ | Running CLI via local socket, otherwise claude --resume -p |
codex | ChatGPT Desktop · Codex | partial | partial | ✅ | ❌ | Only threads that are open in the app; native compact |
codex-cli | Codex · CLI | partial | partial | ✅ | ❌ | codex queue when running, otherwise codex exec resume |
antigravity | Antigravity CLI | partial | partial | ✅ | ❌ | Cannot send while the session is running |
antigravity-desktop | Antigravity 桌面版 | full | full | ❌ | ❌ | Read-only |
dsh | DeepSeek Harness | partial | partial | ✅ | ❌ | Headless profile |
"Partial" reflects the adapter's own capabilities declaration
(Completeness = complete | partial | unknown | unavailable), not a bug: none of
these agents publish a stable session API, so list and read may miss tool
output, attachments or historical turns. See
docs/GUIDE.md for the data source and send mechanism of
each adapter.
macOS 13 or newer, Apple Silicon and Intel in one universal build.
AgentBridge.app into /Applications.The bundle contains the bridge CLI, its compiled output and a Node runtime, so nothing else needs to be installed.
Release builds are signed and notarised only when the Apple secrets are configured. Otherwise macOS blocks the first launch. On macOS 15 or newer the right-click → Open shortcut is gone: dismiss the dialog, open System Settings → Privacy & Security and click "Open Anyway" at the bottom. On macOS 14 and earlier, right-click the app → Open. Either way this also works:
xattr -dr com.apple.quarantine /Applications/AgentBridge.app
git clone https://github.com/gowinder/agent-bridge.git
cd agent-bridge
npm ci
npm run build:wasm -w @craftstead/crypto # Rust Noise module → packages/crypto/wasm/noise.wasm
npm run build # tsc -b across all workspaces
npm run check # type check, including the web client
npm test # build + node:test suite
build:wasm needs a Rust toolchain with the wasm32-unknown-unknown target:
rustup target add wasm32-unknown-unknown
Then either run the daemon directly (npm run bridge -- <command>) or build the
menu bar app with npm run menubar (add
AGENT_BRIDGE_ARCHS="arm64 x86_64" for a universal binary).
The menu bar app does all of this for you; the CLI equivalents are shown for headless machines.
# 1. Create a room on the relay and write local state
npm run bridge -- init --relay https://agent-bridge.craftstead.app \
--web https://agent-bridge.craftstead.app \
--name "My Mac"
# 2. Run the daemon (the menu bar app does this itself)
npm run bridge -- serve
# 3. Mint a one-time invite, valid for 10 minutes
npm run bridge -- invite --ttl 600
init refuses a non-HTTPS relay unless it is a loopback address, and it health
checks /v1/health before writing anything.
invite prints a link of the form:
https://agent-bridge.craftstead.app/#/pair?relay=…&room=…&invite=…
Open it on the phone. The pairing screen shows a 6-digit code; the same code is printed in the terminal (and shown in the menu bar app). Confirm it on both sides and name the device. The invite is single-use, and the room can hold any number of devices.
If a room was already claimed by a different Mac, the relay refuses the new bridge: the first bridge to claim a room id owns it (trust on first use), and replacing it requires clearing the room on the relay side.
The web client has three levels:
#/clients) — one card per installed agent, with live session
counts.#/clients/:appId/projects/:projectId) — sessions grouped by
working directory.…/sessions/:sessionId) — the conversation, a context gauge, a
message composer, attachments, and an optional task rail.In a session you can read the transcript, send a message, answer an approval
prompt, rename the session, request a native compact (or copy /compact when
the agent has no native compact), and — if the Mac owner enabled remote
devtools — browse project files and run a single shell command.
The rail shows the environment, the context window usage, MCP servers and background tasks where the adapter exposes them.
Hosted sessions are the only kind the browser can create. The bridge spawns
claude itself:
claude -p --input-format stream-json --output-format stream-json --verbose \
--permission-mode <mode> --permission-prompts host \
--permission-prompt-tool stdio [--session-id|--resume] [--model]
Because the bridge owns the process's stdin, tool-permission questions arrive as
real prompts in the chat with Allow / Deny buttons, and the answer goes
back as a control_response. Transcripts are written to
$AGENT_BRIDGE_HOME/hosted/.
Create the allowlist first (~/Library/Application Support/AgentBridge/hosted.json,
or $AGENT_BRIDGE_HOME/hosted.json):
{
"dirs": ["/Users/you/code/scratch"],
"idleTimeoutMs": 1800000,
"allowBypassPermissions": false
}
dirs — absolute paths, expanded and realpathed before comparison. Only
these directories can be used as a hosted project. Restart the bridge after
editing.idleTimeoutMs — stop an idle process after this many milliseconds (default
30 minutes, minimum 60 s). Sending another message resumes the same CLI
session.allowBypassPermissions — default false. When true, hosted sessions may be
started with bypassPermissions; when false that mode is rejected.cliPath — optional; defaults to claude on PATH, then a search of
~/.local/bin, ~/.claude/local, /opt/homebrew/bin, /usr/local/bin.File browsing and shell execution are separate opt-in switches, both off by default, both with a TTL:
npm run bridge -- devtools # show status
npm run bridge -- devtools files on --ttl 3600
npm run bridge -- devtools terminal on --ttl 600
npm run bridge -- devtools files off
npm run bridge -- devtools terminal off
The file browser is read-only and confined to the session's project directory. The terminal runs one command at a time (max 8 concurrent), in its own process group, and the owning browser tab can cancel it.
agent-bridge init --relay <url> [--web <url>] [--name <name>]
agent-bridge invite [--ttl 30..600]
agent-bridge serve
agent-bridge devices [ttl manual|1h|24h|7d|30d]
agent-bridge revoke <deviceId>
agent-bridge devtools [files|terminal] [on|off|status] [--ttl 60..86400]
agent-bridge port [<port>]
agent-bridge status
agent-bridge info
agent-bridge --version
| Command | Purpose |
|---|---|
init | Create a room, generate the bridge token and Noise identity, write state. |
invite | Mint a single-use pairing token (TTL 30–600 s, default 300) and print the link. |
serve | Run the daemon: connect to the relay, dispatch sessions, serve the admin API. |
devices | List paired devices, optionally change their expiry policy. |
revoke | Revoke one device and close its live sockets. |
devtools | Toggle the remote file browser and terminal, with a TTL. |
port | Read or write the local admin port, then restart the daemon. |
status / info | Human-readable state: relay, room, devices, uptime. |
Per-device management is also available from the web client, but only for the device you are using; other devices are managed on the Mac.
| Setting | Default | Meaning |
|---|---|---|
AGENT_BRIDGE_HOME | ~/Library/Application Support/AgentBridge | State directory (database, identity, hosted transcripts, port file). |
AGENT_BRIDGE_ADMIN_PORT | port file, else 47825 / 47826 | Override the loopback admin port for one run. |
AGENT_BRIDGE_ENV | inferred from relay host | preview or production; picks the default admin port. |
AGENT_BRIDGE_CLAUDE_PATH | claude | Path to the Claude Code CLI used by hosted sessions. |
State directory contents:
bridge.db SQLite: devices, invites, push subscriptions, titles, events,
and the Noise static identity (identity_private / identity_public)
hosted.json hosted-session allowlist and policy
hosted/ hosted transcripts (*.jsonl) and sessions.json
admin-port loopback admin port for this state directory
admin-token bearer token for the admin API (mode 0600)
The database is opened in WAL mode with a 3 s busy timeout, and the directory is created with mode 0700. Back up the state directory to keep devices paired; deleting it unpairs everything.
xxpsk3 for pairing, ik for reconnects.
The relay forwards ciphertext and never holds a key.localStorage in plain text, but
the secret keys are AES-GCM encrypted with a PBKDF2-SHA256 key (600,000
iterations) derived from a user password, and stay unlocked for 30 minutes.
The password never leaves the browser.127.0.0.1 only, Host must be a loopback name, no
Origin header accepted, bearer token compared in constant time, token file
mode 0600.script-src 'self' 'wasm-unsafe-eval',
connect-src https: wss:, frame-ancestors 'none'.These are properties of the current design, not bugs to be worked around:
REMOTE_APPROVAL.zh-CN.md.session.subscribe, session.unsubscribe, sync.resume,
operation.get, turn.cancel and approval.respond are declared in the
protocol but not dispatched by the bridge yet. The UI polls instead of
subscribing to server-pushed events; only shell.output is emitted as a real
event, and approval buttons are sent as ordinary messages.zh-CN). There is no i18n layer.claude's stream-json control protocol and pi's RPC mode; other agents are
mirrored from their desktop or CLI sessions.hosted/*.jsonl and bridge.db
rely on macOS file permissions (0700/0600), not on disk encryption.Full detail, protocol reference and troubleshooting: docs/GUIDE.md.
apps/mcp is a stdio MCP server that lets an agent running on another machine
drive the pi / Claude Code sessions the bridge hosts on your Mac: open a session
in an allowlisted directory, send work, read the reply, wait for the turn to
finish, archive it. It is not a remote shell — it only touches the sessions
it opened (or that the user adopts by name), maps none of the shell / filesystem
/ device protocol methods, and the relay still sees only ciphertext. Pairing is a
one-time invite plus the same six-digit code comparison as the web client.
Install steps, the MCP host configuration snippet, the pairing walkthrough, a first-task example, the optional listener and troubleshooting are in apps/mcp/README.md.
The server ships on npm as @craftstead/agent-bridge-mcp (scoped to the same
publisher as @craftstead/protocol and @craftstead/crypto); the packaged bin
is still agent-bridge-mcp, and the MCP serverInfo name stays
agent-bridge-mcp.
npx -y @craftstead/agent-bridge-mcp # or: npm i -g @craftstead/agent-bridge-mcp
Running it from a clone (npm run mcp) works the same way.
apps/bridge Node daemon: relay client, session adapters, admin API, push
apps/relay Cloudflare Worker + Durable Object `Room`
apps/web Vite SPA / PWA (TypeScript, no framework)
apps/menubar Swift AppKit menu bar app (LSUIElement)
apps/mcp stdio MCP server that drives hosted sessions (Node, no build step)
packages/protocol Wire types, method names, limits
packages/crypto Noise handshakes, PSK derivation, chunked secure channel
Everyday commands:
npm run build # tsc -b
npm run check # tsc -b + web type check
npm test # build + node:test
npm run web # vite dev server for the web client
npm run relay:dev # wrangler dev for the relay
npm run bridge -- serve
npm run mcp # stdio MCP server (apps/mcp), for an MCP host to spawn
npm run test:mcp # apps/mcp offline selftests
Branching and release rules are in AGENTS.md: develop deploys the preview
relay, main deploys production, feature branches come from develop, and
production deploys are gated on a version bump in the root package.json.
.github/workflows/deploy.yml builds the wasm module, type checks, builds the
web client and deploys with wrangler:
develop with a changed root version → wrangler deploy --env previewmain with a changed root version, or a vX.Y.Z tag on main
matching the package version → production.github/workflows/release.yml builds the universal menu bar app, the DMG and
its SHA-256, and publishes a GitHub Release on v*. Signing and notarisation
run only when the Apple secrets are present. A prerelease tag (with a hyphen)
may point at a commit on develop or main; a stable tag must be on main.
MIT