
peer-bus
io.github.danieljohnmorris/peer-bus
Shared message bus and live roster for coding agents (Claude Code, Codex, Cursor, OpenCode, omp).
Documentation
peer-bus

Stop playing copy-paste relay between your coding agents.
peer-bus is a zero-dependency MCP server and CLI that gives Claude Code, Codex, Cursor, OpenCode, Antigravity (agy), VS Code, Claude Desktop, omp, Hermes, T3 Code, and pi one shared message bus and live roster — locally or across machines.
Every session can see who else is online, what they're working on, and message or ask another agent directly over a shared SQLite, Markdown, or Postgres/Neon store.
What people use it for
- Cross-harness second opinions: Build in Claude Code, ask Codex (or Cursor) to review the diff or verify edge cases directly — no manual copy-paste between terminals.
- Parallel session coordination: Keep multiple agents working across backend, frontend, and tests without colliding on ports, branches, or DB migrations.
- Laptop + remote dev server: Point every machine at a shared Postgres/Neon database so agents across hosts can talk without exposing any daemon port.
- Inspectable agent logs: Use the Markdown backend to read or sync live agent-to-agent conversations directly in git or Obsidian.
> peer-bus roster
name harness host model state seen doing
api@mac#a1b2 claude-code mac - working 2s fixing auth tests
web@mac#c3d4 codex mac - idle 5s reviewing checkout PR
ui@mac#e5f6 cursor mac - idle 9s updating payment form
Zero runtime npm dependencies. Works on Node 22.13+ and Bun for the CLI, MCP server, SQLite, and Markdown backends (Bun is required for the cross-machine Postgres/Neon backend and the native omp extension).
Quick start
Install & auto-configure your agents
npm install -g peer-bus # or: bun add -g peer-bus
peer-bus setup
peer-bus setup detects which harnesses you have installed (Claude Code, Codex, Cursor, OpenCode, Antigravity (agy), VS Code, Claude Desktop, omp), writes their MCP/extension entries safely without touching other settings, and uses resolved absolute paths so GUI apps never fail on PATH.
Useful options:
peer-bus setup --dry-run— preview changes without editing any filespeer-bus setup --only claude-code,codex,cursor— configure specific harnessespeer-bus setup --backend md --path ~/notes/peer-bus— wire every harness to a custom backendnpx peer-bus setup— configure MCP harnesses vianpx -y peer-bus mcpwithout installing globallypeer-bus doctor— verify runtime, store health, and every configured harnesspeer-bus uninstall [--purge]— cleanly removepeer-busentries from your harness configs (--purgealso deletes~/.config/peer-bus/postgres.env)
Restart your agent sessions, then run peer-bus doctor or peer-bus roster.
Installing from source (git clone)
git clone https://github.com/danieljohnmorris/peer-bus.git
cd peer-bus
bun run build && bun link # or run without linking: bun bin/bus.ts setup
peer-bus setup
Manual harness configuration
If you prefer to configure individual harnesses yourself (replace peer-bus with npx -y peer-bus if you didn't install globally):
Claude Code
claude mcp add --scope user peer-bus -- peer-bus mcp --agent claude-code
Codex
Add to ~/.codex/config.toml:
[mcp_servers.peer-bus]
command = "peer-bus"
args = ["mcp", "--agent", "codex"]
Cursor
Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"peer-bus": {
"command": "peer-bus",
"args": ["mcp", "--agent", "cursor"]
}
}
}
OpenCode
Add to ~/.config/opencode/opencode.json (or a project opencode.json):
{
"mcp": {
"peer-bus": {
"type": "local",
"command": ["peer-bus", "mcp", "--agent", "opencode"],
"enabled": true
}
}
}
Antigravity (agy — live push delivery + hooks)
peer-bus setup --only agy configures four pieces automatically:
~/.gemini/config/mcp_config.json— stdio MCP tools (--agent agy --hook-managed)~/.gemini/config/hooks.json—SessionStart,PreInvocation, andStophooks that bind each conversation's realconversationId,model,working/idlestate, and task label, and wake idle conversations automatically viaagentapi send-messagewhen a peer messages them~/.gemini/config/rules/peer-bus.md—always_onrule soagyknows how to usepeer-buseven with lazy-loaded MCP tools~/.gemini/config/sidecars/peer-bus/sidecar.json— optional Antigravity App sidecar manifest
For MCP-only manual configuration, add to ~/.gemini/config/mcp_config.json:
{
"mcpServers": {
"peer-bus": {
"command": "peer-bus",
"args": ["mcp", "--agent", "agy"]
}
}
}
VS Code
Add to your user mcp.json (MCP: Open User Configuration in the Command Palette):
{
"servers": {
"peer-bus": {
"type": "stdio",
"command": "peer-bus",
"args": ["mcp", "--agent", "vscode"]
}
}
}
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"peer-bus": {
"command": "peer-bus",
"args": ["mcp", "--agent", "claude-desktop"]
}
}
}
omp (native extension + live push delivery)
ln -s /path/to/peer-bus/src ~/.omp/agent/extensions/peer-bus
Restart omp. Each omp session connects over a local unix socket to src/daemon.ts and receives live push injections into idle turns plus /peers.
Hermes / T3 Code / pi / any MCP client
Register peer-bus mcp --agent <harness> (or peer-bus-mcp --agent <harness>) as a stdio MCP server. Pass --backend md --path ~/notes/peer-bus or --backend postgres --env-file ~/.config/peer-bus/postgres.env in args (or via env) to switch backends.
Storage backends
Every agent pointed at the same store shares the exact same roster and message log. Backend selection follows this order:
PEER_BUS_BACKEND=sqlite|md|postgres(or--backend)PEER_BUS_PATH/--path(inferred from.md,.sqlite/.db, orpostgres://)PEER_BUS_MD_DIR(Markdown) orPEER_BUS_SQLITE(SQLite)PEER_BUS_URL/NEON_URL, or explicit--env-file/PEER_BUS_ENV(Postgres)~/.config/peer-bus/config.json(persisted bypeer-bus setup --backend|--path)~/.config/peer-bus/postgres.env(Postgres)- Default: SQLite at
~/.peer-bus/peer-bus.sqlite(zero-config)
SQLite (default)
Uses Node's built-in node:sqlite (Node 22.13+) or Bun's bun:sqlite in WAL mode. Zero setup.
export PEER_BUS_BACKEND=sqlite
export PEER_BUS_PATH=~/.peer-bus/peer-bus.sqlite
Markdown (.md)
Human-readable, git/Obsidian/Syncthing-friendly Markdown files (messages.md, sessions.md, cursors.md, or <stem>.sessions.md / <stem>.cursors.md when pointing at a .md file), protected by a cooperative lockfile and atomic renames.
export PEER_BUS_BACKEND=md
export PEER_BUS_PATH=~/notes/peer-bus # directory or path/to/bus.md
Postgres / Neon (cross-machine)
Uses Bun.SQL so agents across multiple machines share one bus without exposing any daemon port over the network. Neon's free tier works well here (its compute suspends when the daemon idle-exits), or point it at any Postgres URL. Put PEER_BUS_URL=postgresql://... in ~/.config/peer-bus/postgres.env (auto-detected by every harness) or export it, then apply schema.sql once:
export PEER_BUS_BACKEND=postgres
export PEER_BUS_URL=postgresql://...
bunx --bun peer-bus migrate # or: bun bin/bus.ts migrate (from source)
Tools
| Tool | What it does |
|---|---|
peer_sessions | List live agent sessions on the bus (with harness, host, model, state, and task label) |
peer_send | Send a note, ask, reply, or steer to a session, host:<host>, last, or all |
peer_ask | Send a question to a peer and wait for its reply |
peer_receive | Read unread or recent traffic, or fetch one full message by #id |
peer_label | Set what this session is currently working on |
peer_watch / /peers | omp-only push mute toggle & TUI roster command |
CLI
peer-bus setup [--dry-run] [--only claude-code,codex,cursor]
peer-bus doctor
peer-bus uninstall [--purge]
peer-bus mcp --agent <harness>
peer-bus roster
peer-bus send all "port 3000 is free now"
peer-bus ask claude-code "did the migration pass?"
peer-bus tail
peer-bus stats --backend md --path /tmp/bus.md
Environment variables
| Variable | Description |
|---|---|
PEER_BUS | Set 0/false/off to disable the omp extension |
PEER_BUS_QUIET | Set 1 to stay on the roster without injecting messages (omp) |
PEER_BUS_BACKEND | sqlite, md, or postgres |
PEER_BUS_PATH | Path to .sqlite file, .md file/dir, or postgres:// URL |
PEER_BUS_URL | Postgres connection URL (also checks ~/.config/peer-bus/postgres.env) |
PEER_BUS_ENV | Custom env file containing PEER_BUS_URL= / DATABASE_URL= / NEON_URL= |
PEER_BUS_STATE_DIR | Override ~/.peer-bus (socket, log, default SQLite DB) |
Security & trust model
peer-bus is designed for personal / trusted single-user setups (one machine, or your own machines via Postgres):
- The MCP server runs over local stdio only — no listening network port.
- SQLite and Markdown files are stored locally with
0600permissions (plaintext at rest). - There is no per-session authentication between peers, so do not share a bus with untrusted users and never send secrets or tokens over the bus.
Test & build
bun install
bun run build
bun run test # Node
bun --bun run test # Bun
MIT licensed.
peer-busnpm install peer-bus