AI Assistants & MCP
If you write code with an AI agent looking over your shoulder, you can give it the toolchain directly. rnx mcp serves the compiler over the Model Context Protocol on stdio, so an agent can check, run, format, test, and explain rnx code without shelling out. Eighteen tools: check (structured JSON, pretty opt-in), run (interpreter, 30s cap, structured output), fmt (plus --check/--diff modes), explain, version, rasmalai_lookup_symbol (@std/* signature search), inspect_package_capabilities (package audit with licenses, drift, and advisory verdicts), eval_code (persistent JIT session with :type and reset), get_diagnostics (structured JSON diagnostics), hot_reload (needs an attached rnx dev --mcp watcher), build (LLVM object, in memory), test (project test runner), lint (read-only), doc (--json API docs), doctor (read-only cache health), cache_status (read-only pool sizes), package_resolve (offline cache verdicts), and ui_drive (run a semicolon UI script against an app, assert controls, drag/fling/scroll through real controls, return a shot: PNG as an inline image block, and compare it against a golden baseline). path inputs resolve project-aware, so relative imports work; source snippets stay self-contained. Stdout carries protocol frames only.
Pick your harness below. Every entry follows the same trio (rnx on PATH, a server entry with command/args, and one command to verify). Then a manual section covers anything else.
Agents typically start by typechecking a snippet like this one through the check tool before touching your files:
let total = [10, 20, 30].reduce(0, (acc, n) => acc + n);
assert(total == 60, "sum");Claude Code & Desktop
Claude Code registers from the terminal:
claude mcp add rnx -- rnx mcpVerify with /mcp inside a session; the rnx server lists eighteen tools.
Claude Desktop takes the same server in its JSON config. macOS ~/Library/Application Support/Claude/claude_desktop_config.json (Windows %APPDATA%\Claude\, Linux ~/.config/Claude):
{
"mcpServers": {
"rnx": { "command": "rnx", "args": ["mcp"] }
}
}Restart Desktop after editing.
Codex
Codex CLI reads ~/.codex/config.toml:
[mcp_servers.rnx]
command = "rnx"
args = ["mcp"]
Cursor
Project file .cursor/mcp.json (global: Cursor Settings -> MCP -> Add):
{
"mcpServers": {
"rnx": { "command": "rnx", "args": ["mcp"] }
}
}
Pi
Global ~/.pi/agent/mcp.json, or .mcp.json in a trusted project:
{
"mcpServers": {
"rnx": { "command": "rnx", "args": ["mcp"] }
}
}Reload with /mcp reload.
omp
Project .omp/mcp.json, or user ~/.omp/mcp.json (/mcp add walks you through it, /mcp test rnx checks the connection):
{
"mcpServers": {
"rnx": { "type": "stdio", "command": "rnx", "args": ["mcp"] }
}
}
opencode
opencode.json in the project (or ~/.config/opencode/opencode.json globally):
{
"mcp": {
"rnx": { "type": "local", "command": ["rnx", "mcp"] }
}
}
Hermes agent
~/.hermes/config.yaml under the top-level mcp_servers key (that key name is load-bearing. mcp: servers: will not load):
mcp_servers:
rnx:
command: "rnx"
args: ["mcp"]Test with hermes mcp test rnx, then /reload-mcp in a live session.
Cline
Open Cline: Open MCP Settings from the VS Code command palette (cline_mcp_settings.json), then add:
{
"mcpServers": {
"rnx": { "command": "rnx", "args": ["mcp"] }
}
}
Goose
~/.config/goose/config.yaml (or goose configure -> Extensions -> Add extension):
extensions:
- name: "rnx"
enabled: true
transport:
type: "stdio"
command: "rnx"
args: ["mcp"]Manual setup for the rest
Any harness that spawns a stdio MCP server needs exactly three things: the rnx binary on PATH, command set to rnx with args set to ["mcp"], and a clean stdout (the server reserves it for protocol frames; logs go to stderr). Verify by hand before blaming the harness:
printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"t","version":"0"}}}' '{"jsonrpc":"2.0","method":"notifications/initialized"}' '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}' | rnx mcpExpect serverInfo.name of rnx-mcp and seventeen tools. If a harness rejects the server, check that it passes through env/cwd untouched and that no wrapper writes banners to stdout.
Treat rnx mcp as local-trust software: run executes the code it is given with your user privileges, capped at 30 seconds per call; a timed-out worker blocks further run/build calls until it exits. Publishing, dependency mutation, and dev-watcher spawning are intentionally unavailable over MCP; use the rnx CLI for those. The full tool table and protocol notes live in the CLI reference.