Set up and use an MCP message broker for direct inter-agent communication between OpenClaw and other AI agents (e.g. hermes-agent, Claude Code, any MCP-capable agent). Use when you need two AI agents on the same machine to exchange messages without human relay — replacing Discord copy-paste or txt file workarounds. Triggers on phrases like "set up agent communication", "MCP broker", "inter-agent messaging", "connect two agents", "agent bridge", "Isaac Hermes communication", or any request to ena
一个轻量级的 FastMCP + SQLite 消息代理,让两个 AI 智能体通过 MCP 工具直接通信。两个智能体作为 MCP 客户端连接到同一服务器——对称设计,无需特定平台适配器。
智能体 A (OpenClaw) MCP 代理 智能体 B (hermes-agent / 其他)
sendmessage() ──────► FastAPI+SQLite ◄────────── pollmessages()
pollmessages() ◄────── localhost:8765 ──────────► sendmessage()
bash
cp -r
cd ~/.openclaw/agent-bridge-mcp
./start.sh # 创建虚拟环境,安装依赖,在端口 8765 启动
bash
cp
编辑 plist 文件设置正确路径,然后:
launchctl load ~/Library/LaunchAgents/ai.openclaw.agent-bridge.plist
添加到 ~/.openclaw/openclaw.json:
json
{
mcp: {
servers: {
agent-bridge: {
url: http://127.0.0.1:8765/mcp,
transport: streamable-http
}
}
}
}
给另一个智能体提供 MCP URL:http://127.0.0.1:8765/mcp(streamable-http 传输)。它们使用原生 MCP 客户端支持进行连接。
| 工具 | 参数 | 返回 | 使用场景 |
|---|---|---|---|
| sendmessage | fromagent, to, subject, body, replyto? | {messageid, timestamp} | 发送任务或回复 |
| pollmessages |
json
{
id: 83223c09,
from_agent: hermes,
to_agent: isaac,
subject: 研究请求,
body: 请分析...,
timestamp: 2026-03-31T16:58:31Z,
thread_id: 83223c09,
reply_to: null,
status: pending
}
如果 MCP 服务器不可用,使用文件系统桥接器(零基础设施):
添加到 HEARTBEAT.md 以自动处理传入消息:
检查 ~/.openclaw/shared/isaac-inbox/ 中是否有新的 .json 文件。
如果有:读取、处理、通过 hermes-inbox/ 回复、移动到 processed/ 目录。
测试完整流程:
bash
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 agent-mcp-bridge-1775907841 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 agent-mcp-bridge-1775907841 技能
skillhub install agent-mcp-bridge-1775907841
文件大小: 6.89 KB | 发布时间: 2026-4-12 08:42