← topics

--- title: Mission Control Architecture (v2) updated: 2026-06-11 ---

Mission Control Architecture (v2)

Overview

Mission Control (MC) provides a real-time dashboard for monitoring OpenClaw agent activity, session state, costs, and model health.

v2 redesign: MC now uses a database-backed backend instead of parsing JSONL files on every request. This eliminates the 40-80s startup hangs and crash loops.

Architecture

``` β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Browser UI │────▢│ mc-server.js │◄────│ MUE DB β”‚ β”‚ (port 5173) │◄────│ (port 5173) │────▢│ (mue.db) β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ Thin cache+proxy β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β–² β”‚ β”‚ β–Ό β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β” β”‚ MUE API β”‚ β”‚ mc-sync.py β”‚ β”‚ (port 7710) β”‚ β”‚ (cron 30min) β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ```

Components

mc-server.js (`ui/server.js`, ~400 lines)

mc-sync.py (`data/mc-sync.py`)

mc-query.py (`data/mc-query.py`)

mc-db-sync.sh

Database

All tables live in the shared MUE database: `projects/model-usage-engine/data/mue.db`

MC Tables (mc_ prefix)

TablePurposeSource

`mc_agents`Agent config + aggregated statsopenclaw.json + mc-sync.py
`mc_sessions`Session metadataJSONL files
`mc_events`Timeline eventsJSONL message parsing
`mc_scan_log`Sync audit trailmc-sync.py

Shared Tables

TablePurposeManaged By

`models`Model inventory + pricingMUE API
`usage`Raw usage recordsMUE API
`daily_usage_rollup`Aggregated daily usageMUE API
`daily_model_costs`Per-model daily costscosts_db.py

ER Diagram

The entity-relationship diagram is at: File

Purpose

`config.yaml`MC server settings (ports, intervals)
`data/mc-schema.sql`SQL schema for MC tables
`.mc-token`Auth token for MUE API

Service Management

ServiceMechanismRestartInterval

MC Serverlaunchd (`com.mc.ui`)KeepAlive=trueAlways
MC Watchdoglaunchd (`com.mc-watchdog`)120s check120s
DB SynccrontabEvery 30 min30 min
Heartbeatlaunchd (`com.randy.heartbeat-monitor`)60s check60s

Related