Exact, durable handoffs between AI coding agents: one turn in the right session, never twice.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent — or use 1-click editor setup below.
One-click editor setup isn’t available for this listing yet — we don’t have a confirmed install command, and we’d rather show nothing than point your editor at the wrong package or host. Follow the project’s own setup instructions, linked above.
Exact, durable handoffs between AI coding agents. Each handoff is one new turn in the recipient's existing session.

Real screenshot of the demo; the data in it is invented sample data.
Open the URL it prints (http://127.0.0.1:8765/). Four simulated agents hand work to each other. Ctrl+C stops and deletes the demo data.
A team of coding agents already has sessions, inboxes and tools. What it lacks is delivery: a message that reaches the right session, waits if that agent is busy, is sent once, and is retried within a bound when the provider drops it.
Without that, handoffs get lost, delivered twice, or pasted into a session that is already in the middle of a turn. AgentBrain Handoffs is the delivery layer. It is a local Python package (Python 3.9+, standard library only) with a command handoffs, a live page, and an MCP server.
From a clone of this repository:
Or, once the package is on PyPI:
You should see:
The page updates every few seconds. Handoffs move through Accepted → Working → Finished. Work is returned and closed on its own. --speed 4 makes the simulated turns finish faster.
To keep the demo on another port: handoffs demo --port 9876.
A longer walkthrough, including your own agents, is in docs/QUICKSTART.md.
A handoff is a message addressed to one registered agent. The delivery engine turns it into exactly one new turn for that agent, at the session it had when the handoff was enrolled.
A work contract is a handoff with a title. The recipient returns a result (or a blocker); the sender closes it as accepted, revision, or blocked. A due time is optional; if it passes, the sender gets one non-waking reminder.
Delivery states, in plain words:
| State | Meaning |
|---|---|
| WAITING | Queued. Next engine pass will try to send it. A provider outage stays here too: the detail explains the hold and no attempt is used. |
| BUSY | The recipient is in the middle of a turn. This waits. |
| HELD | Blocked on purpose: the connection is blocked or delivery is paused. No attempt used. |
| UNAVAILABLE | The agent or its session is gone. Nothing is redirected. |
| OWNER_REJECTED | The session refused the write. One retry is allowed. |
| SENDING | The write is in flight. |
| UNCERTAIN | The write may have landed; the reply was lost, or an accepted turn could not be observed for 10 minutes. Observed, never resent. |
| ACCEPTED | The recipient's session took the turn. |
| RUNNING | The turn is in progress. |
| RETURNED | The turn finished. |
| FAILED | The turn failed or was interrupted, or the session refused it twice (then it was never delivered). |
| ACKNOWLEDGED | The recipient read the message; no separate turn is needed. |
| CANCELLED | Proven absent after enough history scans, or released by a person with handoffs release. Not resent. |
| DUPLICATE | Identical to a handoff still in progress. |
handoffs release ID cancels it; nothing is resent either way.| Provider | Status | What it talks to |
|---|---|---|
demo | Stable | Simulated agents. Used by handoffs demo. |
command | Stable | An argv (no shell) or an HTTP POST. |
codex | Experimental | codex app-server JSON-RPC over stdio. |
claude-code | Experimental | Claude Code headless (claude -p --resume). |
See docs/ADAPTERS.md for settings, examples and the experimental caveats.
Each agent session launches its own MCP server. The identity is fixed at start, so a tool call cannot act as another agent.
Claude Code
Replace me with the agent id you registered (handoffs agent add me --provider claude-code ...).
Codex (~/.codex/config.toml)
Cursor (MCP servers in Cursor settings)
Point every process at the same database with --db or HANDOFFS_DB. The engine (handoffs serve or handoffs run) is what actually delivers; the MCP server only writes to the inbox. Details: docs/MCP.md.
ContextLib keeps a project's decisions, facts and lessons as plain Markdown files. Install it and point the same server at a library, and each agent gets the context_* tools (brief, search, get, record, supersede, review, capture, export, import, status) next to its handoff tools:
$CONTEXTLIB_ROOT works in place of the flag. The plugin runs as the server's fixed agent id, so an agent's records are authored by exactly the agent that sent its handoffs. Without a library, the server offers handoff tools only.
--db PATH or HANDOFFS_DB selects the database (default ./.handoffs/handoffs.sqlite3). --json is accepted on the commands that print records. Usage errors exit 2.
| Command | Purpose |
|---|---|
init | Create the database. |
agent add|list|remove | Register agents. --set KEY=VALUE is JSON when it parses. |
allow / block | Directed connections. |
config KEY VALUE | enabled, enabledAfter, connections, outageGuard. |
send FROM TO MESSAGE | Inbox message; --title makes it work. --key is idempotent. |
inbox / read / accept / return / close | Work lifecycle. --as or HANDOFFS_AGENT. |
status / tick / run / serve / mcp / demo | Inspect and deliver. |
release ID | Cancel one stuck delivery (for example UNCERTAIN) so its recipient is free. Nothing is sent. |
The live page binds to loopback and refuses non-loopback Host headers (DNS-rebinding). POST /api/send needs the token in <db>.token (mode 0600). --public-demo exists only on handoffs demo (simulated agents, temporary data); that page cannot send and shows plain state sentences instead of adapter errors. MCP identity is the --agent you started with. Full model: docs/SECURITY-MODEL.md.
outageGuard.The image is published at ghcr.io/willykeenan/agentbrain-handoffs for Apple silicon and Intel.
The MCP server writes to the handoff database in ~/.handoffs; run the engine (handoffs serve) on the machine where your agents live so it can deliver.
Apache-2.0. Copyright KE Studios.
No reviews yet — be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/agentbrain-handoffs)<a href="https://allmcps.com/mcp/agentbrain-handoffs"><img src="https://allmcps.com/api/badge/agentbrain-handoffs?style=directory" alt="AgentBrain Handoffs on AllMCPs" /></a>