Skip to main content
Glama
LightBurn MCP

LightBurn MCP

by DerChris2011

LightBurn MCP

Talk to your LightBurn project from Claude, Cursor, ChatGPT and any other MCP client.

Read the open project · explain and sanity-check cut settings · change them by sentence · apply materials from your library · drop AI-generated SVGs straight onto the workspace

npm CI License: MIT Node 20+ LightBurn 2.2+ MCP


LightBurn 2.2 ships a local REST API. This project wraps it as a Model Context Protocol server, so an AI assistant can work with the LightBurn window you have open — on your machine, with no account and no cloud in between.

You:     Layer C02 is 10 mm/s at 80 %. Is that plausible for 3 mm poplar on my 40 W CO2?
Claude:  (reads get_project, get_units, get_cut 2) …that will likely char the edges.
         Want me to set 15 mm/s / 65 % and 2 passes? Review it in LightBurn before you run.
You:     Yes.
Claude:  (update_cut) Done – speed 15, max_power 65, num_passes 2.
         Review these settings in LightBurn before running the job.

Table of contents

Related MCP server: Obsidian MCP Server

What it can do

Ask things like

🧭 Understand a project

"What's in my project, which layers are used, what machine is selected?"

🔍 Check cut settings

"Do any of my used layers look wrong for 3 mm plywood?"

✏️ Change settings by sentence

"Set the red layer to 300 mm/s, 20 % and 2 passes."

📚 Apply library materials

"Use my 3 mm acrylic cut setting on layer blue."

🎨 Import generated artwork

"Make an 80×50 mm name tag with rounded corners and put it at 100,100."

📡 Read machine state

position, job state and progress, overrides, jog settings, units

📷 Look through the camera

the assistant can view the camera overlay LightBurn has loaded

Works with LightBurn (port 19520) and MillMage (port 19521, untested so far).

What it cannot do

The LightBurn API deliberately has no machine control: no start, stop, pause, frame, jog or home. There is no shape editing, no layer assignment, no save, no export. Changing cut settings edits the project only — you review it in LightBurn and run the job. Every write tool says so in its result. Read SAFETY.md once.

Quick start

You need: LightBurn 2.2.00 or newer running on this computer, and Node.js 20+ (the LTS installer is fine). The package is published on npm as lightburn-mcp.

Start LightBurn, open a terminal (PowerShell on Windows, Terminal on macOS) and run:

npx lightburn-mcp setup

That uses the released package from npm. To run the latest commit on main instead: npx github:DerChris2011/Lightburn_MCP setup.

Setup walks you through four steps:

  1. Application – lightburn (default) or millmage.

  2. Capabilities – what the assistant may do. Default is all four:

    Capability

    Grants

    state

    read machine and job state

    project

    read project data — includes the camera overlay image

    upload

    import files into the project

    project_write

    change cut settings

  3. Pairing – LightBurn pops up a consent dialog naming LightBurn MCP and the capabilities. Approve it within 30 seconds. The secret is stored in your user profile and never leaves your machine.

  4. Clients – pick the MCP clients to configure. Their config files are updated with a backup kept next to them. Restart the client and you're done.

The first npx run downloads the package from npm (a few seconds; the GitHub variant clones and builds it instead, about a minute). After that your clients start the server directly, in well under a second.

Check anytime:

npx lightburn-mcp status
Product:      lightburn
Host:         localhost:19520
Reachable:    yes
Paired:       yes (secret source: file)
Capabilities: state, project, upload, project_write

Connect your client

setup does this for you. To (re)do a single client:

npx lightburn-mcp config <client> --write

Client

<client>

Notes

Claude Desktop

claude-desktop

restart Claude Desktop afterwards

Claude Code

claude-code

prints the claude mcp add … command (setup runs it when the CLI is installed)

Cursor

cursor

Windsurf

windsurf

VS Code (Copilot)

vscode

user-level mcp.json

Gemini CLI

gemini-cli

Anything else (stdio)

—

config cursor prints the exact command and args to paste

Full JSON for every client, Windows and macOS, is in docs/clients.md.

ChatGPT and other URL-based clients

ChatGPT adds MCP servers as connectors and only accepts a public HTTPS URL — it cannot start a local process and rejects localhost. For that the server has an HTTP mode that always requires an access token:

npx lightburn-mcp --http
# LightBurn MCP listening on http://127.0.0.1:3917/mcp
# Token required: header "Authorization: Bearer <token>" or URL http://127.0.0.1:3917/mcp/<token>

Clients that can send headers use the bearer header (Claude Code: claude mcp add --transport http lightburn http://127.0.0.1:3917/mcp --header "Authorization: Bearer <token>"). ChatGPT can't, so put the token in the URL and a tunnel in front:

ngrok http 3917            # or: cloudflared tunnel --url http://127.0.0.1:3917

Add https://<your-tunnel-host>/mcp/<token> as a custom connector in ChatGPT (Settings → Connectors, Developer Mode, eligible plans only). Show the token with lightburn-mcp token, rotate it with lightburn-mcp token --rotate.

⚠️ The tunnel URL is a secret. Anyone who has it can read your project and change cut settings. Stop the tunnel when you're done. LightBurn Software does not endorse remote machine operation — see SAFETY.md.

Example prompts

  • "Summarise my current LightBurn project: layers in use and their settings."

  • "Compare every used layer against my material library and tell me which ones differ."

  • "Set every layer that is in use to 2 passes."

  • "Apply the Plywood 3 mm entry from my library to layer 2."

  • "Create a 60 mm circle with the text Workshop inside as SVG and import it at 50,50, top-left origin, grouped."

  • "Is the machine connected, and what are the current speed and power overrides?"

  • "Show me the camera overlay and tell me where the material is."

Tools

Tool

Capability

What it does

pair

—

Pair with LightBurn (consent dialog); stores the secret

connection_info

—

Product, host, port, paired?, capabilities, reachable?

get_status

state

Device name, connected flag, supports_z / overrides

get_position

state

Machine and workpiece coordinates (mm)

get_units

state

Display units for speed and distance

get_jog_settings

state

Jog distance / speed settings

get_saved_positions

state

Saved positions from the device profile

get_state_snapshot

state

Position, job, overrides, aux, connection in one call

get_project

project

Filename, shape count, workspace, device and laser capabilities

get_layers

project

Layer definitions (in-use only by default)

get_cuts

project

Cut settings (compact, in-use only by default)

get_cut

project

One cut entry with every field

get_material_library

project

The loaded material library

get_camera_overlay_metadata

project

Overlay size, placement, revision

get_camera_overlay

project

The camera overlay as a PNG image

update_cut

project_write

Partial update of one cut entry (one undo step in LightBurn)

apply_material_to_cut

project + project_write

Copy a library entry onto a cut; refuses ambiguous matches

upload_file

upload (+ state)

Import a file or generated content, with placement (x, y, origin, grouping)

open_file

upload (+ state)

Replace the project with a file

Values follow LightBurn's display units (get_units). Every write tool ends with "Review these settings in LightBurn before running the job."

Built-in LightBurn knowledge

Tools alone make an assistant guess. The server therefore also ships what it should know, so answers are grounded in how LightBurn and your laser actually work:

  • Server instructions every client receives on connect: read units first, use the cuts' in_use, read a cut before changing it, set override_frequency with frequency, treat Ruida's connected: false as normal, always end a change with the review reminder.

  • Six knowledge resources (lightburn://knowledge/…) the assistant can read on demand: API rules and pitfalls · cut settings explained (modes, sub-layers, min/max power, kerf, interval/DPI, dither modes) · laser types (diode, CO2, Q-switched fiber, MOPA fiber with pulse width, UV, dual-source) · galvo specifics (frequency, timing constants, jump settings, wobble, deep engraving, annealing, colour marking) · gantry specifics (power ramping, air assist, PPI, lead-in, cut-through, overcut) · workflows (summarise, review, change, apply material, SVG import with mm units and the colour-to-layer palette).

  • Three prompts your client can offer as one-click actions: summarize_project, review_cut_settings (with material and goal), prepare_import (description and position).

The knowledge gives orders of magnitude for plausibility checks, not recipes. It tells the assistant to prefer your material library and existing layers over any table, and never to present a value as correct for your machine.

How it works

flowchart LR
    subgraph Your computer
        Client["MCP client<br/>(Claude Desktop, Cursor, …)"]
        Server["lightburn-mcp<br/>stdio or HTTP"]
        LB["LightBurn 2.2<br/>REST API :19520"]
        Client -- "MCP (stdio)" --> Server
        Server -- "HTTP + HMAC bearer token" --> LB
        LB -- "consent dialog once" --> You((You))
    end
    ChatGPT["ChatGPT / URL clients"] -- "HTTPS tunnel + token" --> Server
  • Pairing calls POST /api/connect; LightBurn shows the consent dialog and returns a secret. The server stores it in %APPDATA%\lightburn-mcp\config.json (Windows) or ~/Library/Application Support/lightburn-mcp/config.json (macOS).

  • Every request carries hex(HMAC-SHA256(secret, floor(unix_time / 60))) as a bearer token, exactly as the API specifies. A rejected token is retried once, then the tool asks you to re-pair.

  • Imports open LightBurn's event stream before sending the file, so the file_imported result is reported back instead of a bare "accepted".

  • Nothing is cached: every tool call reads live from LightBurn.

Environment variables override the stored config for advanced setups — for example a server on another machine using a secret copied from Manage API Security in LightBurn: LIGHTBURN_SECRET, LIGHTBURN_HOST, LIGHTBURN_PRODUCT, LIGHTBURN_MCP_CONFIG_DIR.

CLI reference

lightburn-mcp                      Start the MCP server on stdio
lightburn-mcp --http [--port N] [--host H] [--token T]
                                   Start over Streamable HTTP (token always required)
lightburn-mcp setup                Interactive: pair + configure clients
lightburn-mcp pair [--capabilities state,project,upload,project_write]
lightburn-mcp status               Pairing state, reachability
lightburn-mcp config <client> [--write]
lightburn-mcp token [--rotate]     Show or rotate the HTTP access token
lightburn-mcp --version | --help

(npx lightburn-mcp <command> works without installing; npm install -g lightburn-mcp gives you the lightburn-mcp command.)

Troubleshooting

Symptom

What's going on

LightBurn does not appear to be running

LightBurn must be open. It serves the API on port 19520 (MillMage 19521); the port can't be changed.

LightBurn rejected the token / 401

The pairing was revoked, lacks the capability, or belongs to another LightBurn window. Run pair again. With several windows open, the most recently focused one serves the API.

Pairing times out

The consent dialog is in LightBurn's main window and closes after 30 s. Bring LightBurn to the front and run pair again.

The cut settings editor is open

Close the Cut Settings Editor window in LightBurn and retry.

Server stopped starting after a Node upgrade or npm cache clean

Client configs point at the Node binary and package folder found during setup (GUI apps have no PATH). Re-run config <client> --write, or install globally and use lightburn-mcp as the command.

Running the server on another machine

Pair on the LightBurn machine, enable Settings → Extensions → Allow API Access From Network, copy the secret via Manage API Security → Show Secret…, start the server with LIGHTBURN_SECRET=… LIGHTBURN_HOST=<ip>. Windows may ask once for a firewall rule.

connected: false although the laser is on

Normal on Ruida and similar controllers: the link is opened only during transfers. It is not a fault.

Safety

Cut settings control laser power, speed and passes. Review every setting the assistant touched in LightBurn before you press Start. The API cannot start or stop a machine, this server adds no such ability, and it is not a safety system. LightBurn Software does not endorse remote or unattended operation. Details in SAFETY.md.

Development

git clone https://github.com/DerChris2011/Lightburn_MCP.git
cd Lightburn_MCP
npm install
npm test            # tests against an in-process mock of the LightBurn API
node scripts/mcpcall.mjs '[["get_status"],["get_cut",{"index":0}]]'   # call tools of the built server from the shell
npm run build
node dist/index.js --help

TypeScript, @modelcontextprotocol/sdk, zod, express; tests with Vitest. CI runs on Windows and macOS. The design document and implementation plan live in docs/superpowers/. Issues and pull requests are welcome.

License

MIT © DerChris2011. The LightBurn / MillMage API is governed by LightBurn Software's API EULA. This project is not affiliated with or endorsed by LightBurn Software.

Available Tools

19 tools
apply_material_to_cutA

Requires capabilities "project" and "project_write". Copies a material library entry (mode and base-layer params, plus sub-layer values for sub-layers the target cut already has) onto a cut entry. Select the entry by entry_guid, or by material name (case-insensitive) and optional thickness. Refuses when several entries match, when the entry has more sub-layers than the target, or when kinds differ. A machine block (galvo/gantry) that does not match the target profile is skipped and reported.

Inputs: index (required), material, thickness, entry_guid.

connection_infoA

Shows how this server is configured: product, host, port, whether it is paired, granted capabilities, and whether LightBurn is reachable right now. Never reveals the secret.

Inputs: no named parameters.

get_camera_overlayA

Requires capability "project". The camera overlay currently drawn on the workspace as a PNG image, plus its metadata. Returns what LightBurn already has in memory; it never triggers a new capture. LightBurn only.

Inputs: no named parameters.

get_camera_overlay_metadataA

Requires capability "project". Size, workspace placement (mm) and a revision token of the camera overlay, without transferring the image. LightBurn only; 404 when no overlay is loaded.

Inputs: no named parameters.

get_cutA

Requires capability "project". One cut entry with every field, by the flat index from get_cuts. For LightBurn normal cuts, params contains exactly one machine block (params.galvo or params.gantry) matching the entry's profile.

Inputs: index (required).

get_cutsA

Requires capability "project". Cut settings of the project. LightBurn returns a fixed list: 30 cut layers, 2 tool layers, 1 internal entry, then 30 image cuts; MillMage returns its operation list. Each entry's index is the value to pass to get_cut / update_cut. Compact mode returns the core fields only (speed, min/max power, passes, mode, profile); use compact=false or get_cut for every field. Values use the user's display units (see get_units).

Inputs: compact, in_use_only.

get_jog_settingsA

Requires capability "state". Current jog distance and speed settings in display units.

Inputs: no named parameters.

get_layersA

Requires capability "project". All 32 layer definitions (index, name, color as #RRGGBB, type, hidden, in_use, shape_count) and the active layer index. By default only layers in use are returned.

Inputs: in_use_only.

get_material_libraryA

Requires capability "project". The currently loaded material library (LightBurn: flat entries with material, thickness, description, guid and a full cut setting; MillMage: operations library trees).

Inputs: no named parameters.

get_positionA

Requires capability "state". Current machine and workpiece coordinates, always in mm. Axes the controller does not report are omitted.

Inputs: no named parameters.

get_projectA

Requires capability "project". Metadata of the open project: filename, modified flag, shape count, display units, workspace size in mm and the selected device including laser source capabilities (device.laser.controller tells which controller is attached).

Inputs: no named parameters.

get_saved_positionsB

Requires capability "state". Saved positions from the device profile.

Inputs: no named parameters.

get_state_snapshotA

Requires capability "state". Latest state snapshot in one call: position, job state and progress, speed/power overrides, aux state, connection and jog settings. On Ruida controllers job.state is always idle and progress is never reported.

Inputs: no named parameters.

get_statusA

Requires capability "state". Connection status and device capabilities of the selected device profile (device_name, connected, supports_z, supports_overrides).

Inputs: no named parameters.

get_unitsA

Requires capability "state". The user's display units: units is the speed unit (mm/s, mm/min, in/s, in/min), distance_units the distance unit (mm, in). They are independent; never infer one from the other.

Inputs: no named parameters.

open_fileA

Requires capability "upload" (plus "state" for confirmation). REPLACES the current project with the file, like File > Open; LightBurn prompts the user to save unsaved changes first. Send a local file via path, or content / content_base64 with a filename. LightBurn confirms success reliably only for native projects (.lbrn, .lbrn2, .mage); for other formats this tool reads the project afterwards and reports it as opened_unconfirmed.

Inputs: path, content, filename, wait_seconds, +1 more.

pairA

Pairs this server with the running LightBurn / MillMage on this machine. LightBurn shows a consent dialog naming the application and the requested capabilities; the user must approve it within 30 seconds. The secret is stored in the per-user config and never returned. Capabilities are fixed for the life of the pairing; call pair again to change them. Note that "project" includes the camera overlay image.

Inputs: capabilities, application_name.

update_cutA

Requires capability "project_write". Partial update of one cut entry (LightBurn layer or MillMage operation) by its flat index from get_cuts. Only the fields in changes are modified; LightBurn validates the whole body first and changes nothing on error. Editable on LightBurn normal cuts: name, enabled, mode (cut|scan|offset), params (any LaserCutParams field such as speed, min_power, max_power, num_passes, frequency, interval, kerf, z_offset), params.galvo or params.gantry (must match the entry's profile), negative, pass_through, enable_cleanup, sort_within_layer, tabs, global_passes (galvo only), and existing sub_layers addressed by index. Image cuts: name, enabled, params.speed, params.max_power, params.dither_mode. MillMage: name, enabled, any settings key. Set params.override_frequency=true together with params.frequency, otherwise the frequency has no effect. Powers are 0-100. Values use the user's display units (see get_units). The change is one undo step in LightBurn; the operator must review before running.

Inputs: index (required), changes (required).

upload_fileA

Requires capability "upload" (plus "state" for import confirmation). Imports a file into the CURRENT project (merge), like File > Import. Supported: .svg, .dxf, .ai, .pdf, .lbrn/.lbrn2, .png/.jpg/.bmp and other formats LightBurn can import. Send a local file via path, or generated content via content (text such as SVG) or content_base64. Optionally anchor the import at workspace coordinates x/y in mm (workpiece origin) with origin naming which point of the bounding box sits at the anchor (default center); without x/y it lands at the current view center. Waits up to wait_seconds for LightBurn's file_imported event and reports the outcome.

Inputs: x, y, path, origin, +5 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 19 tools

    Disambiguation4/5

    Tools target distinct resource+action pairs: get_cuts vs get_cut (list vs single), get_position vs get_jog_settings vs get_saved_positions, and get_camera_overlay vs its metadata variant are clearly delineated. Minor overlap exists between the state readers (get_position, get_units, get_jog_settings are all subsumed by get_state_snapshot) and among get_status/connection_info/get_state_snapshot, but descriptions disambiguate them.

    Naming Consistency4/5

    Strong get_/update_/apply_/upload_/open_ verb_noun pattern throughout, with clean noun suffixes distinguishing variants (_metadata, _snapshot, _settings). The bare 'pair' and noun-phrase 'connection_info' are minor deviations but still readable and unambiguous.

    Tool Count4/5

    19 tools is slightly above the ideal range but each earns its place in a genuinely layered domain (state reads, cut editing, material library, camera overlay, file import, pairing). No obvious redundant bloat; the granular state getters are defensible as lightweight alternatives to the full snapshot.

    Completeness3/5

    Cut handling has read and update but no create/delete or add-layer operation, and there is no jog/move command or job control (start/pause/stop) despite get_jog_settings and job-state reporting — notable gaps for a laser-control surface. The read/derive side and file/camera operations are otherwise well covered.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI assistants to discover, connect to, and control LightWave3D Modeler and Layout programmatically via the Command Port.
      4
      Apache 2.0
    • A
      license
      A
      quality
      D
      maintenance
      Enables AI assistants to read, write, and manage Obsidian notes, folders, and periodic notes via the Local REST API, including search and command execution.
      14
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI assistants to read and create geometry in an open Cadwork 3D document via a local bridge, with queued sequential execution, write approvals, undo support, and a live dashboard for monitoring activity.
      15
      1
      AGPL 3.0
    • A
      license
      A
      quality
      C
      maintenance
      Lets an AI agent read and edit the Inkscape document you have open in your own window, with millimetre-exact positioning measured on live visual bounding boxes. A revision guard blocks stale edits and every change is verified as landed, all on Inkscape's normal undo stack.
      24
      MIT