API & MCP
Everything a person can do on Kerfwise CNC G-code Generator, a program or AI agent can do with the same inputs and get the identical result.
HTTP API
POST https://kerfwisecncgcode.usefulweb.site/api/v1/calculate– run Kerfwise CNC G-code GeneratorGET https://kerfwisecncgcode.usefulweb.site/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
Kerfwise CNC G-code Generator
Turns a part list into a CNC router program: parts (rectangles, L-shapes, corner cuts, quarter rounds) are nested with a gap of one cutter diameter, then every part gets an outside profile with the tool-radius offset already in the path (arcs around corners), multiple depth passes with a ramped entry, holding tabs or an onion skin, and the cut order small parts first. Holes become drilling cycles (G81, or G83 peck for deep holes) for LinuxCNC / Fanuc-style controls, or expanded moves for GRBL. You get the G-code, a toolpath preview, a DXF per sheet and the estimated machining time.
| Field | Type | Default | Description |
|---|---|---|---|
parts (required) | table | — | Parts. Finished cut sizes. Length runs along the grain. |
holes | table | — | Holes. Part = row number in the parts table; x along the length, y across, from the part’s first corner. Depth ≥ thickness = through. |
sheetLength | number | 2800 | Sheet length |
sheetWidth | number | 2070 | Sheet width |
thickness | number | 18 | Material thickness |
trim | number | 15 | Margin to the sheet edge |
grainedMaterial | boolean | false | Material has grain |
dialect | select (grbl, linuxcnc, fanuc) | "grbl" | Controller |
origin | select (bottom-left, top-left) | "bottom-left" | Work zero (X/Y) |
toolDiameter | number | 6 | End mill diameter |
feed | number | 6000 | Cutting feed |
plunge | number | 1500 | Plunge feed |
rpm | integer | 18000 | Spindle speed |
stepdown | number | 6 | Depth per pass |
holdDown | select (tabs, onion, none) | "tabs" | Hold-down |
direction | select (climb, conventional) | "climb" | Cut direction |
safeZ | number | 15 | Safe Z |
sheetIndex | integer | 1 | Sheet to show |
Example request
Wardrobe side panels with shelf-pin rows (GRBL)
curl -X POST https://kerfwisecncgcode.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{"parts":[{"name":"Side","length":2000,"width":580,"qty":2},{"name":"Shelf","length":764,"width":560,"qty":3}],"holes":[{"part":1,"x":300,"y":37,"diameter":5,"depth":12},{"part":1,"x":332,"y":37,"diameter":5,"depth":12},{"part":1,"x":300,"y":543,"diameter":5,"depth":12},{"part":1,"x":332,"y":543,"diameter":5,"depth":12}],"sheetLength":2800,"sheetWidth":2070,"thickness":18,"dialect":"grbl"}'
Every result contains
inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.
MCP (Model Context Protocol)
- Streamable HTTP endpoint:
https://kerfwisecncgcode.usefulweb.site/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
kerfwise_cnc_gcode - Local stdio connector:
node src/mcp-stdio.ts --tool=kerfwise-cnc-gcode
{
"mcpServers": {
"kerfwise-cnc-gcode": { "type": "http", "url": "https://kerfwisecncgcode.usefulweb.site/mcp" }
}
}