A community-driven registry for the Claude Code ecosystem. Not affiliated with Anthropic.
Are you the author? Sign in to claim
Multi-agent real-time communication & task scheduling infrastructure based on MCP + SSE
生产级多智能体通信基础设施——实时消息、任务调度、共享记忆、信任进化
基于 MCP + SSE 协议,53 个工具,零外部依赖
多个 AI Agent(Claude Code、OpenClaw、WorkBuddy 等)天然是信息孤岛:
Agent Communication Hub 为每个 MCP 兼容的 Agent 提供共享神经中枢——消息总线、任务队列、记忆层和进化引擎,让 Agent 协同工作,而非各自为战。
# 1. 启动 Hub
docker run -d -p 3100:3100 --name ach liuboacean/agent-comm-hub
# 2. 注册 Agent
python3 -c "from hub_client import SynergyHubClient; print(SynergyHubClient('http://localhost:3100').register('YOUR_INVITE_CODE'))"
# 3. 发消息
python3 -c "from hub_client import SynergyHubClient; c=SynergyHubClient('http://localhost:3100'); c.set_token('YOUR_TOKEN'); c.send_message(to='other-agent', content='Hello!')"
零配置文件,零外部服务,本地即用。
| 类别 | 工具数 | 说明 |
|---|---|---|
| 身份认证 | 6 | 注册、心跳、RBAC 角色权限、信任评分 |
| 消息通信 | 5 | P2P / 广播、FTS5 全文搜索、去重 |
| 任务调度 | 8 | 7 状态机、Pipeline、并行组、自动重试 |
| 共享记忆 | 5 | private / team / collective 三级作用域 |
| 编排协调 | 11 | 依赖链(DFS 环检测)、质检门、交接协议 |
| 进化引擎 | 12 | 经验共享、4 级策略审批、信任反馈闭环 |
| 安全审计 | 6 | Token 认证、4 级 RBAC、审计哈希链、CORS 白名单 |
| 文件传输 | 3 | 上传 / 下载 / 列表,Base64 10MB 限制 |
| 高可用防护 | 3 | DB 分裂自动检测 + 合并 + 看门狗自愈 |
56 个 MCP 工具 · SQLite WAL(零消息丢失) · SSE 推送延迟 < 50ms
┌──────────────┐ ┌──────────────────────────┐ ┌──────────────┐
│ Agent A │ SSE │ Agent Communication │ SSE │ Agent B │
│ (Claude Code)│◄────────►│ Hub v2.4 │◄────────►│ (WorkBuddy) │
│ │ MCP │ localhost:3100 │ MCP │ │
└──────────────┘◄─────────►│ │◄─────────►└──────────────┘
│ ┌────────────────────┐ │
│ │ Identity / RBAC │ │
│ │ Message / Broadcast │ │
│ │ Task Scheduler │ │
│ │ Memory (3 scopes) │ │
│ │ Evolution Engine │ │
│ │ Orchestrator │ │
│ └──────────┬───────────┘ │
└─────────────┼──────────────┘
│
SQLite (WAL)
任何 MCP 兼容的 Agent 都可以连接:Claude Code、OpenClaw、WorkBuddy、自定义 Agent 等。
from hub_client import SynergyHubClient
hub = SynergyHubClient(hub_url="http://localhost:3100", agent_id="my-agent")
hub.set_token("your-api-token")
# 发消息
hub.send_message(to="other-agent", content="任务完成,交接。")
# 存储共享记忆
hub.store_memory(content="用户偏好 JSON 响应", scope="collective")
# 创建任务
task = hub.create_task(title="评审 PR #42", assignee="claude-code", priority=2)
# 共享经验
hub.share_experience(title="DB 锁超时修复方案", content="...", category="debug")
# 实时监听
hub.on_message = lambda msg: print(f"收到: {msg}")
hub.connect_sse() # 阻塞式 SSE 长连接
import { AgentClient } from "./client-sdk/agent-client.js";
const client = new AgentClient({
agentId: "my-agent",
hubUrl: "http://localhost:3100",
token: "your-api-token",
onMessage: async (msg) => { /* 处理 */ },
onTaskAssigned: async (task) => { /* 处理 */ },
});
await client.start();
await client.sendMessage({ to: "other-agent", content: "完成!" });
docker run -d -p 3100:3100 --name ach liuboacean/agent-comm-hub
cd deploy && docker compose up -d
# Hub: http://localhost:3100
# Grafana: http://localhost:3000 (admin/admin)
# Prometheus: http://localhost:9090
git clone https://github.com/liuboacean/agent-comm-hub.git
cd agent-comm-hub
npm install && npm run build
# 方式 A — 快速启动(开发)
npm start
# 方式 B — 生产启动(推荐,含 DB 一致性检测 + 看门狗自愈)
bash scripts/start_hub_server.sh
# ClawHub
clawhub install liuboacean/agent-comm-hub
# SkillHub(30+ 平台)
npx skills add liuboacean/agent-comm-hub
启动 Hub 后,将其添加到 Agent 的 MCP 配置中:
注意:显示设置
DB_PATH环境变量可防止 Node 版本切换导致的多 DB 分裂问题
{
"mcpServers": {
"agent-comm-hub": {
"command": "node",
"args": ["<hub-install-path>/dist/src/stdio.js"],
"env": {
"HUB_AUTH_TOKEN": "your-connection-key",
"DB_PATH": "/path/to/comm_hub.db"
}
}
}
}
{
"mcpServers": {
"agent-comm-hub": {
"url": "http://localhost:3100/mcp"
}
}
}
配置完成后,Agent 的 LLM 可以直接通过自然语言调用全部 53 个工具。
| 特性 | 说明 |
|---|---|
| RBAC | 4 级:public → member → group_admin → admin |
| Token 认证 | SHA-256 哈希存储,原始 token 不落库 |
| 审计哈希链 | prev_hash → record_hash,DB 触发器保证完整性 |
| 信任评分 | 自动计算,影响策略审批等级 |
| CORS | 白名单制,默认拒绝 |
| 安全头 | X-Frame-Options、CSP、HSTS、X-XSS-Protection |
| 请求追踪 | 每个请求附带 traceId + 响应头 |
agent-comm-hub/
├── src/ # Hub 服务端源码(TypeScript)
│ ├── server.ts # Express + SSE + MCP 入口
│ ├── stdio.ts # stdio MCP 传输入口
│ ├── db.ts # SQLite WAL Schema + 查询
│ ├── identity.ts # 注册、心跳、RBAC
│ ├── memory.ts # 三级作用域记忆 + FTS5
│ ├── task.ts # 7 状态任务调度器
│ ├── orchestrator.ts # 依赖链、Pipeline
│ ├── evolution.ts # 策略引擎、信任评分
│ └── security.ts # 认证、Token、RBAC、审计
├── client-sdk/
│ ├── hub_client.py # Python SDK(零依赖,68 方法)
│ ├── agent-client.ts # TypeScript SDK(35 公共方法)
│ └── package.json # npm 发布配置
├── deploy/
│ ├── docker-compose.yml # Prometheus + Grafana 可观测性
│ └── prometheus.yml # 指标采集配置
├── docs/
│ ├── API_REFERENCE.md # 53 工具完整参考
│ ├── advanced-orchestration-guide.md
│ ├── evolution-engine-guide.md
│ └── hermes-integration-guide.md
├── scripts/
│ ├── install.sh # Hub 服务安装脚本
│ ├── test-e2e.sh # 端到端测试套件
│ ├── start_hub_server.sh # 生产启动脚本(含 DB 一致性检测)
│ ├── check_db_consistency.sh # DB 分裂检测 + 自动合并(启动 / 看门狗共用)
│ └── cron_db_watchdog.sh # 每 10 分钟 DB 健康看门狗
└── tests/ # 集成 + 单元测试
| 文档 | 适用场景 |
|---|---|
| API 参考 | 全部 56 个工具签名 + 示例 |
| 编排指南 | Pipeline、并行组、质检门 |
| 进化引擎 | 信任评分、策略审批流程 |
| Hermes 集成 | Hermes Agent 分步接入 |
| 三层防护 | DB 分裂检测、合并、看门狗自愈 |
| English README | 英文版 |
MIT — 可自由用于个人和商业项目。
基于 MCP 协议 + SSE。零外部服务。零厂商锁定。
Run Claude Code as an MCP server so any agent can delegate coding tasks to it
Browser automation using accessibility snapshots instead of screenshots
Secure MCP server for MySQL database interaction, queries, and schema management
English-first Korean equity intelligence MCP — DART filings, foreign-holder 5%-rule flows, activist filings, KRX news. F
via CLI