Agent-Comm-Hub
它解决了什么问题?
当你运行多个 AI 智能体(Claude Code、OpenClaw、WorkBuddy、自定义智能体等)时,它们通常处于孤立状态。它们无法:
在没有脆弱的 Webhook 或共享数据库的情况下相互通信
跨智能体边界调度任务
在单次提示词之外共享上下文
基于过往经验作为团队共同进化
智能体通信中心 (Agent Communication Hub) 为每个兼容 MCP 的智能体提供了一个共享的神经系统——消息总线、任务队列、内存层和进化引擎——让智能体能够协作而非孤立运行。
3 行代码即可尝试
# 1. Start the Hub
docker run -d -p 3100:3100 --name ach liuboacean/agent-comm-hub
# 2. Register an agent
python3 -c "from hub_client import SynergyHubClient; print(SynergyHubClient('http://localhost:3100').register('YOUR_INVITE_CODE'))"
# 3. Send a message
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 | 点对点/广播、FTS5 搜索、去重 |
任务调度 | 8 | 7 状态机、流水线、并行组、自动重试 |
内存 | 5 | 私有/团队/集体作用域、边缘函数评分 |
编排 | 11 | 依赖链(DFS 循环检测)、质量门禁、移交协议 |
进化 | 12 | 经验共享、4 级策略审批、信任评分反馈循环 |
安全 | 6 | Token 认证、4 级 RBAC、审计哈希链、CORS 白名单 |
文件 | 3 | 上传/下载/列表,支持最大 10MB Base64 |
53 个 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 的智能体均可连接:Claude Code、OpenClaw、WorkBuddy、Hermes、自定义智能体等。
SDK 示例
Python — 零依赖
from hub_client import SynergyHubClient
hub = SynergyHubClient(hub_url="http://localhost:3100", agent_id="my-agent")
hub.set_token("your-api-token")
# Send a message
hub.send_message(to="workbuddy", content="Task completed, handing over.")
# Store shared memory
hub.store_memory(content="User prefers JSON responses", scope="collective")
# Assign a task
task = hub.create_task(title="Review PR #42", assignee="claude-code", priority=2)
# Share a lesson learned
hub.share_experience(title="DB lock timeout fix", content="...", category="debug")
# Stream incoming events
hub.on_message = lambda msg: print(f"Received: {msg}")
hub.connect_sse() # blocks — long-lived SSE connectionTypeScript — 同样零外部依赖
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) => { /* handle */ },
onTaskAssigned: async (task) => { /* handle */ },
});
await client.start();
await client.sendMessage({ to: "workbuddy", content: "Done!" });部署
Docker (推荐)
docker run -d -p 3100:3100 --name ach liuboacean/agent-comm-hubDocker Compose (包含 Prometheus + Grafana)
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
npm start作为技能 (Skill)
# ClawHub
clawhub install liuboacean/agent-comm-hub
# SkillHub (30+ platforms)
npx skills add liuboacean/agent-comm-hubMCP 配置
启动 Hub 后,将其添加到智能体的 MCP 配置中:
选项 1:stdio (推荐)
{
"mcpServers": {
"agent-comm-hub": {
"command": "node",
"args": ["<hub-install-path>/stdio.js"],
"env": {
"HUB_KEY": "your-connection-key"
}
}
}
}选项 2:HTTP + SSE
{
"mcpServers": {
"agent-comm-hub": {
"url": "http://localhost:3100/mcp"
}
}
}智能体的 LLM 随后可以通过自然语言直接调用所有 53 个工具。
安全性
功能 | 详情 |
RBAC | 4 个级别:public → member → group_admin → admin |
Token 认证 | SHA-256 智能体 Token,以哈希形式存储在数据库中 |
审计哈希链 |
|
信任评分 | 自动计算,影响策略审批层级 |
CORS | 仅限白名单,默认拒绝 |
安全标头 | X-Frame-Options, CSP, HSTS, X-XSS-Protection |
请求追踪 | 每个请求 + 响应标头均包含 traceId |
文件结构
agent-comm-hub/
├── src/ # Hub server source (TypeScript)
│ ├── server.ts # Express + SSE + MCP entry point
│ ├── db.ts # SQLite WAL schema + queries
│ ├── identity.ts # Registration, heartbeat, RBAC
│ ├── memory.ts # 3-scope memory with FTS5
│ ├── task.ts # 7-state task scheduler
│ ├── orchestrator.ts # Dependency chains, pipelines
│ ├── evolution.ts # Strategy engine, trust scoring
│ └── security.ts # Auth, token, RBAC, audit
├── client-sdk/
│ ├── hub_client.py # Python SDK (zero deps, 68 methods)
│ └── agent-client.ts # TypeScript SDK (35 public methods)
├── deploy/
│ ├── docker-compose.yml # Prometheus + Grafana observability
│ └── prometheus.yml # Metrics scraping config
├── docs/
│ ├── API_REFERENCE.md # 53 tools complete reference
│ ├── advanced-orchestration-guide.md
│ ├── evolution-engine-guide.md
│ └── hermes-integration-guide.md
├── scripts/
│ ├── install.sh # Hub server install script
│ └── test-e2e.sh # End-to-end test suite
└── tests/ # Integration + unit tests文档
文档 | 阅读时机 |
每个工具的签名 + 示例 | |
流水线、并行组、质量门禁 | |
信任评分、策略审批工作流 | |
Hermes 智能体分步设置 | |
本页面 |
许可证
MIT — 可在个人和商业项目中自由使用。
Latest Blog Posts
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/liuboacean/agent-comm-hub'
If you have feedback or need assistance with the MCP directory API, please join our Discord server