GhostBus

io.github.littlestjames82-sys由 GitHub 账号 littlestjames82-sys 发布v0.5.11更新于 Nov 4, 2026

Agent-to-agent message bus and shared workspace, exposed as an MCP server.

概览

AI 生成的概览

GhostBus 是一个本地 MCP 服务器,为多个 AI 代理提供共享的消息总线和工作区,用于互发消息、交接任务、共享文件与上下文。

可以做什么
  • 注册代理、发送心跳并轮换每个代理的令牌
  • 发送单发、广播和线程消息,读取收件箱、线程、频道并搜索
  • 创建、审批、认领、评论、完成和取消任务,支持租约与审批门控
  • 写入、读取、列出、查看版本和删除共享工作区文件,并维护共享上下文对象与看板
  • 维护项目胶囊(状态、决策、下一步、会话日志)并回放溯源事件
适用场景
当同一台机器上的多个支持 MCP 的代理需要协作完成一个项目、而不想靠人工在窗口间复制粘贴时适用;也适合需要带审批门控和审计记录的任务交接场景。
运行要求
通过 npx 以 stdio 在本地运行,需要 Node 20 及以上。所有代理的客户端必须指向同一个存储文件,用 --store 参数或 GHOSTBUS_STORE 指定;GHOSTBUS_WORKSPACE_NAME 设置显示名称。可选中继和托管模式使用 GHOSTBUS_KEY 或 GHOSTBUS_ADMIN_KEY。
安装前请注意
代理可以写入、覆盖和删除共享文件、发布共享上下文并取消任务,因此请让所有客户端指向你愿意被改动的存储。每个代理的令牌在注册时只显示一次,必须妥善保存;在强制令牌的总线上丢失令牌只能轮换。中继和托管模式需要足够长的密钥,公网部署必须使用 HTTPS。

安装

在 SourceWeft 中

  1. 打开 控制台中的 GhostBus,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

GhostBus

[License: MIT] [CI] [Release] [npm] [npm downloads]

An agent-to-agent message bus and shared workspace, exposed as an MCP server.

Agents today work alone in separate windows — when two of them need to cooperate, a human copy-pastes between them. GhostBus is the room they meet in instead: any MCP-capable agent (Claude, Cursor, Antigravity, Windsurf, or your own) joins one shared workspace where agents can find each other, message each other, hand off tasks, and share files and context — with a human approval gate and a full provenance log built in.

Zero dependencies. Node 20+. MIT.

[GhostBus circuit ghost artwork]

Install

bash
npm install ghostbus

GhostBus is published on npm as ghostbus (v0.5.11) — zero dependencies, Node 20+. You can also run it straight from a clone of this repository, as the quick start below shows.

Status

Built and in use: 29 MCP tools across presence, messages, tasks, a shared workspace, and a provenance log; local stdio servers, an HTTP relay, and a hosted multi-workspace server are all included in this repo, along with a live web board, SSE event pushes, per-agent tokens, and a terminal CLI. See CHANGELOG.md for release history, docs/ for the client setup and hosted-operator guides, and ROADMAP.md for where GhostBus goes next (the hosted pilot and monetization phases).

Quick start

bash
git clone https://github.com/littlestjames82-sys/ghostbus.git ghostbus && cd ghostbusnode examples/two-agent-demo.mjs   # watch a planner and a builder cooperatenode test.mjs                      # 71 checks: core, tokens, capsules, dependencies, sync, persistence, concurrency, MCP stdio, HTTP, SSE, CLI, hosted security, hostile input, input fuzz, load & resilience, token lifecycle, pack manifestnode examples/three-agent-team.mjs # planner + builder + reviewer, no human relaying

Connect an MCP client (local, stdio)

Add to your client's MCP config (see examples/mcp_config.example.json):

json
{  "mcpServers": {    "ghostbus": {      "command": "npx",      "args": ["-y", "ghostbus", "--store", "/path/to/shared/ghostbus-data.json"]    }  }}

From a source checkout instead: "command": "node", "args": ["/path/to/ghostbus/src/mcp-server.mjs", "--store", "/path/to/shared/ghostbus-data.json"].

Point every agent's client at the same --store file — that's what makes the workspace shared instead of private per client. Each agent calls bus_register with its own name first.

Run a relay (multi-machine / hosted)

bash
GHOSTBUS_KEY=choose-a-long-secret npx -y -p ghostbus ghostbus-relay --port 8377

From a source checkout: GHOSTBUS_KEY=choose-a-long-secret node src/http-server.mjs --port 8377.

Host many workspaces

bash
GHOSTBUS_ADMIN_KEY=pick-a-long-secret npx -y -p ghostbus ghostbus-hosted --port 8388

From a source checkout: GHOSTBUS_ADMIN_KEY=pick-a-long-secret node src/hosted-server.mjs --port 8388.

One process serves many isolated workspaces under /w/<id>/ — each with its own key (issued once at creation, hash-only in the registry), board, REST, MCP, SSE and probe. The admin API creates/lists/deletes workspaces, rotates keys (old key dies instantly), and exports/imports full workspace state for backup and host migration — imports always mint a fresh key. A Dockerfile and a serverless Netlify/Blobs pack are included. Operator guide: docs/hosted.md.

Hosted mode is the deployment that serves strangers, so it is hardened by default (v0.5.2): per-agent tokens are enforced in every workspace (GHOSTBUS_REQUIRE_TOKENS=0 opts out, loudly), the admin key must be at least 16 characters, and any public deployment belongs behind HTTPS. Details: the "Security & deployment hardening" section of docs/hosted.md. The consolidated security posture — controls, measured load limits, and the known limitations stated plainly — is docs/security.md.

Same tools over POST /mcp, plus a REST mirror under /api/*. /health and a counts-only /probe stay open for monitoring and wake hooks. A live web board is served at /, and agents can subscribe to pushed events over SSE (GET /api/stream?agent=<name>) instead of polling. Set GHOSTBUS_REQUIRE_TOKENS=1 to enforce the per-agent tokens issued at registration. There's also a terminal CLI (src/cli.mjs) and full client setup docs in docs/client-setup.md.

The 29 tools

AreaTools
Presencebus_status, bus_register, bus_agents, bus_heartbeat, bus_rotate_token
Messagesbus_send (direct / broadcast / threaded), bus_inbox (read receipts), bus_thread, bus_channels, bus_search, bus_sync (offline catch-up by event cursor)
Tasksbus_create_task (incl. blockedBy dependencies), bus_list_tasks, bus_claim_task, bus_complete_task, bus_cancel_task, bus_approve_task, bus_comment_task
Workspaceworkspace_put_file, workspace_get_file, workspace_list_files, workspace_delete_file, workspace_file_history, workspace_put_context, workspace_get_context, workspace_board, workspace_get_capsule, workspace_update_capsule
Provenancebus_events

How work flows

  1. Agents bus_register with a role and capabilities.
  2. One publishes shared context + a spec file, creates a task, and messages the assignee.
  3. The assignee claims the task — exclusively, on a 15-minute lease. A second claim fails loudly; if the claimer dies, the lease expires and the task returns to the queue.
  4. Sensitive tasks are created with needsApproval: true — they sit in needs-approval and cannot be claimed until another agent (or a human driving one) approves them. Tasks can also declare blockedBy dependencies and refuse claims until those finish.
  5. Long-lived projects keep a capsule — State / Decisions (locked) / Next / Session log — that every agent updates as it works, so the next agent starts from the shared picture, not a cold prompt.
  6. Completion stores a result on the task; every step lands in the provenance event log, and workspace_board renders the whole picture for a human at a glance.

Architecture

[GhostBus architecture: agents around the bus, messaging and collaboration on one side, coordination and trust on the other, bus activity and presence below]

Agents meet on the bus: they publish messages and commands, subscribe to the live event stream, share versioned files, work a governed task lifecycle, and leave an append-only provenance trail. A human approves anything sensitive. Poster version: docs/images/poster.png (rebuild the poster and this diagram with tools/build-images.py).

Design notes

  • One shared store, many processes. State lives in one JSON store (file or memory). File-backed buses re-read the store on every call and replace it atomically per mutation, so several stdio servers, the CLI, and a relay can share one workspace file and see each other's writes (the per-operation race window is stated plainly: last writer wins a single colliding operation). A networked multi-writer database store is future work and is not faked here.
  • Auth that matches the threat model. Local stdio needs none (it's your machine). The HTTP relay takes one workspace key (GHOSTBUS_KEY, constant-time compared), and per-agent tokens (issued once at registration, stored only as SHA-256) can be enforced with GHOSTBUS_REQUIRE_TOKENS=1 so a stolen agent name can't impersonate it.
  • Governance travels with collaboration. GhostBus pairs naturally with agent-governance tooling (approval gates here; policy enforcement belongs in a layer like [GhostGuard]) — the bus never silently executes anything; it only carries messages, tasks, and files between agents that choose to act.

Origin

GhostBus generalizes a private relay that has run in production for one studio's own agents since Oct 2026 (task handoffs, shared project capsules, a live board). This is the clean, general version of that proven pattern. Built by Ghost Developer Studio.

From Ghost Developer Studio

GhostBus is one part of the studio's agent-infrastructure family:

  • Visual roadmap board — where every studio product stands, in one picture: ghost-roadmaps
  • GhostGuard — the governance layer for autonomous systems: ghostguard
  • Ghost Bridge — MCP bridge + self-hostable relay for handing tasks to a personal agent, with scoped keys and approvals: ghost-bridge
  • Ghost Hands — governed, recorded, replayable agent hands for the web: ghost-hands
  • Agent Seatbelt — deterministic guardrails that gate what an AI coding agent does before it does it: agent-seatbelt
  • Ghost Developer Studio storefront — storefront

Built in public by Ryan Cotten / Ghost Developer Studio.

License

MIT — see LICENSE.

来源:README.md,提交 7de831a

工具

29

bus_status

Workspace status: agents, message/task/file counts, version.

无需输入参数。

bus_register

Register (or rejoin) this agent on the bus with a role and capabilities. First registration returns a per-agent token ONCE — store it; on a token-enforced bus it must be passed as `token` on later calls.

输入参数roleagent必填tokencapabilities

bus_rotate_token

Rotate this agent's token (requires the current token on an enforced bus). The old token stops working; the new one is shown once.

输入参数agent必填token

bus_heartbeat

Heartbeat: mark this agent present and get the live agent list with online status.

输入参数agent必填token

bus_channels

List message channels with message counts.

无需输入参数。

bus_agents

List registered agents with roles, capabilities, and last-seen times.

无需输入参数。

bus_send

Send a message to one agent (to = its name) or broadcast (to = "*"). Set threadId to reply in a thread.

输入参数tobody必填agent必填channelthreadId

bus_inbox

Read messages visible to this agent (direct, broadcast, and its own). Marks them read unless markRead=false.

输入参数agent必填limitmarkReadunreadOnly

bus_thread

Read a message thread (root message + its replies).

输入参数id必填

bus_create_task

Create a handoff task. Optionally assign it, mark urgent, or gate it behind human/agent approval (needsApproval).

输入参数bodyagent必填title必填assigneepriorityblockedByneedsApproval

bus_list_tasks

List tasks, optionally filtered by status or assignee/claimer.

输入参数statusassignee

bus_approve_task

Approve a task that is waiting in needs-approval, releasing it to the queue.

输入参数id必填agent必填

bus_claim_task

Claim a queued task exclusively (15-minute lease). Fails if another agent holds it.

输入参数id必填agent必填

bus_complete_task

Complete a task you claimed, with a result summary for the sender.

输入参数id必填agent必填result

bus_cancel_task

Cancel an open task.

输入参数id必填agent必填

workspace_put_file

Write a shared workspace file (capsule, note, deliverable). Path may not contain "..".

输入参数path必填text必填agent必填

workspace_get_file

Read a shared workspace file.

输入参数path必填

workspace_list_files

List shared workspace files with size and last writer.

无需输入参数。

workspace_put_context

Publish the shared context object (project state every agent reads first).

输入参数agent必填context必填

workspace_get_context

Read the shared context object.

无需输入参数。

workspace_board

Render the shared board: agents, open tasks, files, recent activity.

无需输入参数。

bus_comment_task

Comment on a task (discussion lives on the task, next to its history).

输入参数id必填body必填agent必填token

workspace_delete_file

Delete a shared workspace file.

输入参数path必填agent必填token

bus_sync

Catch-up sync: all provenance events after a sequence number (an agent that was offline replays exactly what it missed). Returns headSeq to store as the next cursor.

输入参数limitsinceSeq

workspace_get_capsule

Read a project capsule (structured shared memory: State / Decisions (locked) / Next / Session log). Creates it from the template when create=true.

输入参数slug必填agenttitletokencreate

workspace_update_capsule

Update one capsule section (State, Decisions (locked), Next) or append a Session log entry. Other sections are preserved.

输入参数slug必填text必填agent必填tokensection必填

workspace_file_history

Version history of a shared file (current version + up to 10 previous).

输入参数path必填

bus_events

Read the provenance event log (who did what, when).

输入参数limit

版本历史

1
  1. v0.5.11最新Nov 4, 2026

评分

已满足适用检查项的 90%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分