MACP Control Plane — Integration Guide
Adding a Runtime Provider
- Implement the
RuntimeProviderinterface fromsrc/contracts/runtime.ts - Register it as a NestJS provider in
app.module.ts - Add it to
RuntimeProviderRegistryso it can be looked up bykind
Consuming SSE Streams
# Subscribe to live events
curl -N http://localhost:3001/runs/{id}/stream
# Events are sent as SSE with types:
# - snapshot: Full projected state
# - canonical_event: Individual eventUsing the Replay API
# Create replay descriptor
curl -X POST http://localhost:3001/runs/{id}/replay \
-H 'Content-Type: application/json' \
-d '{"mode": "timed", "speed": 2}'
# Stream replay
curl -N "http://localhost:3001/runs/{id}/replay/stream?mode=timed&speed=2"
# Get state at sequence
curl http://localhost:3001/runs/{id}/replay/state?seq=42Replay modes:
timed: Replays events with proportional timing (adjustable viaspeed)step: Emits all events immediately (for scrubber UIs)instant: Emits all events with no delay
Adding Coordination Modes
- Add proto definitions under
proto/macp/modes/{mode}/v1/ - Update
MESSAGE_TYPE_MAPinProtoRegistryService - Update
deriveEventType()inEventNormalizerServicefor new message types
Environment Variables
See .env.example for all configurable variables with descriptions and defaults.