agent-bus
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
agent-bus
A local message bus that lets Claude Code, Codex and Antigravity talk to each other directly, instead of a human relaying messages between windows. Designed in fantashley/dotfiles#131.
One stdio MCP server (
agent-bus mcp --agent <type>) registered in every client. The server stamps the sender from its launch command, so agents can't impersonate each other.SQLite (WAL) per host at
$XDG_STATE_HOME/agent-bus/bus.db, mode0600. History is never deleted; read state is a per-session, per-thread cursor.On-demand worker, no daemon. Typed actions (
start_discussion,advance_discussion,request_review) queue a job and spawnagent-bus run-job <id>, which holds an SQLite lease and runs the peers headless and read-only (claude -p --permission-mode plan,codex execwith a read-only sandbox,agy --mode plan --sandbox), resuming each peer's conversation every round.Safety in the server: peer text (including an agent's discussion question) is returned as
trust: "peer_data"inside visible fences; only the CLI poststrust: "human". Round caps, message caps (THREAD_LIMIT_REACHEDuntil the human runsresume), deadlines and job de-duplication. Jobs whose worker died are reaped, so a crash never wedges a thread.Headless peers can't use tools that act. Claude runs with
--strict-mcp-configand only Read/Grep/Glob/web tools; Codex has every live MCP server disabled (and the turn fails if they can't be listed); Antigravity has no per-session switch, so its turns are refused while it has any MCP server besides agent-bus configured, unlesspeers.antigravity.allow_mcpis set. Any agent-bus MCP server a peer launches seesAGENT_BUS_PEERand refuses every call. The repo allowlist decides which repos requests may target and where peers run; reads are bounded by each CLI's read-only mode, not by the allowlist.
Discussions
agent-bus ask "SQLite or a JSON file for a small CLI?" --with claude,codex,antigravity --waitRound 1 is blind: each participant proposes without seeing the others (
P1,P2, …).Later rounds run peers in turn; each votes
agree/objecton a proposal id or revises one. Authoring a proposal counts as agreeing with it.Consensus = every participant agrees on the same proposal. The bus posts a
finalmessage and marks the threadresolved.Out of rounds or past the deadline →
needs_human, with who backs what and who objects.
An agent can start one from its own chat with the start_discussion tool; it takes part with
send + wait. If its turn ends, it's marked absent, and if the peers agree without it the thread
waits in its inbox for its vote.
Related MCP server: tincan
Reviews
request_review(reviewer, repo, base_commit_id, head_commit_id, …) pins full commit ids. The worker
computes jj diff --from base --to head --git, the reviewer returns a structured verdict, and it
lands as a review_verdict in the requester's inbox.
For the next pass, request again with prev_head_commit_id set to the head that reviewer last saw.
That continues the same thread and resumes the reviewer's own conversation, so it remembers
its earlier findings; it gets the interdiff plus anything you posted on the thread since (e.g. a
send explaining how each finding was addressed). If the resume fails it falls back to a fresh
session with the full diff and thread.
Watching and stepping in
agent-bus threads # list open threads
agent-bus tail t-1a2b3c [--peer codex|--events]
agent-bus reply t-1a2b3c "Prefer the simpler option" [--to codex]
agent-bus cancel t-1a2b3c
agent-bus resume t-1a2b3c --rounds 2
agent-bus watch t-1a2b3c # inside Rex: open viewer panes
agent-bus stream [t-1a2b3c …] # one line per verdict / final / failure, as each arrivesstream is meant for notifications: each event is one stdout line, so a harness that turns
lines into alerts (or a plain while read) hears about each reviewer as it finishes.
tail emits OSC 7501 program status
(working, done, blocked/question on needs_human), so Rex shows discussion state on any
client, local or attached to a remote host. Viewer panes are output-only; nothing is ever typed
into a block. Everything works without Rex.
Rex sessions and wake-ups
agent-bus never types into a terminal, its own panes included. All three clients report
idle/working to Rex (OSC 7501), but an idle agent with a half-typed draft reports idle
too, and no client or Rex signal says whether the input box is empty. A check followed by a
separate write could always race a human typing. So interactive sessions pick up messages with
wait/inbox, and peers run headless. Automatic wake-ups wait for an atomic "deliver only if
idle and empty" path or a dedicated notification channel. (Agreed by Claude, Codex and
Antigravity in an agent-bus discussion, after measuring all three clients in Rex.)
agent-bus rex-check shows what Rex does report for a session, one check per line. Each check
fails if it's missing or can't be read:
agent-bus rex-check # the latest session of each agent
agent-bus rex-check --session s-1a2b3c4d
agent-bus rex-check --block block:… --agent codexThe checks are:
rex_env: REX_SESSION/REX_BLOCK were recorded when the session registered.mcp_server: the session's server process is still running.block: the block exists.app: the expected client reports OSC 7501 status there.owner: the status owner is the block's foreground process.client: the status owner is this session's own client.state: the reported state and when it was last reported.input_ready: alwaysunavailable.
It exits non-zero if any check fails. Claude Code and Antigravity pass REX_* to MCP servers.
Codex filters its MCP servers' environment, so agent-bus setup-codex (run by the home-manager
module) sets env_vars on Codex's agent-bus entry.
Install (Home Manager)
# flake inputs
agent-bus = { url = "github:fantashley/agent-bus"; inputs.nixpkgs.follows = "nixpkgs"; };
# home-manager modules
imports = [ agent-bus.homeManagerModules.default ];
local.agentBus = {
enable = true;
repos = [ "~/dotfiles" "~/src" ]; # what peers may read
};This installs the CLI, writes ~/.config/agent-bus/config.json, and registers the MCP server:
Claude Code: a local plugin from a directory marketplace in the store, enabled through
local.claude.extraKnownMarketplaces/enabledPluginswhen those options exist (otherwise useconfig.local.agentBus.claudeMarketplace).Codex:
agent-bus setup-codexat activation:codex mcp add agent-bus …, thenenv_varson that entry soREX_SESSION/REX_BLOCK/REX_SERVERreach the server (Codex filters MCP server environments;codex mcp addcan't setenv_vars). Skipped when the entry already matches; the rest of~/.codex/config.tomlis left alone.Antigravity: a plugin linked at
~/.gemini/config/plugins/agent-bus(on by default whenlocal.antigravity.enableis set).
Add docs/AGENTS-section.md to the shared global agent rules.
Development
nix develop -c pytest # tests use fake peer CLIs that speak each client's stream format
nix build # package (runs the tests)Not in v1
Interactive peer panes and automatic wake-ups, until a client or Rex can deliver input
atomically only when it's ready (see above). Cross-host discussions, per-client fixed-hint
hooks, and writable participants in separate jj workspaces (v1.5).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Real-time chat for AI agents. Claude Code, Cursor, Cline and Codex join channels over MCP.
Shared memory and mail for your AI agents. Verified with Claude Code; other MCP clients in testing.
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Your AI apps as one team: hand work to Codex or Claude Code on your Mac, with a shared logbook.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables multiple coding agents (Claude Code, Codex, Cursor) to discover each other's sessions, search transcripts, ask questions, and handoff tasks through a shared MCP server.54 npmMIT

tincanofficial
AlicenseAqualityAmaintenanceEnables live Claude Code and Codex sessions on the same machine to send each other text messages directly. It provides peer discovery, message sending, and a shared message log through MCP tools.574 npm1MIT- AlicenseNot gradedqualityBmaintenanceEnables Claude Code, Codex and opencode sessions on the same machine to message each other live over a local pipe, with threaded replies and offline queuing, and to delegate or spawn one another as background subagents. Messages persist in SQLite and any running server can take over as broker, so peers stay reachable without a daemon.4MIT
- AlicenseAqualityCmaintenanceEnables Claude Code, Codex, and other coding-agent sessions on the same machine to message each other, exchange tracked tasks with owners and states, and coordinate through channels, broadcasts, and multi-session asks without typing into terminals. Messages are routed by what the receiver is doing — next tool call, end of turn, or a held-back digest — so a flood of traffic doesn't interrupt active work.2541452 npm1MIT