agentbus
AgentBus is a localhost MCP sidecar server for multi-agent coordination, providing a structured event log and advisory lease locks backed by SQLite.
Event Log
Publish events (
agentbus_publish): Append validated events to a topic with support for payloads, producer identity, causation chaining, schema versioning, and idempotency keys.Poll events (
agentbus_poll): Fetch events from a topic using asince_idcursor for at-least-once delivery, with configurable limits.Check status (
agentbus_status): Retrieve workspace bus health, event counts, and topic listings.
Advisory Lease Locks
Acquire a lock (
agentbus_lock_acquire): Claim an exclusive advisory lease on a resource (e.g., a shared file) with an optional TTL and owner identity.Release a lock (
agentbus_lock_release): Release a held lease by providing the resource, lease ID, and owner ID (idempotent if already expired).Renew a lock (
agentbus_lock_renew): Extend the TTL of an active lease as a heartbeat to prevent expiration.Check lock status (
agentbus_lock_status): Inspect the current lock state of a resource without acquiring it.
Key Properties
Mutating operations (publish, lock acquire/release/renew) require authentication via an ephemeral workspace token.
Read operations (poll, status, lock_status) are open and unauthenticated.
Designed to coordinate heterogeneous, out-of-process agents (Cursor, Claude Code, etc.) over stdio MCP.
Enables Hermes agents to publish and poll structured events in a multi-agent workspace via MCP.
Click on "Install 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., "@agentbusshow recent handoff events"
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.
AgentBus
Local MCP event log and advisory lease coordinator for multi-agent workspaces.
When Cursor, Claude Code, Antigravity, Hermes, and other agents share a workspace, they usually coordinate through append-only files (log.md, sticky notes, Slack). That works until you need ordering, idempotency, cursors, schema validation, or file-edit mutexes.
AgentBus is a localhost sidecar: a Python MCP server backed by SQLite. Agents publish structured events; peers poll with since_id cursors. Advisory lease locks prevent concurrent edits. No orchestrator runtime lock-in.
v0.2 (July 2026): Events + advisory lease locks —
publish,poll,status,lock_*. SSE subscribe and custom topics on the roadmap.
Note: PyPI names
agentbus(NATS) andagentbus-mcp(blocked as too similar) are unavailable. Install asokf-agentbus(CLI command remainsagentbus).
Why AgentBus?
Alternative | Limitation | AgentBus |
| No schema, races, manual cursors | Typed topics, monotonic IDs, poll API |
| No agent identity, no TTL | Advisory leases with heartbeat renewal |
Redis pub/sub | Extra daemon, no MCP path | stdio MCP — works in existing IDEs |
LangGraph / AutoGen | Same-runtime only | Heterogeneous out-of-process clients |
Related MCP server: claude-sync
Install
pip install okf-agentbus
# Or from GitHub
pip install "okf-agentbus @ git+https://github.com/onicarps/agentbus@v0.2.3"
# Or clone for development
git clone https://github.com/onicarps/agentbus.git
cd agentbus
python3 -m venv .venv
.venv/bin/pip install -e ".[dev]"Quickstart
export AGENTBUS_WORKSPACE=/path/to/workspace
export AGENTBUS_PRODUCER_ID=my-agent
# Terminal A — MCP server (stdio)
agentbus serve --workspace "$AGENTBUS_WORKSPACE"
# Terminal B — publish a handoff
agentbus publish \
--topic okf/handoff \
--payload '{"from":"my-agent","to":"peer","summary":"Hello bus"}'
# Poll events
agentbus poll --topic okf/handoff --since-id 0
# Acquire an advisory lease before editing a shared file
agentbus lock acquire --resource "$AGENTBUS_WORKSPACE/log.md" --owner-id my-agent
agentbus lock status --resource "$AGENTBUS_WORKSPACE/log.md"
agentbus lock release --resource "$AGENTBUS_WORKSPACE/log.md" --lease-id <uuid> --owner-id my-agentMCP setup
Use scripts/mcp-serve.sh so the workspace token is injected automatically:
{
"mcpServers": {
"agentbus": {
"command": "/path/to/agentbus/scripts/mcp-serve.sh",
"env": {
"AGENTBUS_WORKSPACE": "/path/to/workspace",
"AGENTBUS_PRODUCER_ID": "cursor"
}
}
}
}Client-specific templates:
Client | Config |
Cursor | |
Claude Desktop | |
Hermes |
MCP tools
Tool | Auth | Purpose |
| Yes | Append one validated event |
| No | Fetch events after |
| No | Event counts, topics, health |
| Yes | Exclusive advisory lease on a resource path |
| Yes | Release a held lease |
| Yes | Extend TTL (heartbeat) |
| No | Check lock state without acquiring |
Documentation
For full documentation, see the docs/ directory:
End-to-End Walkthrough - Learn how a PM, Engineer, and QA agent coordinate.
Client Capability Matrix - See how Cursor, Claude, and Antigravity compare.
Authentication
On serve, AgentBus writes an ephemeral token to {workspace}/.agentbus/token (mode 0600). Publish and lock mutations require a matching token via:
scripts/mcp-serve.sh(recommended for MCP — reads workspace file, not stale env)AGENTBUS_TOKENenvironment variable--tokenCLI flagauth_tokenMCP tool argument (optional; omit when usingmcp-serve.sh)
Poll, status, and lock_status remain open. Set AGENTBUS_AUTH=off to disable during local development.
Details: docs/AUTH.md
Topics (v0.2)
Topic | Purpose |
| Structured agent handoff ( |
| Status ping ( |
Custom topics are planned — contributions welcome.
CLI reference
agentbus serve [--workspace PATH] [--rotate-token]
agentbus publish --topic TOPIC --payload JSON [--producer-id ID]
agentbus poll --topic TOPIC [--since-id N] [--limit N]
agentbus status [--producer-id ID]
agentbus token show|ensure|rotate
agentbus lock acquire|release|renew|status
agentbus project-log [--log-file log.md] # optional markdown projectionSet AGENTBUS_WORKSPACE to avoid repeating --workspace.
Development
.venv/bin/pytest tests/ -q # 40+ tests
.venv/bin/pytest tests/ --cov=agentbus --cov-report=term-missingProject layout
src/agentbus/ # Python package
tests/ # pytest suite (40 tests)
docs/ # MCP schema, auth guide
examples/ # MCP client configs (Cursor, Claude, Hermes)
scripts/ # mcp-serve.sh wrapperRoadmap
See ROADMAP.md. v0.2 ships events + advisory locks; v0.3 targets custom topics and HTTP transport.
Contributing
We want real-world use cases from teams running heterogeneous agent stacks. See CONTRIBUTING.md.
License
MIT — see LICENSE.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/onicarps/agentbus'
If you have feedback or need assistance with the MCP directory API, please join our Discord server