Matrix logo

Daemon API

The per-user Matrix daemon (mcl-execute daemon) HTTP + SSE surface — chat, message submission, the events transcript stream, intent envelope chains, and identity.

The per-user daemon (mcl-execute daemon) is the runtime surface for a single user. It is single-flight: one user per process, and a concurrent POST /messages returns 409 Busy.

Auth: when started with MATRIX_DAEMON_TOKEN, all routes except /healthz require Authorization: Bearer <token>. In production the router terminates Supabase JWT auth and proxies here over the WireGuard mesh.

Routes

MethodPathPurpose
GET/healthzLiveness + SSE broker stats.
POST/chatConverse with the agent (Neo front door).
GET/eventsServer-Sent Events tail (live transcript).
POST/messagesSubmit a prose message (MCL rigorous rail).
GET/intents/{id}Read the intent envelope chain by ID.
GET/mePer-user settings + identity.
POST/shutdownGraceful drain.

Chat

messagestringrequired

The user's natural-language input for this turn.

curl -X POST http://localhost:8080/chat \
  -H "Authorization: Bearer $MATRIX_DAEMON_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"message": "Summarise the README and write it to /tmp/summary.md"}'

Events stream

GET /events is a Server-Sent Events stream of the live transcript: assistant narration (say), ephemeral progress (status), deliberate notices (notice), and tool activity. The broker uses per-subscriber buffered channels with drop-on-backpressure.

curl -N http://localhost:8080/events -H "Authorization: Bearer $MATRIX_DAEMON_TOKEN"

Intents

GET /intents/{id} returns the signed envelope chain for an intent — every lifecycle transition (drafting → … → completed/failed/cancelled), each an ed25519-signed envelope stored under journal/<intent_id>/<seq>-<kind>.json.

idstringrequired

The intent ID (also its content-addressed hash root).

envelopesarray

Ordered lifecycle envelopes, each with seq, kind, body, and signature.

Executor internals

How the daemon walks plans and attests outcomes.