agent-bus
An MCP client for the Agent Team OS message bus, letting an agent inspect live sessions and exchange, read, and file messages with other agents.
See who is online (
bus_status): list the roster and which sessions are live, optionally filtered to one agent — check this before sending when a recipient may have multiple sessions.Check your mail (
bus_inbox): list pending messages for this session (its own plus broadcasts), with options forunread_onlyorall_sessionsto include other workspaces of the same agent.Read a message (
bus_read): fetch one message in full, including payload and context refs, by full or partial id, optionally archiving it to.read/afterwards.Send a message (
bus_send): target a bare agent name (all its sessions) or a specificagent/slugsession, with intent, summary, extra details, priority, thread id,in_reply_to, deadline, context refs, message type (request, brief, response, question, event, handoff) and arequires_responseflag.File messages away (
bus_archive): mark a messagedone(handled) orread(only seen) so it stops blocking the session from closing.Replay conversations (
bus_thread): view a whole thread in order — who said what and when.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@agent-bus Any messages for me on the bus?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
agent-bus-mcp
MCP server per il bus Agent Team OS. Sostituisce heredoc bash e scrittura diretta di JSON nelle inbox con sei tool tipizzati.
Nato il 21 set 2026 dal bug delle sessioni parallele: due Kai aperti insieme
(microsoft-mcp e noi-calendar) si rubavano i messaggi perché il bus li vedeva come un
unico destinatario. Il fix (bus v1.4, agent/slug) vive nella lib bash; questo server lo
espone come API di prima classe.
Bus v3 (BR24-F5.5)
Il server è solo un client sottile: ogni tool è una chiamata al centralino (daemon di
agent-team-os/centralino, socket $AB_HOME/centralino.sock), che tiene tutto lo stato in SQLite.
Qui non c'è più il layer a file (bus.py è stato tolto): niente interruttore AB_CENTRALINO,
niente centralino.json. Con il centralino giù le tool falliscono con un errore chiaro, senza ripiego.
Le tool sono sei (bus_send, bus_reply, bus_close, bus_inbox, bus_read, bus_status);
bus_gestisci, bus_archive, bus_waits, bus_expect e bus_thread restano come alias fino
al 31 ottobre 2026. Un battito ogni 60 s dice al centralino che la sessione è viva. Le sezioni
qui sotto (file di casella, .read/, .done/, lock) descrivono il bus a file e valgono solo
per il mini, finché non passa anche lui al centralino.
Related MCP server: neighbors
Tool
Tool | A cosa serve |
| chi è sul bus e quali sessioni sono vive adesso, su tutte e due le macchine, con i pendenti di ciascuna |
| i messaggi di questa sessione (i suoi + i broadcast); |
| un messaggio per intero, con |
| invia a |
| sposta in |
| rigioca una conversazione in ordine |
| (v2.6) registra un esito atteso su questa sessione quando deleghi senza |
| (v2.6) le deleghe che questa sessione aspetta, con età, scadenza e motivo di una sveglia rimandata; (v2.7) |
| (v2.8) consuma un messaggio con un esito: |
bus_send ha kind (v2.8, piano BS21): obbligatorio senza default per request, brief e handoff, delega (vuoi l'esito) o comunicazione (non torna niente); senza, l'invio è rifiutato con un errore che spiega la scelta. Con kind='delega' l'attesa si registra da sola prima della consegna (attesa registrata t-… in note), il messaggio porta il task_id, e ogni ritorno sveglia chi aspetta: lo fa agent-team-os-wake.py (repo agent-team-os), che aggancia anche i ritorni scritti come messaggi nuovi. expect_result=true resta come vecchio nome di kind='delega'. Una risposta con in_reply_to eredita il task_id. wake_chain resta timbrato ma non blocca più: le catene le fermano i tetti della sveglia.
Domande (v2.7): chi esegue chiede al delegante con message_type='question' e lo stesso task_id (con in_reply_to sulla delega lo eredita). Ogni domanda sveglia il delegante una volta, l'esito lo sveglia comunque dopo. Chi chiede ha waiting_agent (agent, address, task_id, msg_id, since, summary) nella sua voce registry/<agent>.d/<slug>.json finché non legge la risposta (bus_read) o non manda l'esito.
Indirizzamento
Un agente può avere più sessioni, una per workspace:
kai → tutte le sessioni Kai (coda condivisa)
kai/noi-calendar → solo quella
kai/microsoft-mcp → solo l'altrabus_status prima di inviare, quando non si sa quante sessioni esistono. Uno slug non vivo
viene consegnato lo stesso con un warning: il messaggio aspetta che quella sessione
parta, invece di sparire.
Due macchine (v2.5)
Laptop (hub, dove sta Alita) e Mac mini, stessi percorsi e stessa AGENT_MAP.json. Solo il
laptop apre SSH verso il mini, mai il contrario. Stessa semantica della lib bash, stessi file:
kai@mini → tutte le sessioni Kai sul mini
kai@mini/crewmoor → una sessione sul mini
alita → dal mini va al laptop (l'hub vive sull'host hub)hostsinAGENT_MAP.json, nome della macchina in~/.agent-team-os/HOST(overrideAB_HOST; senza file = l'host conhub: true).laptop → mini: scrittura atomica via SSH nella inbox del mini. Mini giù: il messaggio resta in
outbox/mini/ebus_sendtornaqueued: truecon un warning, non un errore.mini → laptop: il messaggio aspetta in
outbox/laptop/del mini (queued: true).Raccolta:
bus_inboxebus_statussul laptop spingono la coda e tirano l'outbox del mini se l'ultima raccolta ha più di 30 s (copia, verifica, poi cancella sul mini). Lock e timbro condivisi con la lib bash e con il launchd di raccolta.Stato: le sessioni del mini lette via SSH dal suo
registry/, cache 20 s; se il mini è giù resta l'ultimo elenco conreachable: false.Ogni messaggio porta
context.host(macchina del mittente);reply_tolo usa.
SSH: AB_SSH_BIN (default ssh), BatchMode=yes, ConnectTimeout=AB_SSH_TIMEOUT (5),
ControlMaster auto con socket in ~/.ssh/cm-%r@%h:%p per 10 minuti.
Identità del chiamante
Dedotta dalla working directory via le rules di AGENT_MAP.json, quindi una sessione non
deve dichiarare chi è. Override con AB_AGENT e AB_SESSION_SLUG dove le regole non
arrivano. AB_HOME punta a un bus diverso (i test lo usano).
Identità sbagliata? Un server MCP eredita la cwd del client, che con alcuni launcher è
la cartella del server invece del workspace della sessione: in quel caso ogni chiamata
risulterebbe fatta dall'agente che possiede questa cartella. Il server se ne accorge e
rifiuta invece di indovinare. Rimedio: AB_AGENT e AB_SESSION_SLUG nell'entry MCP.
Non usare ${CLAUDE_PROJECT_DIR} in env: se il client non lo espande, la stringa
letterale è peggio di niente — il server la scarta apposta.
Nota: detect_agent qui prende il prefisso più lungo che matcha, mentre la lib bash
prende la prima regola in ordine di file. Identico quando le regole non si annidano, più
sicuro quando lo fanno.
Installazione
claude mcp add agent-bus -- uv run --directory ~/Projects/07-Tooling/mcp/agent-bus-mcp \
--with fastmcp --with pydantic python -m agent_bus_mcp.serverTest
uv run --with pytest pytest -q21 test (tests/test_centralino.py): un finto centralino su un socket Unix registra le richieste e
verifica la mappa tool -> operazione (v3 e alias), gli argomenti, i rifiuti, il centralino giù, il
battito, e come si decide la cartella del chiamante. La logica del bus ha i suoi test in
agent-team-os/centralino/tests e nel banco di prova centralino sim.
Relazione con il resto
Non sostituisce la lib bash né gli slash command:
/inbox,/bus,/send,/readrestano e leggono gli stessi file. I due layer convivono sullo stesso filesystem.Sorgente del protocollo:
~/Projects/01-Building/agent-team-os(repo), da cuiinstall.shcopia hook e lib in~/.claude. Non editare~/.claudedirettamente.Piani:
work-hub/plans/PLAN-BUS-V2-SESSION-IDENTITY.md(il fix),work-hub/plans/PLAN-AGENT-TEAM-OS.md(la v2.0 hive-GOD, che questo abilita).
Scelte di progetto
Scritture atomiche (temp + rename): un lettore non vede mai un file a metà.
Il campo
toresta il nome nudo anche per i messaggi mirati: thread e lettori esistenti non cambiano, lo slug vive nel percorso..read/e.done/nascono con la directory di sessione: senza, il primo messaggio mirato arrivava dove non si poteva archiviare (trovato da Kai usandolo).archiveè idempotente: archiviare due volte non è un errore.Una sessione senza heartbeat da 240 minuti è considerata morta (
AB_SESSION_TTL_MIN).
Available Tools
6 toolsbus_archiveBus ArchiveA
File a message away so it stops blocking the session from closing.
The Stop hook counts what is still pending, so archive each message once it is genuinely handled — not to silence the reminder.
Inputs: message_id (required), state. Returns: object
bus_inboxBus InboxA
List pending messages for this session.
By default: messages addressed to this workspace plus broadcasts to the agent. Other sessions' queues are left out unless all_sessions is set.
Inputs: unread_only, all_sessions. Returns: object
bus_readBus ReadA
Read one message in full, including its payload and context refs.
Inputs: message_id (required), archive. Returns: object
bus_sendBus SendA
Send a message to another agent, or to one specific session of it.
Prefer agent/slug when the recipient has more than one session open:
a bare name lands in the shared queue that every session reads.
Inputs: to (required), intent (required), summary (required), details, +7 more. Returns: object
bus_statusBus StatusA
Who is on the bus and which sessions are live right now.
Use before sending when an agent may have several sessions open, so the message reaches the workspace that is actually doing that work.
Inputs: agent. Returns: object
bus_threadBus ThreadB
Replay a conversation in order: who said what, when.
Inputs: thread_id (required). Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a clearly distinct responsibility: status for live sessions, inbox for pending messages, read for full message detail, send for delivery, archive for resolution, and thread for chronological replay. No two tools overlap in purpose or would cause an agent to misselect.
All tools follow a uniform bus_<action> pattern, making the API predictable and easy to navigate. The action terms are concise and match their functions.
Six tools is well-scoped for a message bus: enough to cover the full interaction lifecycle without redundancy. Each tool serves a distinct, necessary operation.
The set covers the core message lifecycle fully: send, receive, read, archive, inspect status, and replay threads. Broadcast delivery and per-session targeting are handled through bus_send, and archive provides a clean closure mechanism.
Maintenance
Related MCP Connectors
Pass messages between AI agents with cleaning, metadata enrichment, and metered billing.
Shared memory and mail for your AI agents. Verified with Claude Code; other MCP clients in testing.
Agents message each other and partners' agents. Claude Code, Codex (beta): memory, board, key vault.
Let your AI sessions talk to each other — messaging, tasks, sessions, and alerts
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceShare context, detect file conflicts, and send messages across parallel Claude Code sessions110 npmMIT
- FlicenseNot gradedqualityDmaintenanceEnables multiple Claude Code sessions to communicate and coordinate through broadcast and peer-to-peer messaging.1-
- AlicenseNot gradedqualityCmaintenanceEnables multiple Claude Code sessions to communicate, share state, and coordinate tasks through session management, message passing, and task scheduling, supporting a three-role collaboration workflow.2MIT
- AlicenseNot gradedqualityDmaintenanceEnables inter-session messaging for Claude Code, allowing sessions on different machines to send messages to each other, with delivery as user turns and support for offline queuing.MIT