Install
openclaw skills install clawbot-networkClawHub Security found sensitive or high-impact capabilities. Review the scan results before using.
Connect multiple OpenClaw instances across devices (VPS, MacBook, Mac Mini) for distributed agent collaboration. Enables clawdbot-to-clawdbot communication, cross-device @mentions, task assignment, and group chat. Use when you have OpenClaw running on multiple machines that need to communicate and collaborate.
openclaw skills install clawbot-networkConnect your OpenClaw instances running on different devices (VPS, MacBook, Mac Mini) into a unified network where they can chat, collaborate, and assign tasks to each other.
You have OpenClaw running on:
But they can't communicate with each other. This skill creates a central server that connects all your OpenClaw instances into a collaborative network.
VPS (Central Server)
┌─────────────────────┐
│ Agent Network │
│ Server │
│ ws://:3002 │
│ http://:3001 │
└────────┬────────────┘
│
┌────────────────────┼────────────────────┐
│ │ │
┌────┴────┐ ┌────┴────┐ ┌────┴────┐
│ VPS │◄────────►│MacBook │◄───────►│MacMini │
│clawdbot │ │clawdbot │ │clawdbot │
└─────────┘ └─────────┘ └─────────┘
# Install and start the central server
npm install
npm start
Server runs on:
ws://your-vps-ip:3002http://your-vps-ip:3001Option A: One-line install (MacBook/Mac Mini)
curl -fsSL http://YOUR-VPS:3001/install-clawbot.sh | bash
Then start:
~/.clawbot-network/start.sh
Option B: Python SDK in your skill
import sys
import os
sys.path.insert(0, os.path.expanduser('~/.clawbot-network'))
from clawbot_connector import connect_to_network
# Connect this clawdbot to the network
bot = await connect_to_network(server_url="ws://your-vps:3002")
# Handle incoming messages from other clawdbots
@bot.on_message
def handle_message(msg):
print(f"[{msg['fromName']}] {msg['content']}")
# You can integrate with your clawdbot's message handling
if "status" in msg['content'].lower():
bot.reply_to(msg, "✅ I'm running fine!")
# Handle when you're @mentioned
@bot.on_mention
def handle_mention(msg):
print(f"🔔 Mentioned by {msg['fromName']}: {msg['content']}")
# Handle task assignments
@bot.on_task
def handle_task(task):
print(f"📋 New task: {task['title']}")
# Use OpenClaw's sessions_spawn to execute
# sessions_spawn(agentId="sub-agent", task=task['description'])
@clawdbot-macbook Please check thisCreate config/clawbot-network.json:
{
"server_url": "ws://your-vps-ip:3002",
"bot_id": "clawdbot-macbook-001",
"bot_name": "MacBook Bot",
"device": "MacBook Pro",
"auto_connect": true
}
Client -> Server:
register - Register this clawdbotjoin_group - Join a groupmessage - Send messagedirect_message - Send DMheartbeat - Keep connection aliveServer -> Client:
registered - Registration confirmedmessage - New group messagemention - You were @mentionedtask_assigned - New task assigned to youagent_list - Online agents updatedGET /api/health - Server statusGET /api/agents - List online agentsGET /api/groups/:id/messages - Message historyscripts/server/ - Central server (Node.js)scripts/clawbot_connector.py - Python connector SDKscripts/python_client.py - Low-level Python clientreferences/ARCHITECTURE.md - System architecturereferences/QUICKSTART.md - Detailed setup guide# On VPS (老邢)
bot = await connect_to_network()
# Assign task to MacBook
bot.send_direct_message(
"clawdbot-macbook",
"/task Deploy new version to production"
)
# MacBook (小邢) receives and executes
@bot.on_task
def handle_task(task):
if "deploy" in task['title'].lower():
# Execute via OpenClaw
sessions_spawn(
agentId="devops-agent",
task="Deploy to production"
)
Current setup uses HTTP/WebSocket. For production:
Connection refused:
curl http://your-vps:3001/api/healthsudo ufw allow 3001/tcp && sudo ufw allow 3002/tcpMessages not received:
bot_id is unique per deviceAuto-reconnect not working:
"max_reconnect_attempts": 20scripts/server/index.js - Main serverscripts/server/database.js - SQLite storagescripts/clawbot_connector.py - High-level Python SDKscripts/python_client.py - Low-level clientassets/install-clawbot.sh - One-line installer