Skip to main content
Glama
kerfkit-mcp

kerfkit-mcp

Official
by junixlabs

kerfkit

Laser cutting file checker and fixer: validate and repair SVG/DXF for laser cutters (open paths, double lines, tiny segments, kerf and slot fit), generate slot gauges and test sheets. CLI, Python, MCP server and Claude plugin.

CI License: MIT Python 3.10+ MCP server

Catch the problems that waste a sheet before you press start: a file that imports 33 % too small, an outline that is not closed, a line the laser cuts twice, slots drawn for 3.0 mm ply when yours measures 3.2. Then fix the safe ones automatically and work out the slot width for your sheet and kerf.

kerfkit check, fix and slot in a terminal

Before: kerfkit check finds 4 failures

After: kerfkit fix, re-checked: pass

a messy panel with an open hole, a double line, a stray node and pixel units

the same panel fixed: mm units, red hairline cuts, black engrave

Files: examples/messy-panel.svg → examples/messy-panel.fixed.svg

Install

pip install git+https://github.com/junixlabs/kerfkit           # CLI + Python
pip install "kerfkit[dxf] @ git+https://github.com/junixlabs/kerfkit"   # + DXF input

Or run it without installing anything permanent, with uv:

uvx --from git+https://github.com/junixlabs/kerfkit kerfkit check my-file.svg

Python 3.10+. Dependencies: numpy, shapely, svgpathtools (and ezdxf for DXF). Runs on CPU, no browser, no network.

Related MCP server: LazerMCP

30-second tour

kerfkit check panel.svg                            # every check, pass / warn / fail, locations in mm
kerfkit check panel.svg --thickness 3 --kerf 0.15  # + slot widths against your sheet
kerfkit fix panel.svg -o panel.fixed.svg           # safe repairs, clean mm SVG out
kerfkit slot --thickness 3.2 --kerf 0.15           # "Draw slots 3.050 mm wide"
kerfkit refit shelf.svg -o shelf.3.2.svg --thickness 3.2 --kerf 0.15
kerfkit testsheet -o test.svg --thickness 3        # slot gauge + key + kerf square
kerfkit kerf square 20.16 19.84                    # "kerf = 0.160 mm"

check exits 1 when anything fails, so it works as a pre-flight step in scripts and CI.

What it checks

Check

What it catches

units

width/height in px or missing (imports 75 % or 133 % off between 72 and 96 DPI apps), mismatched viewBox scale

layers

colour → layer mapping (red cut, blue score, black/blue fill engrave), filled or thick cut lines, lines named "engrave" but drawn in cut red. A per-colour table is in the JSON

text-outlined

live <text>, clones (<use>), embedded objects; raster images

tiny-strays

paths shorter than 0.5 mm: stray nodes the laser fires on

tiny-segments

zero-length segments, and files made of thousands of sub-0.05 mm segments (node cleanup)

closed-paths

open outlines (gap > 0.01 mm), told apart from slits/living hinges inside a part and deliberate holding bridges

open-fragments

outlines made of loose pieces that only close end to end

self-intersection

outlines that cross themselves

no-duplicates

double and overlapping cut lines (> 0.5 mm within 0.02 mm), including a path retracing itself

islands, parts-overlap

loose pieces inside cut-outs, parts cutting through each other

min-feature

necks and strips narrower than the minimum bridge (default 1.2 mm)

min-hole

cut-outs narrower than 1.0 mm

fits-bed

parts or layout bigger than your bed (--bed 400x300)

slot-width

slots not at thickness − kerf + clearance (--thickness 3 --kerf 0.15)

finger-depth

finger notches not one sheet deep (--profile box)

Profiles (--profile) switch checks on for a kind of job: generic (default), strict (requires the colour convention), box, tray, kerf-test, ornament (one piece + hanging hole), name, silhouette, engrave (engrave-only files are valid), layered, refit. Every threshold is a parameter.

What fix changes, and what it never touches

Changes (each can be switched off): real size in mm · zero-length segments and stray nodes removed · colours mapped to cut / score / engrave (override with --map 'stroke:#e8251b=cut') · fill-only shapes turned into cut outlines when that is unambiguous · double cuts merged · open ends joined where each end has exactly one partner within --gap-max (0.2 mm) · optional kerf compensation (--kerf 0.15: outlines out, holes in by half the kerf).

Never touched: thin bridges, small holes, self-intersections, islands, slot widths. Those are design decisions; check reports them with locations and you decide.

Kerf and slots

Slots are drawn on their centre line and the beam removes half the kerf on each side, so:

draw slot = measured thickness − kerf + clearance

kerfkit slot --thickness 3.0 --kerf 0.1 → draw 2.90 mm. Add --drawn 3.0 to judge a slot already in a file (tight / ok / loose), --dowel 3 to size a dowel hole.

Find your kerf from one test cut (kerfkit testsheet):

  • Kerf square: a 20 mm square hole; measure the hole and the square that drops out. kerfkit kerf square HOLE SQUARE gives (hole − square) / 2, which cancels most caliper error.

  • Slot gauge: five notches around thickness − kerf, each labelled with the kerf to use if it is the snug one. Push the key (cut from the same sheet) into each.

  • Also: kerf part DRAWN MEASURED, kerf hole DRAWN MEASURED, kerf comb TOTAL MEASURED --cuts N.

kerfkit refit FILE -o OUT --thickness 3.2 --kerf 0.15 redraws every closed rectangular slot at the new width, keeping its centre, angle and length. The model is not scaled.

Python

from kerfkit import check_file, fix_svg, slot_width, refit_slots, test_sheet

rep = check_file("panel.svg", thickness_mm=3.0, kerf_mm=0.15, bed_mm=[400, 300])
print(rep["pass"], [c["id"] for c in rep["checks"] if c["status"] == "fail"])

result = fix_svg("panel.svg", gap_max=0.2)
open("panel.fixed.svg", "w").write(result.svg)

slot_width(3.2, kerf=0.15, clearance=0.05)   # 3.1

Use it from Claude or any MCP client

kerfkit ships a stdio MCP server, kerfkit-mcp, with seven tools: check_laser_file, fix_laser_svg, slot_width, kerf_from_test, refit_slots, make_slot_gauge, make_test_sheet. It reads and writes local files only and makes no network calls.

Claude Code plugin (MCP server + skill in one step):

/plugin marketplace add junixlabs/kerfkit
/plugin install kerfkit@junixlabs

The plugin also lists an optional second server, fit: the remote MocMakes Fit MCP server (sign-in with OAuth via /mcp), with the /kerfkit:fit-projects and /kerfkit:fit-build commands for your own Fit projects. It is only contacted if you authenticate it; kerfkit's own tools stay local and need no account.

Claude Code, MCP only:

claude mcp add kerfkit -- uvx --with ezdxf --from git+https://github.com/junixlabs/kerfkit kerfkit-mcp

Claude Desktop, Cursor, VS Code, other MCP clients (mcpServers JSON):

{
  "mcpServers": {
    "kerfkit": {
      "command": "uvx",
      "args": ["--with", "ezdxf", "--from", "git+https://github.com/junixlabs/kerfkit", "kerfkit-mcp"]
    }
  }
}

Skill only: copy skills/kerfkit/ into ~/.claude/skills/. It teaches the assistant the workflow (check → fix → re-check → slot width → test cut) and the formulas, and uses the CLI.

Then ask things like "check ~/Downloads/box.svg for my 3 mm ply, kerf 0.15" or "make me a slot gauge for 6 mm MDF".

FAQ

How do I check an SVG before laser cutting? kerfkit check file.svg. It reports units, layers, open paths, double lines, stray nodes, thin bridges, small holes and bed fit, each with the location in mm. Add --thickness and --kerf to check slot widths too.

How do I find my laser's kerf? Cut kerfkit testsheet -o test.svg --thickness 3 and measure the 20 mm square hole and the square that drops out: kerfkit kerf square 20.16 19.84 → 0.16 mm. On 3 mm plywood it is usually 0.1 to 0.2 mm.

Why are my slots too loose? The slot was drawn at the nominal thickness and the beam widened it by the kerf, or your sheet is thinner than the label. Measure the sheet, then kerfkit slot --thickness 2.9 --kerf 0.15 --drawn 3.0 tells you how loose and what width to draw; kerfkit refit redraws closed slots for you.

Why are my slots too tight? Usually the sheet is thicker than the file assumed: plywood sold as 3 mm can measure anywhere from 2.7 to 3.2 mm. Same commands as above.

Why does my SVG import at the wrong size? Its width and height are in pixels or missing, and apps disagree on 72 vs 96 pixels per inch (75 % / 133 %). kerfkit check flags it, kerfkit fix writes real millimetres.

Which colours does it expect? Red #FF0000 hairline = cut, blue #0000FF = score, black (or blue) fill = engrave, a common convention in shared files. Laser apps such as LightBurn put each colour on its own layer, so near-misses like #e8251b end up on a separate layer. Other colours are read leniently and fix maps them; --strict requires the convention.

Does it work with LightBurn, Glowforge, xTool? It checks and writes plain SVG (and reads DXF), which they all import. It does not read .lbrn or .gf project files yet.

Is this a guarantee the file cuts? No. These are geometry checks against cut rules; machines, focus and materials vary. Cut the small test sheet first.

Honest scope (v0.1)

  • SVG in and out; DXF in (checks only). No DXF writing, no LightBurn/xTool project files yet.

  • refit moves closed rectangular slots only. Edge notches, tabs and finger joints are found and reported by check, not moved.

  • fix writes a new, flattened SVG (one path per shape, transforms baked in). Groups, layer names and metadata of the original are not kept. Text and images are left out with a warning.

  • Kerf compensation and fill merging turn curves into fine polylines.

  • No raster analysis: engraving line widths and photos are not judged.

Roadmap: a jig board generator and batch names from CSV (v0.2), DXF out and LightBurn export (v0.3). Ideas and bug reports are welcome in Issues and Discussions.

Made by MocMakes

kerfkit is the open-source core of the checks behind MocMakes, where we design slot-together laser kits.

Contributing

Bug reports with a sample file are the most useful thing you can send (strip anything private first). See CONTRIBUTING.md. Security issues: SECURITY.md.

MIT licence © MocMakes.

Available Tools

7 tools
check_laser_fileA

Check a laser cutting file (SVG or DXF) before cutting: units and real size, colour-to-layer mapping (cut/score/engrave), live text, open paths, double/overlapping cut lines, tiny stray paths and zero-length segments, self-intersections, minimum feature/bridge width, minimum hole, loose islands, bed fit and slot widths against thickness and kerf. Returns pass/warn/fail per check with locations in mm (origin top-left).

Inputs: svg, path, bed_mm, kerf_mm, +5 more.

fix_laser_svgA

Apply the safe automatic repairs to an SVG and write a clean millimetre SVG: real size in mm, zero-length segments removed, colours mapped to cut (red hairline) / score (blue) / engrave (black fill), fill-only shapes turned into cut outlines when unambiguous, double cuts merged, small gaps closed. Optional kerf compensation. Never changes bridges, holes or slot widths.

Inputs: svg, path, kerf_mm, colour_map, +2 more.

kerf_from_testA

Work out the kerf from a test cut. Methods: square (hole and the square that dropped out of it: a=hole, b=square), part (a=drawn, b=measured), hole (a=drawn, b=measured), comb (a=drawn total, b=measured total, cuts=N), gauge (a=kerf the gauge was drawn for, b=offset of the snug notch).

Inputs: a (required), b (required), method (required), cuts.

make_slot_gaugeC

Generate a slot gauge SVG (five notches around thickness - kerf, each labelled with the kerf to use if it is the snug one) plus a key cut from the same sheet.

Inputs: thickness_mm (required), kerf_mm, output_path.

make_test_sheetA

Generate a small test sheet SVG (about 120 x 50 mm): slot gauge, key and a 20 mm kerf square. Cut it once, then use kerf_from_test.

Inputs: thickness_mm (required), kerf_mm, output_path.

refit_slotsA

Refit the closed rectangular slots of an SVG to a real sheet thickness and kerf (each slot keeps its centre, angle and length; only its width changes). Edge notches, tabs and finger joints are not moved in v0.1.

Inputs: thickness_mm (required), svg, path, kerf_mm, +3 more.

slot_widthA

Slot width to draw so a sheet of this thickness fits, given the kerf: thickness + clearance - kerf. Optionally judge a slot already drawn (tight / ok / loose) and size a dowel hole.

Inputs: thickness_mm (required), kerf_mm, dowel_mm, drawn_mm, +1 more.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 7 tools

    Disambiguation5/5

    Each tool has a distinct role: checking, repairing, calculating slot widths, deriving kerf, refitting slots, and generating a gauge or test sheet. The closest pairs (slot_width vs refit_slots, make_slot_gauge vs make_test_sheet) are clearly separated by whether they calculate, modify an SVG, or generate a test artifact.

    Naming Consistency4/5

    Most names follow a clear snake_case verb_noun or action-oriented pattern such as check_laser_file, fix_laser_svg, refit_slots, and make_test_sheet. The noun phrases slot_width and kerf_from_test are minor deviations, but the overall naming remains readable and consistent.

    Tool Count5/5

    Seven tools is well-scoped for a laser-cutting preparation toolkit. Each tool covers a meaningful stage in the workflow without redundant entries.

    Completeness4/5

    The surface covers checking, safe repair, slot sizing, kerf derivation, slot refitting, and test artifact generation, which is strong lifecycle coverage. The explicit v0.1 limitation that refit_slots does not move edge notches, tabs, or finger joints leaves a notable gap, but most core workflows are supported.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server for pre-print QA of Bambu Studio projects, providing tools to inspect models and 3MF files, validate risky settings, create support variants, and open files in Bambu Studio.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Provides an MCP server that lets AI assistants generate laser-cut SVG designs using Boxes.py CAD tools and generators, including products like boxes, traffic lights, robot banks, drawing robots, yachts, and astronauts, with SVG generation, validation, and preview.
      MIT
    • A
      license
      A
      quality
      A
      maintenance
      Free, open-source 2D nesting for fixed sheets (laser, CNC, plasma, waterjet, fabric): SVG/DXF import, part-in-part nesting across several sheets, validation and export. Runs as an MCP server, on the command line and in the browser.
      5
      30
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables agents to draw precise laser-cutting and engraving geometry, import designs into Windows LaserMaker, set layer processes, and save/reopen .lcpx projects for verification, with preflight checks and cross-session recovery.
      MIT