MCP Agent Bridge
A bridge server that enables Hermes Agent and OpenClaw to share tools and memory, forming a cooperative multi-agent system.
README
MCP Agent Bridge
A lightweight MCP (Model Context Protocol) bridge server that enables Hermes Agent and OpenClaw to share tools and memory, forming a cooperative multi-agent system.
Architecture
┌─────────────┐ ┌──────────────────┐ ┌─────────────┐
│ Hermes │ MCP │ Agent Bridge │ CLI/ │ OpenClaw │
│ Agent │◄───────►│ (FastMCP SSE) │◄───────►│ CLI │
│ │ client │ Port :18900 │ HTTP │ │
│ Feishu/WX │ │ │ │ Image/Web │
│ Memory/Plan │ │ Shared Memory │ │ TTS/Video │
└─────────────┘ └──────────────────┘ └─────────────┘
Hermes contributes messaging channels (Feishu, WeChat, Telegram…) and its planning/reasoning capabilities.
OpenClaw contributes AI image generation, web search, TTS, and video generation.
The Bridge makes each agent's strengths available to the other through standard MCP tool calls, plus a shared SQLite-backed memory store.
Exposed Tools
| Tool | Direction | Description |
|---|---|---|
oc_image_generate |
OC → Hermes | AI image generation via OpenClaw |
oc_web_search |
OC → Hermes | Web search via OpenClaw |
oc_web_fetch |
OC → Hermes | URL content extraction via OpenClaw |
oc_tts_convert |
OC → Hermes | Text-to-speech via OpenClaw |
hermes_send_message |
Hermes → OC | Send messages through Hermes's platforms |
hermes_chat |
Hermes → OC | Delegate tasks to Hermes's AI agent |
shared_memory_read |
Bidirectional | Read from shared key-value store |
shared_memory_write |
Bidirectional | Write to shared key-value store |
shared_memory_list_keys |
Bidirectional | List memory keys with optional filters |
shared_memory_delete |
Bidirectional | Delete a memory key |
bridge_health |
— | Health check and registered module list |
Quick Start
Prerequisites
- Python 3.11+
- Hermes Agent with API Server enabled
- OpenClaw CLI installed and configured
pip install "mcp[cli]>=1.0" aiohttp pyyaml
Install
git clone https://github.com/fkdt01/mcp-agent-bridge.git
cd mcp-agent-bridge
pip install -e .
Configure
cp config.example.yaml config.yaml
# Edit config.yaml — fill in your API keys and paths
Key settings:
openclaw:
cli_path: "openclaw" # or full path like /usr/local/bin/openclaw
image_provider: "openai" # default image gen provider
web_search_provider: "duckduckgo"
hermes:
api_url: "http://127.0.0.1:8888"
api_key: "" # or set HERMES_API_KEY env var
default_channel: "feishu"
memory:
backend: "sqlite"
db_path: "data/bridge_memory.db"
Run
# Start the bridge server
python -m bridge.server
# With custom options
python -m bridge.server --config /path/to/config.yaml --port 18900 --log-level DEBUG
Connect Hermes
Add to ~/.hermes/config.yaml:
mcp_servers:
agent-bridge:
transport: sse
url: http://127.0.0.1:18900/sse
Connect OpenClaw
Add to ~/.openclaw/openclaw.json → mcpServers:
{
"mcpServers": {
"agent-bridge": {
"transport": "sse",
"url": "http://127.0.0.1:18900/sse"
}
}
}
Usage Examples
Hermes generates an image via OpenClaw
When Hermes needs to generate an image (e.g. from a Feishu chat), it calls:
oc_image_generate({
prompt: "A futuristic city at sunset, cyberpunk style",
aspect_ratio: "16:9",
model: "openai"
})
→ Bridge runs openclaw capability image generate --prompt "..." --json
→ Returns image path/metadata to Hermes
→ Hermes delivers the image to the user
OpenClaw sends a Feishu message via Hermes
hermes_send_message({
message: "✅ Image generation complete!",
target: "feishu"
})
→ Bridge POSTs to Hermes API /v1/chat/completions
→ Hermes delivers the message to the Feishu channel
Shared memory between agents
Hermes writes project context:
shared_memory_write({
key: "project.math-game.pet-design",
value: "算术小喵: 草原主题, 绿色配色",
source: "hermes"
})
OpenClaw reads it later:
shared_memory_read({ key: "project.math-game.pet-design" })
→ { value: "算术小喵: 草原主题, 绿色配色", source: "hermes", updated_at: 1745631000 }
Adding Custom Tools
Create a new file in bridge/tools/ following the naming convention:
oc_*.py— OpenClaw-backed toolshermes_*.py— Hermes-backed toolsshared_*.py— Shared/bidirectional tools
Each module must expose a register(mcp, config) function:
"""My custom tool."""
from mcp.server.fastmcp import FastMCP
from typing import Any
def register(mcp: FastMCP, config: dict[str, Any]) -> None:
@mcp.tool()
async def my_custom_tool(param: str) -> dict[str, Any]:
"""Tool description — this becomes the MCP tool description."""
# Your implementation here
return {"result": "ok"}
The tool is auto-discovered and registered on server startup.
Running as a systemd Service
cat > ~/.config/systemd/user/mcp-agent-bridge.service << 'EOF'
[Unit]
Description=MCP Agent Bridge Server
After=network.target
[Service]
Type=simple
WorkingDirectory=/path/to/mcp-agent-bridge
ExecStart=/usr/bin/python -m bridge.server
Restart=on-failure
RestartSec=5
Environment=HERMES_API_KEY=your_key_here
[Install]
WantedBy=default.target
EOF
systemctl --user daemon-reload
systemctl --user enable --now mcp-agent-bridge
Project Structure
mcp-agent-bridge/
├── bridge/
│ ├── __init__.py
│ ├── __main__.py
│ ├── server.py # FastMCP server entry point
│ ├── config.py # YAML + env-var config loader
│ ├── openclaw_runner.py # Shared async CLI subprocess runner
│ ├── memory.py # SQLite-backed shared memory store
│ └── tools/
│ ├── __init__.py # Auto-discovery & registration
│ ├── oc_image.py # Image generation
│ ├── oc_web.py # Web search & fetch
│ ├── oc_tts.py # Text-to-speech
│ ├── hermes_messaging.py # Message sending
│ ├── hermes_chat.py # Task delegation
│ └── shared_memory.py # Shared memory tools
├── config.example.yaml
├── .gitignore
├── LICENSE
├── README.md
└── pyproject.toml
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。