lightburn-mcp
Reads, renders, edits, and generates LightBurn .lbrn/.lbrn2 project files, including layer cut settings, embedded images and masks, text outlines, previews, diffs, material-test grids, and depth-map coin projects.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
lightburn-mcp
Read, render, edit and generate LightBurn project files (.lbrn / .lbrn2) from Python, from the command line, or from any AI agent that speaks the Model Context Protocol.
It grew out of galvo fiber-laser coin work, but the core works for any LightBurn project: CO₂, diode or galvo.
Not affiliated with LightBurn Software. LightBurn is a trademark of LightBurn Software, LLC. This project reads and writes LightBurn's file format for interoperability. It does not drive lasers or talk to the LightBurn application.

What it does
Inspect | Device and version info, every layer's cut settings (including sub-layers like 3D-slice cleanup passes), embedded images (pixels, physical mm, rotation, mask), text objects, bounding box |
Render | mm-accurate PNG previews: |
Diff | Compare two versions of a project: changed layer settings, shape counts, swapped images, edited text |
Edit | Change layer settings, swap an embedded image while keeping its placement and mask, add text as outlines |
Generate | Material-test grids (one layer per cell, labelled), and depth map → coin project in one step |
Round-trip safe | Edits mutate the XML in place, so anything not understood is preserved byte for byte. Writes never overwrite silently |
Depth map → coin project
The usual manual flow for a 3D-slice coin is: import the depth map, use LightBurn's image mask to trim it to a circle, apply the mask, scale it to the coin and move it onto the jig. lbrn coin / lbrn_coin_from_depthmap does all of that:
flowchart LR
A[depth map PNG] --> B[detect coin disc<br/>least-squares circle fit]
B --> C{crop}
C -- rim --> D[trim bright outer rim<br/>at its inner edge]
C -- edge --> E[keep full disc]
D --> F[bake circle at source resolution<br/>RGBA, anti-aliased, white under alpha]
E --> F
F --> G[scale to jig diameter<br/>centre on jig]
T[template .lbrn2<br/>layers + jig circle] --> G
G --> H[jig-ready .lbrn2]The template supplies the 3D-slice layer settings and the jig circle (the locked ellipse). A generic 35 mm template is bundled. Point --template at one of your own projects to use your jig and settings.
Material test grids

LightBurn settings are per layer, so each cell gets its own layer (29 cells max), with row and column labels engraved as outlines on layer 29. Copy device and UI preferences from one of your own projects with --template.
Related MCP server: inkscape-mcp
Install
Requires Python ≥ 3.11 and the Cairo library (for previews).
# system cairo: Arch: pacman -S cairo · Debian/Ubuntu: apt install libcairo2-dev pkg-config · macOS: brew install cairo
pip install git+https://github.com/rdominelli/lightburn-mcp
# or, from a clone:
uv venv && uv pip install -e '.[dev]'This installs two commands: lightburn-mcp (the MCP server, stdio) and lbrn (the CLI).
Text-to-outlines needs a TTF. It uses $LBRN_FONT if set, otherwise the first common bold sans it finds (DejaVu, Liberation, Arial), otherwise fc-match.
Use with an AI agent (MCP)
Claude Code
claude mcp add lightburn -- lightburn-mcpClaude Desktop / generic MCP client config
{
"mcpServers": {
"lightburn": { "command": "lightburn-mcp" }
}
}Hermes Agent
hermes mcp add lightburn --command lightburn-mcpThere's also an agent skill in skills/lightburn/SKILL.md that tells the agent how to use the tools well: verify previews, never overwrite, galvo parameter names, file-format gotchas. Install it the way your agent loads skills, e.g. copy the folder to ~/.claude/skills/ (Claude Code) or ~/.hermes/skills/ (Hermes).
Tools
Tool | Purpose |
| Find projects in a folder (device, version, size, layer/image counts); skips Syncthing conflict copies |
| Full summary of one project |
| PNG preview (returned as an image the model can see) |
| Compare two projects |
| Change cut settings, e.g. |
| Swap an embedded bitmap, keeping position, rotation and mask |
| Add text converted to curves |
| Generate a labelled test grid |
| Depth map → masked, jig-centred 3D-slice project |
| The file-format notes below, for the agent to read before hand-editing |
Every tool that writes needs either an output_path or overwrite=true. Overwriting always leaves a timestamped .bak next to the original.
Command line
lbrn inspect project.lbrn2
lbrn render project.lbrn2 --mode fill -o preview.png
lbrn diff Side1.lbrn2 Side1_v2.lbrn2
# depth map -> coin project on your own jig, with a preview PNG
lbrn coin depthmap.png -o coin.lbrn2 --template my_jig.lbrn2 --preview
lbrn coin depthmap.png --crop edge # keep the outer rim
lbrn coin depthmap.png --inset-px 6 # trim a little deeper
# 4 x 5 frequency x power grid around a known recipe
lbrn test-grid grid.lbrn2 --rows frequency=30000,40000,50000,60000 --cols maxPower=30,40,50,60,70 \
--base '{"speed":1500,"QPulseWidth":13,"interval":0.01}' --template my_project.lbrn2Python
from lbrn.core import Project
from lbrn.render import render
p = Project("Side1.lbrn2")
print(p.summary()["layers"])
p.set_layer_param(0, "numPasses", 120)
p.save("Side1_120passes.lbrn2")
render(p, "preview.png", mode="fill")Making your own jig template
Any .lbrn2 works as a --template. Open a project that already burns correctly on your jig, delete the artwork, and keep:
a locked ellipse for the jig circle (its centre and diameter set the coin's placement and size)
an Image layer with your 3D-slice settings (and cleanup sub-layer if you use one)
Turn output off on the jig-circle layer unless you actually want it burned.
File format
LightBurn's format is plain XML but undocumented. docs/FORMAT.md records what this project relies on. The main gotchas:
coordinates are mm and Y-up;
XFormis a 6-value affine matrix.lbrn2paths use a compactVertList/PrimListencoding, and most paths share topology with an earlier path byPrimIDembedded bitmaps are stored bottom-up (vertically flipped) at a nominal 96 dpi; a bitmap with no data reuses an earlier one with the same
Fileimage masks link by
ShapeID/MaskID/UsedByIDtext carries LightBurn's own outlines in
BackupPath, so previews need no fonts
Status and limitations
Alpha. The reader and renderer were checked against ~100 real galvo projects from LightBurn 1.7 and 2.1. Every file parses, previews match LightBurn's embedded thumbnails, a load-and-save gives identical XML, and every path re-encodes losslessly.
Generated files (depth-map coins, material-test grids) open cleanly in LightBurn 1.7 (tested on Linux). Coin images land at exactly the jig diameter and centre: the crop snaps to whole pixels (≤ 0.5 px shift in the source), and LightBurn's own float32 noise in templates (e.g. 17.499998) is cleaned on write. Still, frame and test on scrap before a real burn.
Known gaps:
Editing existing text objects isn't supported (their saved outlines would go stale). Add new text as outlines instead.
Rounded-rectangle corners and per-shape setting overrides aren't rendered or modelled yet.
Only stored layer settings are handled. Device profiles,
.clbmaterial libraries and.lbartare out of scope for now.Previews are approximations. Always frame and test on scrap.
Issues and sample files that break it are very welcome. Please strip anything you don't want public.
Development
uv venv && uv pip install -e '.[dev]'
pytest # self-contained tests, synthetic fixtures
LBRN_CORPUS=~/laser/projects pytest tests/test_corpus.py # optional: regression over your own filesexamples/ holds a synthetic depth map and the projects generated from it.
Prior art
Thanks to tscircuit/lbrnts and OpenBurn, whose format notes were a useful starting point. This implementation was then checked independently against real files, which corrected several details (prim indices, shared PrimID topology, bitmap row order, data-less bitmap reuse).
License
MIT, see LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Laser cut files (SVG, DXF, PDF) from a prompt or a picture, plus SVG checks before you cut.
LLM chat, text tools, image generation, editing, batch image jobs, and asynchronous video generation
PDF and image tools for AI agents: compress, merge, split, OCR, sign. Runs locally, never uploads.
Image & PDF tools for AI agents: compress, convert, resize, PDF, AI vision, pipeline.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI agents to vectorize raster images and import vector files (PDF/AI/EPS), then inspect, edit, render, and optimize SVGs locally.6MIT
- AlicenseAqualityBmaintenanceEnables AI agents to inspect, edit, validate, render, and export SVG/Inkscape documents safely with reversible operations and risk-classed tools.8711MIT
- AlicenseNot gradedqualityDmaintenanceProvides tools and resources for interacting with xTool laser machines, enabling material settings recommendations, design generation, troubleshooting, and machine knowledge through natural language.4MIT
- AlicenseAqualityCmaintenanceEnables AI agents to create, inspect, render, and export 2D engineering drawings through DXF files, including entities, dimensions, hatches, splines, blocks, layers, PNG previews, and vector PDFs without needing a CAD GUI.11MIT