Skip to main content

Overview

Multi-Gateway support lets you connect Mission Control to multiple OpenClaw gateway instances simultaneously. Monitor connection health, switch between gateways, and manage direct CLI connections—all from a unified interface.
Connect to gateways on different hosts, ports, or networks to support distributed agent fleets, dev/staging/prod environments, or high-availability configurations.

Architecture

Mission Control supports two connection types:
WebSocket connections to OpenClaw gateway servers. Each gateway can manage multiple agents.

Gateway Configuration

Database Schema

Gateways are stored in the gateways table:

Adding a Gateway

Use the UI form or API:

Setting Primary Gateway

The primary gateway auto-connects on page load:

WebSocket Connection

Connecting to a gateway establishes a WebSocket:

Connection State

The Zustand store tracks active connection:

Health Monitoring

Gateway Probing

Probe all gateways to check status and latency:

Status Indicators

Gateway cards show real-time status:

Direct CLI Connections

CLI tools connect via the /api/connect endpoint:

Registration

Heartbeat

CLI tools send periodic heartbeats:

Disconnection

UI Components

The Multi-Gateway Panel provides full management:

Best Practices

  • Name gateways descriptively: “Production”, “Staging”, “Dev”, not “Gateway 1”
  • Set primary for auto-connect: The primary gateway connects on page load
  • Use secure tokens: Generate strong tokens for production gateways
  • Document network topology: Keep a map of gateway hosts and ports

Troubleshooting

1

Gateway shows 'offline' status

  • Verify gateway is running: ps aux | grep openclaw
  • Check firewall rules allow WebSocket port (default: 18789)
  • Test connectivity: telnet <host> <port>
  • Review gateway logs for connection errors
2

High latency or timeouts

  • Check network congestion between Mission Control and gateway
  • Verify gateway host resources (CPU, memory)
  • Consider geographic distribution—use local gateways when possible
  • Review gateway configuration for performance tuning
3

Direct connection not appearing

  • Verify agent_name matches an existing agent in database
  • Check API key has operator role or higher
  • Ensure heartbeat is sent within 60 seconds of registration
  • Review Mission Control logs for auth or validation errors