MCP Agent Bridge
MCP Agent Bridge
Ein leichtgewichtiger MCP-Bridge-Server (Model Context Protocol), der es Hermes Agent und OpenClaw ermöglicht, Tools und Speicher zu teilen, um ein kooperatives Multi-Agenten-System zu bilden.
Architektur
┌─────────────┐ ┌──────────────────┐ ┌─────────────┐
│ 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 steuert Messaging-Kanäle (Feishu, WeChat, Telegram…) sowie seine Planungs- und Reasoning-Fähigkeiten bei.
OpenClaw steuert KI-Bildgenerierung, Websuche, TTS und Videogenerierung bei.
Die Bridge stellt die Stärken jedes Agenten dem anderen über standardmäßige MCP-Tool-Aufrufe zur Verfügung, ergänzt durch einen gemeinsamen, SQLite-basierten Speicher.
Related MCP server: ACP-MCP-Server
Verfügbare Tools
Tool | Richtung | Beschreibung |
| OC → Hermes | KI-Bildgenerierung über OpenClaw |
| OC → Hermes | Websuche über OpenClaw |
| OC → Hermes | URL-Inhaltsextraktion über OpenClaw |
| OC → Hermes | Text-to-Speech über OpenClaw |
| Hermes → OC | Nachrichten über Hermes-Plattformen senden |
| Hermes → OC | Aufgaben an den KI-Agenten von Hermes delegieren |
| Bidirektional | Aus gemeinsamem Key-Value-Speicher lesen |
| Bidirektional | In gemeinsamen Key-Value-Speicher schreiben |
| Bidirektional | Speicher-Keys mit optionalen Filtern auflisten |
| Bidirektional | Einen Speicher-Key löschen |
| — | Gesundheitsprüfung und Liste der registrierten Module |
Schnellstart
Voraussetzungen
Python 3.11+
Hermes Agent mit aktiviertem API-Server
OpenClaw CLI installiert und konfiguriert
pip install "mcp[cli]>=1.0" aiohttp pyyaml
Installation
git clone https://github.com/fkdt01/mcp-agent-bridge.git
cd mcp-agent-bridge
pip install -e .Konfiguration
cp config.example.yaml config.yaml
# Edit config.yaml — fill in your API keys and pathsWichtige Einstellungen:
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"Ausführung
# Start the bridge server
python -m bridge.server
# With custom options
python -m bridge.server --config /path/to/config.yaml --port 18900 --log-level DEBUGHermes verbinden
In ~/.hermes/config.yaml hinzufügen:
mcp_servers:
agent-bridge:
transport: sse
url: http://127.0.0.1:18900/sseOpenClaw verbinden
In ~/.openclaw/openclaw.json → mcpServers hinzufügen:
{
"mcpServers": {
"agent-bridge": {
"transport": "sse",
"url": "http://127.0.0.1:18900/sse"
}
}
}Anwendungsbeispiele
Hermes generiert ein Bild über OpenClaw
Wenn Hermes ein Bild generieren muss (z. B. aus einem Feishu-Chat), ruft es auf:
oc_image_generate({
prompt: "A futuristic city at sunset, cyberpunk style",
aspect_ratio: "16:9",
model: "openai"
})→ Bridge führt openclaw capability image generate --prompt "..." --json aus
→ Gibt Bildpfad/Metadaten an Hermes zurück
→ Hermes liefert das Bild an den Benutzer aus
OpenClaw sendet eine Feishu-Nachricht über Hermes
hermes_send_message({
message: "✅ Image generation complete!",
target: "feishu"
})→ Bridge sendet POST an Hermes API /v1/chat/completions
→ Hermes liefert die Nachricht an den Feishu-Kanal aus
Gemeinsamer Speicher zwischen Agenten
Hermes schreibt Projektkontext:
shared_memory_write({
key: "project.math-game.pet-design",
value: "算术小喵: 草原主题, 绿色配色",
source: "hermes"
})OpenClaw liest ihn später:
shared_memory_read({ key: "project.math-game.pet-design" })
→ { value: "算术小喵: 草原主题, 绿色配色", source: "hermes", updated_at: 1745631000 }Eigene Tools hinzufügen
Erstellen Sie eine neue Datei in bridge/tools/ gemäß der Namenskonvention:
oc_*.py— OpenClaw-basierte Toolshermes_*.py— Hermes-basierte Toolsshared_*.py— Gemeinsame/bidirektionale Tools
Jedes Modul muss eine register(mcp, config)-Funktion bereitstellen:
"""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"}Das Tool wird beim Serverstart automatisch erkannt und registriert.
Ausführung als systemd-Dienst
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-bridgeProjektstruktur
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.tomlLizenz
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
The Remote MCP server acts as a standardized bridge between LLM applications (like Claude, ChatGPT, and Cursor) and external services, enabling AI agents to access external tools and resources. Its primary capability is providing a centralized search tool to discover other MCP servers and their respective tools. Unlike local implementations, it runs remotely with OAuth authentication and permission controls for security.
An MCP memory server. One memory your agents share — across models, devices and apps.
Shared memory and mail for your AI agents. Verified with Claude Code; other MCP clients in testing.
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
Related MCP Servers
- AlicenseAqualityFmaintenanceA bridge server that enables MCP-compatible AI assistants like Claude to seamlessly discover, communicate with, and manage A2A protocol agents.733 PyPI147Apache 2.0
- AlicenseBqualityFmaintenanceA bridge server that connects Agent Communication Protocol (ACP) agents with Model Context Protocol (MCP) clients, enabling seamless integration between ACP-based AI agents and MCP-compatible tools like Claude Desktop.16125 PyPI24MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server and local HTTP bridge designed to integrate remote upstream MCP tools into OpenClaw skills or local environments. It enables users to generate skill wrappers and proxy tool calls via a local HTTP bridge for use in Claude Desktop, Cursor, or OpenClaw.Apache 2.0
- AlicenseNot gradedqualityDmaintenanceBridges OpenClaw and Hermes Agent, enabling multi-turn conversations, messaging via Hermes channels, and health checks through MCP tools.12 npmMIT