10 min read

Building on Mission Control

Extending Mission Control

Mission Control’s REST API, SSE stream, and webhook system are the foundation for building custom integrations. Whether you’re wiring it into a CI/CD pipeline, building a Slack bot that reports agent activity, or creating a custom agent that Mission Control can orchestrate, the building blocks are all there.

Common Integration Patterns

CI/CD Integration — Trigger Mission Control task dispatch from your CI pipeline after a pull request is opened. For example, dispatch a code review task to a Claude Code agent automatically when a PR targets the main branch. Listen to the SSE stream for the completion event and post the review summary back to GitHub.

Slack / Notification Bridge — Subscribe to the SSE endpoint from a small server process. When high-priority tasks complete or fail, forward the event to Slack, PagerDuty, or whatever notification system your team uses.

Custom Dashboards — Use the REST API to pull task and agent data into your own analytics dashboards. Track cycle times, failure rates, and agent utilization across your team.

Batch Automation Scripts — Write scripts that create dozens of tasks from a structured input (like a CSV or JSON file), dispatch them all, poll for completion, and aggregate results. Mission Control’s API makes this straightforward.

Building a Custom Agent

If you want to create an agent that Mission Control can dispatch to (beyond the three built-in providers), your agent needs to:

  1. Register itself via POST /api/agents with a name and capabilities
  2. Receive task dispatch requests at an endpoint you host
  3. Send progress callbacks to Mission Control’s webhook endpoint with valid HMAC signatures
  4. Send a completion or error callback when done

The OpenClaw Gateway protocol documentation describes the full payload schemas and authentication requirements for custom agents.

Using the API in Scripts

A minimal task creation and dispatch script:

# Create a task
TASK=$(curl -s -X POST http://localhost:4000/api/tasks \
  -H "Authorization: Bearer $MC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"title":"Review PR #42","description":"...","priority":"high"}')

TASK_ID=$(echo $TASK | jq -r '.id')

# Dispatch it
curl -s -X POST http://localhost:4000/api/tasks/$TASK_ID/dispatch \
  -H "Authorization: Bearer $MC_TOKEN" \
  -H "Content-Type: application/json" \
  -d "{\"agentId\":\"$AGENT_ID\"}"

Rate Limiting and Stability

When building integrations, treat Mission Control’s API as a local service. Avoid hammering it with high-frequency polling — use SSE for real-time updates instead. If you’re running large batch operations, add a small delay between requests to avoid overwhelming the SQLite write queue.