Control server (local HTTP API)
Whoever hosts the engine (the app or the daemon) publishes a local HTTP API in
.microlab/.runtime/control.json:
{ "pid": 123, "port": 49777, "token": "…", "mode": "daemon", "version": "0.1.0", "startedAt": "…" }The API lives at http://127.0.0.1:<port> and every request carries
Authorization: Bearer <token>. The port is ephemeral and the token changes on each
engine start: you have to re-read control.json on each connection.
Routes
Section titled “Routes”| Route | Method | Description |
|---|---|---|
/ping | GET | Identity: { ok, mode, pid, version, activeScenario }. |
/ops | GET | Metadata of the operations registry. |
/invoke | POST | { "name": "<operation>", "args": [...] } → { ok, result } (or error). |
/events | GET | SSE with engine events: logs, status, docker, mock, metrics. |
/mcp | POST | The MCP server over Streamable HTTP (see MCP). |
/shutdown | POST | Ordered shutdown; only the daemon honors it (the app responds 409). |
microlab is nothing more than a client of this API. Any local tool (another script, an
agent) can use it directly: GET /ops to discover the surface and POST /invoke to run
any operation, including those that don’t have their own command.