Kernel Protocol

rat communicates with kernel subprocesses over JSON lines on stdin/stdout. The full specification is in KERNEL-PROTOCOL.md.

MCP tools

Every kernel exposes exactly four MCP tools:

ToolWhat it does
runExecute code or provide input
lookInspect variables, complete code, see state
tailRecent activity log
ctlReset, cancel, restart

Wire format

The kernel reads JSON requests from stdin (one per line) and writes JSON responses to stdout (one per line). Stderr is reserved for the language runtime’s own diagnostics.

{"id":"1","method":"run","params":{"code":"x = 42"}}
{"id":"1","result":{"output":"","error":null}}

See the full KERNEL-PROTOCOL.md for request/response schemas, streaming, and error handling.