CNCjs MCP Server
The CNCjs MCP Server bridges Claude Code to CNCjs for controlling GRBL-based CNC machines, covering machine monitoring, connection management, motion control, job execution, and design/G-code generation.
Machine Control & Monitoring
List serial ports, connect/disconnect (specify port, baud rate, controller type)
Query machine state, positions (machine & work coordinates), work offsets, GRBL settings, parser state, job progress, workflow state, feeder status, alarms, and console output
Send raw G-code commands, load G-code files, and analyze G-code
Start, pause, resume, and stop jobs
Home the machine, unlock alarms, jog axes incrementally
Set feed rate and spindle speed overrides (10–200%), set work zero, control spindle/coolant, set WCS, and run Z probing
List and execute CNCjs macros; list machine profiles with travel limits
Safety Operations
Emergency stop (GRBL soft reset), feed hold, and jog cancel
G-code Generation
Generate G-code for 2D profiles, rectangular/circular pockets, drilling patterns, and surface facing/leveling
Design File & CAD/CAM Integration
Create SVG and DXF R12 files for import into CAM software
Generate Fusion 360 Python API scripts (sketch, extrude, revolve, CAM setup)
Generate FreeCAD Python scripts for 3D modeling and CAM toolpaths
Generate Adobe Illustrator ExtendScript (.jsx) for vector artwork and batch export
Marketplace & Packaging
Bundle designs into packages with multiple formats, previews, and metadata
Generate SEO-optimized listing descriptions for platforms like Etsy, Cults3D, or Gumroad
Convert between design formats (SVG↔DXF, G-code→SVG preview)
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@CNCjs MCP Server Home the machine and report the current work coordinates"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
CNCjs MCP Server
MCP server bridging Claude Code to CNCjs for GRBL CNC control (FoxAlien XE Ultra).
Architecture
Claude Code ←stdio/MCP→ cncjs-mcp (Node.js) ←Socket.IO v1→ CNCjs :8000 ←USB Serial→ GRBLRelated MCP server: MCP 3D Printer Server
Tools (56 total)
Read-Only / Query (17)
list_serial_ports, get_connection_status, get_machine_state, get_machine_position, get_work_coordinate_offset, get_machine_settings, get_parser_state, get_loaded_gcode, get_job_progress, get_workflow_state, get_feeder_status, list_macros, list_machines, get_alarm_info, get_console_output, get_error_info, analyze_gcode
Connection (2)
connect_to_port, disconnect_port
Control (16)
send_gcode, load_gcode, start_job, pause_job, resume_job, stop_job, home_machine, unlock_machine, jog, set_feed_override, set_spindle_override, set_work_zero, spindle_control, coolant_control, set_wcs, probe_z
Safety (3)
emergency_stop (soft reset 0x18), feed_hold, jog_cancel
Management (1)
run_macro
G-code Generation (4)
generate_gcode_profile — cut 2D shapes (circle, rectangle, custom path)
generate_gcode_pocket — clear rectangular or circular pockets
generate_gcode_drill — drilling patterns (grid, circle, custom) with peck support
generate_gcode_facing — surface facing/leveling
Design File Generation (2)
generate_svg — create SVG files for import into Carveco/Fusion 360
generate_dxf — create DXF R12 files for CAM software import
Fusion 360 Integration (2)
generate_fusion_script — generate Python API scripts for Fusion 360 (sketch, extrude, revolve, fillet, chamfer, export, CAM setup)
list_fusion_scripts — list previously generated scripts
FreeCAD Integration (3)
generate_freecad_model — generate Python scripts for headless 3D modeling (box, cylinder, sphere, cone, sketch, extrude, boolean ops, export STEP/STL)
generate_freecad_cam — generate CAM toolpath scripts with G-code export (profile, pocket, drill, face operations)
list_freecad_scripts — list previously generated FreeCAD scripts
Adobe Illustrator Integration (3)
generate_illustrator_script — generate ExtendScript (.jsx) for vector artwork (rectangle, circle, polygon, star, text, paths, export to SVG/DXF/PDF)
generate_illustrator_export_script — batch export current document to SVG/DXF/PDF/EPS with text-to-outlines option
list_illustrator_scripts — list previously generated Illustrator scripts
Marketplace & Packaging (3)
package_design — bundle designs into marketplace-ready packages (multi-format files, preview images, README, listing metadata, zip archive)
generate_listing_description — generate SEO-optimized listing descriptions for Etsy, Cults3D, or Gumroad
convert_design_format — convert between formats (SVG↔DXF, G-code→SVG preview)
Windows PC Setup for CNCjs
Node.js (LTS recommended, v18+) — download from https://nodejs.org
CNCjs — install via npm after Node.js is set up:
npm install -g cncjsOr download the desktop app installer from the CNCjs GitHub releases page.
USB/Serial driver for your FoxAlien XE Ultra — likely one of:
CH340 driver (most common on FoxAlien boards) — download from the manufacturer site
CP210x driver (if it uses a SiLabs chip)
Windows 10/11 may auto-install these, but if your board doesn't show up in Device Manager under "Ports (COM & LPT)", install the driver manually
Quick start after install:
cncjsThen open http://localhost:8000 in your browser. Your FoxAlien will show up as a COM port (e.g., COM3). Select it, set baud rate to 115200, controller type Grbl, and connect.
Optional but recommended:
Chrome/Edge — CNCjs web UI works best in Chromium browsers
Python (sometimes needed for
node-gypnative module builds during npm install)
MCP Server Setup
npm install
npm run buildRegister with Claude Code:
claude mcp add cncjs-mcp node /path/to/cncjs-mcp/build/index.jsEnvironment Variables
CNCJS_URL— CNCjs server URL (default:http://localhost:8000)CNCJS_TOKEN— Optional JWT token for CNCjs authentication
Available Tools
30 toolsconnect_to_portC
Open a serial connection to a CNC controller
Inputs: port (required), baudrate, controllerType.
disconnect_portA
Close the current serial connection
Inputs: no named parameters.
emergency_stopA
EMERGENCY STOP — immediately halts all motion via GRBL soft reset (0x18). Use in any dangerous situation.
Inputs: no named parameters.
feed_holdA
Feed hold — controlled deceleration to stop. Safer than emergency stop for non-critical situations.
Inputs: no named parameters.
get_alarm_infoB
Get current alarm code and human-readable meaning
Inputs: no named parameters.
get_connection_statusB
Get current CNCjs connection status
Inputs: no named parameters.
get_feeder_statusB
Get feeder queue depth, hold state, and reason
Inputs: no named parameters.
get_job_progressB
Get current job progress (lines sent, elapsed time, % complete)
Inputs: no named parameters.
get_loaded_gcodeB
Get currently loaded G-code file name and content
Inputs: no named parameters.
get_machine_positionB
Get current machine and work positions (X, Y, Z)
Inputs: no named parameters.
get_machine_settingsB
Get all GRBL $$ machine settings with labels
Inputs: no named parameters.
get_machine_stateA
Get full GRBL machine state (positions, feed, spindle, overrides, buffer)
Inputs: no named parameters.
get_parser_stateB
Get active G-code parser state (WCS, units, distance mode, etc.)
Inputs: no named parameters.
get_work_coordinate_offsetC
Get work coordinate offset (WCO) values
Inputs: no named parameters.
get_workflow_stateB
Get workflow state (idle, running, paused)
Inputs: no named parameters.
home_machineA
Run GRBL homing cycle ($H). Machine must have homing switches enabled.
Inputs: no named parameters.
jogA
Jog the machine incrementally. HIGH RISK — causes physical motion.
Inputs: axis (required), distance (required), feedrate (required).
list_machinesB
List machine profiles with travel limits
Inputs: no named parameters.
list_macrosB
List all CNCjs macros (name, id, content)
Inputs: no named parameters.
list_serial_portsB
List available serial ports
Inputs: no named parameters.
load_gcodeC
Load G-code content into CNCjs for execution
Inputs: name (required), content (required).
pause_jobA
Pause the current job (feed hold + pause sender)
Inputs: no named parameters.
resume_jobB
Resume a paused job
Inputs: no named parameters.
run_macroA
Execute a CNCjs macro by name or ID. HIGH RISK — macro content may cause motion.
Inputs: identifier (required).
send_gcodeA
Send one or more G-code lines to the machine. HIGH RISK — causes physical motion.
Inputs: gcode (required).
set_feed_overrideC
Adjust feed rate override (10-200%)
Inputs: value (required).
set_spindle_overrideC
Adjust spindle speed override (10-200%)
Inputs: value (required).
start_jobB
Start executing the loaded G-code program
Inputs: no named parameters.
stop_jobC
Stop the current job
Inputs: force.
unlock_machineA
Clear GRBL alarm state ($X). Use after resolving the cause of the alarm.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 30 tools
Most tools are clearly distinct (e.g., get_machine_state vs get_machine_position vs get_parser_state), but some overlap exists: get_machine_state, get_workflow_state, and get_connection_status all report status-like information, and get_loaded_gcode vs load_gcode could be confused at a glance. Descriptions help disambiguate, but a few boundaries are fuzzy.
The set predominantly follows a verb_noun pattern (list_, get_, set_, start_, pause_, resume_, stop_, home_, unlock_, jog, send_, load_, connect_, disconnect_). Minor deviations: 'jog' is a bare verb, and 'emergency_stop'/'feed_hold' are noun-ish verbs, but overall the pattern is consistent and predictable.
30 tools is on the heavy side for a CNC control server, but the domain is broad (machine control, G-code management, job lifecycle, macros, serial ports, overrides). Each tool maps to a real operation, though some could be consolidated (e.g., get_machine_state already includes positions, making get_machine_position partially redundant).
The surface covers the core CNC workflow well: connection, machine state, G-code loading, job control, homing, unlocking, overrides, and macros. Minor gaps include no tool for writing/saving macros, no spindle control (only override), and no coolant control, but these are not critical for basic operation.
Maintenance
Related MCP Connectors
Manage your IoT device fleet directly from Claude. Create device templates with datastreams and events, provision new devices, read live sensor data, and control outputs. The Blynk connector integrates with the Blynk IoT platform, enabling direct configuration and monitoring of connected devices and infrastructure.
Connect Claude to your Platform7n workspaces: chat, links, work and decks. One-click OAuth.
1Connect Claude to your Platform7n workspaces: chat, links, work and decks. One-click OAuth.
Work on your own computers from Claude or ChatGPT: run commands, edit and search files.
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that enables Claude to control CNC routers running FluidNC firmware using natural language. It provides 27 tools for monitoring status, jogging axes, executing G-code, and managing SD card files and machine configurations.27MIT
- AlicenseNot gradedqualityDmaintenanceEnables users to connect Claude with various 3D printer management systems, allowing tasks like printer status monitoring, file management, print job control, and STL file manipulation.9,494 npmGPL 2.0
- AlicenseAqualityDmaintenanceMCP server for controlling CNC machines via Universal GCode Sender. Lets Claude (or any MCP-compatible AI assistant) connect to a CNC machine, inspect G-code, and issue motion commands — all through the UGS Pendant REST API.1951 PyPI6MIT
- AlicenseNot gradedqualityCmaintenanceEnables Claude Code to see and drive Bambu Lab 3D printers over the local network via MQTT, providing status, file management, print control, filament, maintenance, and diagnosis without any cloud dependency.MIT