linuxcnc-mcp is an MCP server and Claude Code plugin built on this API. It lets Claude:
- monitor and diagnose a machine: status, a derived problem list, HAL pins, signals and params, and value watches;
- operate it, if you opt in: homing, capped incremental jogs, MDI, programs, overrides and files.
Claude Code ──MCP/stdio──▶ linuxcnc-mcp ──gRPC (SSH tunnel)──▶ linuxcnc-grpc ──▶ LinuxCNC + HALQuick start
- In Claude Code:
/plugin marketplace add dougcalobrisi/linuxcnc-mcp /plugin install linuxcnc@linuxcnc-mcp - Run
/linuxcnc:setup-server user@cnc-host. It installs this server on the machine with linuxcnc-mcp’sinstall-server.sh(a venv with--system-site-packages, started with LinuxCNC through a HALloadusrline or systemd) and sets up an SSH tunnel. - Ask Claude: “What’s the machine status?”
Safety model
- Read-only by default. Control tiers (
operate,full) are opt-in, and in Claude Code, by default, every control call asks for approval. - Software stops (
estop,abort,pause,jog_stop) bypass queued writes. The physical e-stop is still the only real e-stop. - This server has no authentication or TLS yet. Bind it to
127.0.0.1and use an SSH tunnel (see Server).
How linuxcnc-mcp uses this API
- Completion is detected by polling
GetStatus. It snapshotstask.echo_serial_numberbefore sending and waits for it to advance, never comparing it withCommandResponse.serial. It never callsWaitComplete. - Errors come from derived status by default (task, exec and interp state, joint faults, limits). StreamErrors is opt-in, because reading the NML error queue takes messages away from the GUI (see Error messages and the GUI).
- The HAL tools are read-only, as
HalServiceis.