agent-comm-hub
本地多智能体通信 Hub(MCP stdio / HTTP-SSE),提供消息、任务编排、共享记忆、进化引擎,暴露 58 个 MCP 工具 + Web 管理面板 Skill: agent-comm-hub Owner: liuboacean Summary: 本地多智能体通信 Hub(MCP stdio / HTTP-SSE),提供消息、任务编排、共享记忆、进化引擎,暴露 58 个 MCP 工具 + Web 管理面板 Tags: 2.4.0:2.4.0, 2.4.1:2.4.1, agent:3.0.19, agent-comm:3.0.20, agent-comm-hub:3.0.25, ai-agents:1.0.0, audit-log:3.0.22, backup:3.0.25, communication:3.0.25, evolution:2.2.1, heartbeat:3.0.22, hermes:1.0.0, hub:3.0.25, infrastructure:3.0.20, latest:3.0.25, mcp:3.0.25, memory:3.0.25, mess
Rank
62
Safety
84
Downloads
4.3k
Updated
Oct 9, 2026
Version
3.0.25
Source
CLAWHUB
About
What it does, and when to use it.
Capability contract not published. No trust telemetry is available yet. 4.3K downloads reported by the source. Last updated 10/9/2026.
Avoid when
- Contract metadata is missing or unavailable for deterministic execution.
Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing
Public facts
Every fact links back to the source it came from.
- Vendor
- Clawhubvendor · observed Oct 9, 2026
- Protocol compatibility
- OpenClawcompatibility · observed Oct 9, 2026
- Adoption signal
- 4.3K downloadsadoption · observed Oct 9, 2026
- Latest release
- 3.0.25release · observed Sep 30, 2026
- Handshake status
- UNKNOWNsecurity
Install and run
Setup complexity: low.
clawhub skill install s1779brgcyhkdmz9tgjpwarx3h84vb82:agent-comm-hub- Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.
- Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.
Contract: missing
curl -s "https://www.xpersona.co/api/v1/agents/clawhub-liuboacean-agent-comm-hub/snapshot"
Documentation
CLAWHUB
160,000 characters of source documentation, loaded on request.
Extracted files
5 files captured from the source.
SKILL.md
---
name: agent-comm-hub
description: "本地多智能体通信 Hub(MCP stdio / HTTP-SSE),提供消息、任务编排、共享记忆、进化引擎,暴露 58 个 MCP 工具 + Web 管理面板"
version: "3.0.25"
category: autonomous-ai-agents
triggers:
- "agent-comm-hub"
- "AgentCommHub"
- "ACH"
- "agent-comm"
- "agent_comm_hub"
- "通信hub"
- "消息hub"
- "workbuddy"
- "QClaw"
- "send_message"
- "assign_task"
---
# Agent Communication Hub
> 多智能体消息转发与上下文共享中间件 — **v3.0.25**
让两个或多个独立 AI 智能体之间实现**实时双向通信**和**上下文自动同步**。基于 MCP 协议 + stdio 模式,消息本地持久化,延迟 < 50ms。
## 架构概览
```
┌──────────────┐ ┌──────────────────────────────┐ ┌──────────────┐
│ Agent A │ SSE │ Agent Communication Hub │ SSE │ Agent B │
│ (Hermes) │◄───────►│ (stdio) │◄───────►│ (WorkBuddy) │
│ │ MCP │ │ MCP │ │
└──────────────┘◄───────►│ SQLite WAL + 30 表 │◄───────►└──────────────┘
│ 58 MCP 工具 + RBAC 权限 │
│ 上下文暂存 + 建议闭环 │
└──────────────┬──────────────┘
│
SQLite (WAL)
```
**三层协议**:
| 层 | 协议 | 用途 | 延迟 |
|----|------|------|------|
| MCP 工具层 | stdio JSON-RPC | 结构化操作(发消息、分配任务、查状态) | <50ms |
| SSE 推送层 | Server-Sent Events | 实时事件通知(新消息、新任务、建议确认) | <50ms |
## 快速上手 (5 分钟)
从零到完成第一次 Agent 间通信的编号流程:
### Step 1: 确认 Hub 运行状态
确认 Agent Communication Hub 服务器正在运行。如果通过 stdio 模式接入,检查 MCP 配置是否正确加载:
```
调用: get_online_agents()
期望: 返回在线 Agent 列表(至少含自己)
失败: Hub 未运行 → 先启动 Hub 服务器
```
**[检查点] 用户确认**:如果 Hub 未运行,询问用户是否要启动 Hub 服务器。
### Step 2: 注册或确认身份
检查自己是否已在 Hub 注册,如果没有则注册:
```
1. 调用: query_agents(status='all') → 查看所有 Agent
2. 如果自己的 Agent ID 不在列表中
→ register_agent(invite_code, name, capabilities)
3. 如果已注册 → 记下自己的 agent_id 供后续使用
```
**[检查点] 用户确认**:注册新 Agent 需要 invite_code,先问用户是否有可用的邀请码。
### Step 3: 维持在线状态
启动心跳维持在线,确保能接收实时消息推送:
```
调用: heartbeat(agent_id='你的ID')
频率: 每 30 秒一次(超过 90 秒无心跳则自动标记为离线)
```
### Step 4: 检查未读消息
上线后第一时间检查是否有离线期间缓存的消息:
```
1. 调用: search_messages(query='你的ID', limit=20)
2. 筛选 status='unread' 的消息
3. 按时间顺序处理,先 acknowledge_message 确认收到,再回复
```
**[检查点] 用户确认**:找到未读消息后,逐条向用户摘要汇报,请用户确认如何处理。
### Step 5: 发送第一条消息
向另一个 Agent 发送消息,验证双向通信:
```
调用: send_message(from='你的ID', to='目标AgentID', content='通信链路确认畅通')
检查返回: delivered_realtime — true=对方在线, false=对方离线
```
**[检查点] 用户确认**:发送前向用户确认消息内容和目标 Agent。broadcast_message 必须逐条确认。
### 完整闭环示例
```
场景:Hub 在线 → 检查 WorkBuddy 是否有未读消息 → 处理并回复
1. get_online_agents() # 确认自己和对方在线
2. search_messages(limit=10) # 查最近消息
3. acknowledge_message(msg_id, agent_id) # 标记已读
4. send_message(to='workbuddy', content='已收到,正在处理') # 回复
5. mark_consumed(resource=msg_id, action='replied') # 消费水位线
```
## 核心能力
### 58 个 MCP 工具(当前版本)
#### Identity 身份 (6)
| 工具 | 功能 |
|------|------|
| `register_agent` | 注册新 Agent,需提供 HUB_AUTH_TOKEN 认证 |
| `heartbeat` | Agent 心跳上报,维持在线状态,每 3 次连续心跳记录 +1 |
| `README.md
<p align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/badge/Node.js-22-green?logo=node.js">
<img src="https://img.shields.io/badge/Node.js-22-green?logo=node.js" alt="Node.js 22">
</picture>
<img src="https://img.shields.io/badge/Python-3.9+-blue?logo=python" alt="Python 3.9+">
<img src="https://img.shields.io/badge/MCP_Protocol-1.0-orange?logo=robot" alt="MCP Protocol">
<img src="https://img.shields.io/badge/288_Tests-Passing-3fb950?logo=vitest" alt="288 Tests">
<img src="https://img.shields.io/badge/Zero_External_Services-success?logo=server" alt="Zero External Services">
<img src="https://img.shields.io/badge/Web_Panel-Live-7c3aed?logo=htmx" alt="Web Panel">
<a href="https://github.com/liuboacean/agent-comm-hub/actions/workflows/ci.yml">
<img src="https://img.shields.io/github/actions/workflow/status/liuboacean/agent-comm-hub/ci.yml?branch=master&logo=githubactions&label=CI" alt="CI">
</a>
<img src="https://img.shields.io/badge/License-MIT-yellow" alt="MIT License">
<a href="https://pypi.org/project/agent-comm-hub/">
<img src="https://img.shields.io/pypi/v/agent-comm-hub" alt="PyPI">
</a>
<a href="https://www.npmjs.com/package/@liuboacean/agent-comm-hub">
<img src="https://img.shields.io/npm/v/@liuboacean/agent-comm-hub" alt="npm">
</a>
<a href="https://glama.ai/mcp/servers/liuboacean/agent-comm-hub">
<img src="https://glama.ai/mcp/servers/liuboacean/agent-comm-hub/badges/score.svg" alt="Glama score">
</a>
<a href="https://codeguilds.dev/packages/agent-comm-hub">
<img src="https://img.shields.io/badge/Available_on-CodeGuilds-6366f1" alt="Available on CodeGuilds">
</a>
</p>
<h1 align="center">
🤖 Agent Communication Hub
</h1>
<p align="center">
<strong>让 AI Agent 不再各自为战</strong><br>
<em>实时消息 · 任务调度 · 共享记忆 · 信任进化 · Web 仪表盘</em><br>
<code>58 个 MCP 工具 · 零外部服务 · 5 分钟部署</code>
</p>
<p align="center">
<a href="#readme">中文</a> · <a href="docs/README_EN.md">English</a>
· <a href="https://github.com/liuboacean/agent-comm-hub">GitHub</a>
</p>
<br>
---
## 👀 一眼看明白
```mermaid
graph LR
A[Claude Code] <--> H((ACH Hub))
B[WorkBuddy] <--> H
C[OpenClaw] <--> H
D[自定义 Agent] <--> H
H --> DB[(SQLite)]
H --> Web[Web 仪表盘]
style H fill:#4f46e5,color:#fff
style Web fill:#7c3aed,color:#fff
```
**任何 MCP 兼容的 AI Agent** → 连接 Hub → 立即获得:消息总线、任务队列、共享记忆、进化引擎。
> 🚀 **5 分钟启动**:`docker run -d -p 3100:3100 ghcr.io/liuboacean/agent-comm-hub`
---
## 💡 为什么需要它?
多个 AI Agent(Claude Code、WorkBuddy、OpenClaw、Hermes 等)天然是**信息孤岛**:
| 问题 | 传统方案 | 为什么不行 |
|------|---------|-----------|
| ❌ Agent 间无法通信 | Webhook / 共享文件 | 脆弱、不可靠、手动维护 |
| ❌ 无法跨 Agent 调度任务 | 各自为战 | 没人协调,任务丢失 |
| ❌ 无法共享上下文 | 每轮对话都从零开始 | 记不住团队经验 |
| ❌ 无法团队进化 | 每个 Agent 独自踩坑 | 同样的问题反复修 |
**Agent Communication Hub(ACH)** 是它们的**共享神经中枢**——一条消息总线 + 任务调度器 + 团队记忆库 + 经验进化引擎。
---
## 🚀 三步上手
```bash
# 0. 安装 Python SDK(可选)
pip install agent-comm-hub
# 1. 启动 Hub(一行命令)
_meta.json
{
"ownerId": "kn73qbrbqs4s8t2nh8pm22wxbd84vm7r",
"slug": "agent-comm-hub",
"version": "3.0.25",
"publishedAt": 1790732360314
}CHANGELOG.md
# Changelog ## [3.0.24] - 2026-08-14 — 宿主执行器闭环收口(HostExecutor 注入) ### Changed (宿主接入收口) - **真实宿主执行器(HostExecutor)**:新增 `client-sdk/adapters/host-executor.ts`,提供 `LlmHostExecutor`(直连 Anthropic/OpenAI,需 `HOST_LLM_API_KEY`)与 `HttpHostExecutor`(POST 到 `HOST_EXEC_ENDPOINT`)两套参考实现;`defaultHostExecutor()` 按环境变量自动二选一;`AbstractHostTaskBridge` 新增可注入 `executor` 字段(默认 `defaultHostExecutor()`) - **消灭 setTimeout 占位**:WorkBuddy / Hermes 桥的 `runTask()` 改为委托 `this.executor.execute(task, report)`,任务到达即触发宿主真实能力,「任务派发 → Agent 自动干活 → 回写结果」真正闭环 - **文档**:`docs/HOST_INTEGRATION.md` §4 重写为 HostExecutor 注入模型 + 环境变量表 + 自定义执行器示例 ## [3.0.23] - 2026-08-14 — Agent 自主执行闭环 + 人在环授权 ### Added (Feature A — Agent 自主执行闭环) - **`AgentRuntime` 运行时原语**(`client-sdk/runtime.ts`):包裹 `AgentClient`,自动驱动 `in_progress → execute() → completed/failed`,内置 inFlight 去重、崩溃恢复、loopGuard,消灭 Agent 间人工「传话」 - **`runAutonomousLoop` 工厂**:宿主一行接入即可让 Agent 自动消费任务事件并自循环 ### Added (Feature B — 人在环授权队列) - **操作级授权**:`auth_requests` 表 + `request_authorization` / `resolve_authorization` / `list_authorization_requests` 工具,deny-by-default,TTL 10min - **Web `AuthQueue` 面板**:待授权操作实时队列,用户一键批准 / 拒绝 - **SSE 事件推送**授权请求;宿主侧 `AgentClient.requestAuthorization(op)` 阻塞等待决议 ### Chore - 清理 `client-sdk/` 下 3 个 5 月陈旧编译产物(`agent-client.js` / `hermes-integration.js` / `workbuddy-integration.js`)及其 `.map`,修正 `client-sdk/package.json` 的 `main` / `files` 入口引用;vitest 的 `.js→.ts` 别名已旁路这些文件,移除不影响构建与 312 项测试 ## [3.0.22] - 2026-07-23 — 在线状态 / 审计归档 / 备份路径 ### Changed (在线状态判定) - **SSE 实时连接纳入「在线」判定**:新增统一判定 `isAgentOnline()` / `getOnlineAgentIds()` =(存在 SSE 连接)**或**(心跳在 90s 阈值内)。`get_online_agents` 工具、派单候选排序(`orchestrator`)、`/health/detailed`、`/api/agents`、`hub_agents_online` 指标全部改用统一判定 - **心跳监控不再误杀 SSE 在线 Agent**:`startHeartbeatMonitor` 对仍有 SSE 连接的 Agent 不再因心跳陈旧标记离线、也不再广播离线通知 - **SSE 连接同步 `agents.status`**:连接建立即标记 `online`、断开且心跳陈旧才标 `offline`,数据库与「SSE 已连」事实一致 ### Changed (审计日志归档) - **`enforceAuditLogCap(maxRows)`**:`audit_log` 超过 `AUDIT_LOG_MAX_ROWS`(默认 3000,env 可调)行时,将最旧溢出行自动**镜像**到 `audit_log_archive`(WORM 安全,不删源表) - **维护调度器**:`server` 启动即跑、之后每小时执行「90 天时间归档 + 行数上限镜像」,解决「audit_log 无限增长、归档机制空转」 ### Changed (备份路径) - **`backup.ts` 改用稳定路径**:`BACKUP_DIR` 从 `process.cwd()/backups`(易失 workspace)改为 `~/agent-comm-hub/backups`,与 launchd 备份脚本同目录;支持 `BACKUP_DIR` 环境变量覆盖 ## [3.0.21] - 2026-07-23 — 审计修复(稳定性 / 安全 / 质量) ### Fixed (P1 — 稳定性 / 安全) - **P1-1 SSE 重连竞态**:`registerClient`/`removeClient` 增加连接级 `connId` 校验,旧 socket 的 `close` 事件不再误删「当前」实时连接,重连后消息 / 任务 / 激活通知不再静默丢失 - **P1-2 并发写 `SQLITE_BUSY`**:`db` 初始化增加 `busy_timeout=5000` + `foreign_keys=ON` + `wal_autocheckpoint`,消除 HTTP handler / SSE push / 后台调度并发写导致的静默丢数据 - **P1-3 限流绕过**:认证前置 IP / 全局限流(防令牌爆破与未认证 `/mcp` 耗尽资源);`/mcp` 增加并发在途上限(默认 50)防 DoS - **P1-4 / P1-5 FTS 值碰撞**:`memories_fts` 增加 `memory_id` 精确关联键(启动迁移旧表),召回按 `id` 关联、删除按 `id` 命中,内容相同的两条记忆不再互相串台(删除一条误伤另一条) ### Fixed (P2 — 质量 / 文档) - **P2-1 信任分误扣**:`revoke_token` 审计将「被吊销者」写入 `target` 列,信任分公式改按 `target` 统计,管理员不再被误扣、被吊销者正确扣分 - **P2-2 metrics 无
client-sdk/README_PYPI.md
# Agent Communication Hub — Python SDK
Zero-dependency Python client for [Agent Communication Hub](https://github.com/liuboacean/agent-comm-hub) — production-grade multi-agent infrastructure for real-time messaging, task scheduling, and shared memory.
```python
from hub_client import SynergyHubClient
hub = SynergyHubClient("http://localhost:3100")
hub.set_token("your-token")
hub.send_message(to="other-agent", content="Hello!")
```
## Features
- **P2P Messaging** — Real-time communication between agents via SSE
- **Task Scheduling** — Create, assign, and track tasks across agents
- **Shared Memory** — Three scopes: private, team, collective
- **Zero External Dependencies** — Only Python stdlib required
- **Auto-Reconnect** — Exponential backoff SSE reconnection
- **Client-Side Dedup** — Built-in event deduplication
## Install
```bash
pip install agent-comm-hub
```
## Quick Start
```python
from hub_client import SynergyHubClient, create_client
# Connect to a running Hub
hub = SynergyHubClient("http://localhost:3100")
# Register (requires invite code from Hub admin)
result = hub.register(invite_code="YOUR_INVITE_CODE", name="my-agent")
hub.set_token(result["api_token"])
# Send a message
hub.send_message(to="other-agent", content="Hello from Python!")
# Store collective memory
hub.store_memory(
content="User prefers JSON responses",
scope="collective"
)
# Real-time SSE listener (blocking)
hub.on_message = lambda msg: print(f"Received: {msg}")
hub.connect_sse()
```
## Requirements
- Python 3.9+
- An [Agent Communication Hub](https://github.com/liuboacean/agent-comm-hub) server running (local or remote)
## License
MITAionUi
Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!
activepieces
AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
cherry-studio
AI productivity studio with smart chat, autonomous agents, and 300+ assistants.
CopilotKit
The Frontend for Agents & Generative UI. React + Angular
Machine-readable data
The same record, as JSON, for agents and crawlers.
{
"facts": [
{
"factKey": "vendor",
"category": "vendor",
"label": "Vendor",
"value": "Clawhub",
"href": "https://clawhub.ai/liuboacean/skills/agent-comm-hub",
"sourceUrl": "https://clawhub.ai/liuboacean/skills/agent-comm-hub",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-09T05:46:00.986Z",
"isPublic": true
},
{
"factKey": "protocols",
"category": "compatibility",
"label": "Protocol compatibility",
"value": "OpenClaw",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-liuboacean-agent-comm-hub/contract",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-liuboacean-agent-comm-hub/contract",
"sourceType": "contract",
"confidence": "medium",
"observedAt": "2026-10-09T05:46:00.986Z",
"isPublic": true
},
{
"factKey": "traction",
"category": "adoption",
"label": "Adoption signal",
"value": "4.3K downloads",
"href": "https://clawhub.ai/liuboacean/agent-comm-hub",
"sourceUrl": "https://clawhub.ai/liuboacean/agent-comm-hub",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-09T05:46:00.986Z",
"isPublic": true
},
{
"factKey": "latest_release",
"category": "release",
"label": "Latest release",
"value": "3.0.25",
"href": "https://clawhub.ai/liuboacean/agent-comm-hub",
"sourceUrl": "https://clawhub.ai/liuboacean/agent-comm-hub",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-09-30T01:39:20.314Z",
"isPublic": true
},
{
"factKey": "handshake_status",
"category": "security",
"label": "Handshake status",
"value": "UNKNOWN",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-liuboacean-agent-comm-hub/trust",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-liuboacean-agent-comm-hub/trust",
"sourceType": "trust",
"confidence": "medium",
"observedAt": null,
"isPublic": true
}
],
"events": [
{
"eventType": "release",
"title": "Release 3.0.25",
"description": "v3.0.25 同步发布:修复 strategies/memories FTS 重建逻辑(先 DELETE 再全量 INSERT,根治 constraint failed 与索引漂移);新增 SQLite quick_check 结构完整性 + FTS 漂移看门狗探针(scripts/cron_db_watchdog.sh,仅告警不重启);新增凭据泄露扫描/脱敏/轮换三件套(scripts/scan|redact|rotate_leaked_credentials.py)。",
"href": "https://clawhub.ai/liuboacean/agent-comm-hub",
"sourceUrl": "https://clawhub.ai/liuboacean/agent-comm-hub",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-09-30T01:39:20.314Z",
"isPublic": true
}
]
}Record generated Oct 9, 2026.
