Skip to content

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.

RouteMethodDescription
/pingGETIdentity: { ok, mode, pid, version, activeScenario }.
/opsGETMetadata of the operations registry.
/invokePOST{ "name": "<operation>", "args": [...] }{ ok, result } (or error).
/eventsGETSSE with engine events: logs, status, docker, mock, metrics.
/mcpPOSTThe MCP server over Streamable HTTP (see MCP).
/shutdownPOSTOrdered 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.