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:
| Tool | What it does |
|---|---|
run | Execute code or provide input |
look | Inspect variables, complete code, see state |
tail | Recent activity log |
ctl | Reset, 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.