Self-Hosted Multi-Agent Coordination is a ai-agents Claude Skill built by zak. Best for: DevOps engineers and AI researchers coordinate multiple autonomous agents on private networks with complete infrastructure control..
Deploy local Matrix/Synapse server enabling real-time bot-to-bot communication across multiple OpenClaw instances without cloud dependencies.
Multi-agent coordination via self-hosted Matrix. Run multiple OpenClaw instances that talk to each other through your own Synapse server.
# 1. Clone and run setup
git clone https://github.com/zscole/matrix-agents
cd matrix-agents
./setup.sh
# 2. Note the credentials printed at the end
# 3. On each OpenClaw instance, run the bridge
python3 bridge.py --user @claw:home.local --password <password> --openclaw-url http://localhost:18789 --openclaw-token <your-token>
The setup script creates a Docker container running Synapse with:
home.localCreate a user for each OpenClaw instance:
./create-user.sh mybot MyPassword123
This registers @mybot:home.local on your server.
Create a room and invite all bots:
./create-room.sh bot-coordination
./invite-user.sh bot-coordination @bot1:home.local
./invite-user.sh bot-coordination @bot2:home.local
The bridge polls Matrix for new messages and forwards them to OpenClaw as wake events:
python3 bridge.py \
--user @claw:home.local \
--password ClawBot2026 \
--room '!roomid:home.local' \
--openclaw-url http://localhost:18789 \
--openclaw-token YOUR_GATEWAY_TOKEN
Run this as a background service on each machine.
┌─────────────────┐ ┌─────────────────┐
│ OpenClaw #1 │ │ OpenClaw #2 │
│ (Mac mini) │ │ (MacBook Pro) │
└────────┬────────┘ └────────┬────────┘
│ │
│ bridge.py │ bridge.py
│ │
▼ ▼
┌─────────────────────────────────────────────┐
│ Matrix/Synapse │
│ (Docker, port 8008) │
│ │
│ Room: #bot-coordination:home.local │
│ Users: @claw, @spunk, @zak │
└─────────────────────────────────────────────┘
From your OpenClaw agent, send messages back to Matrix:
curl -X PUT "http://localhost:8008/_matrix/client/v3/rooms/ROOM_ID/send/m.room.message/txn$(date +%s)" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"msgtype":"m.text","body":"Hello from OpenClaw"}'
Or use the included matrix-send.sh helper:
./matrix-send.sh "Hello from OpenClaw"
./install-launchd.sh
Creates a LaunchAgent that starts the bridge on login.
./install-systemd.sh
Creates a user service for the bridge.
Token expired: Re-login with ./login.sh @user:home.local password to get a fresh token.
Can't join room: Make sure the room is public or the user has been invited.
Bridge not receiving messages: Check that the bridge is running and the since token is being saved (check ~/.matrix-bridge-since).
Docker not starting: Open Docker Desktop manually, wait for it to initialize, then re-run setup.
0.0.0.0:8008 - restrict with firewall if neededsetup.sh - One-shot Synapse setupbridge.py - Matrix-to-OpenClaw bridgecreate-user.sh - Register new bot userscreate-room.sh - Create coordination roomsmatrix-send.sh - Send messages from CLIinstall-launchd.sh - macOS service installerinstall-systemd.sh - Linux service installer/plugin install self-hosted-multi-agent-coordination@zscoleRequires Claude Code CLI.
DevOps engineers and AI researchers coordinate multiple autonomous agents on private networks with complete infrastructure control.
No reviews yet. Be the first to review this skill.