API & MCP
Everything a person can do on Threadsmith Digitizer, a program or AI agent can do with the same inputs and get the identical result.
HTTP API
POST https://threadsmithdigitize.usefulweb.site/api/v1/calculate– run Threadsmith DigitizerGET https://threadsmithdigitize.usefulweb.site/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
Threadsmith Digitizer
Digitizes vector artwork into machine embroidery: running, bean, satin (pull compensation, auto split, short stitches, turning satin along the medial axis, satin between two rails, direction lines), tatami fill with stagger, graded density and travel under the fill, contour fill and motif runs, plus underlay. An optional sequence optimiser reorders objects for fewer colour changes, trims and jumps without changing the layering. Returns stitch counts, trims, colour changes, thread and bobbin estimates, sewing time, hoop fit, a density check and a thread-look SVG preview — the same engine as the Threadsmith app.
| Field | Type | Default | Description |
|---|---|---|---|
source | select (shape, path, svg, text, project) | "shape" | What to digitize |
shape | select (ellipse, rect, star, hexagon, heart) | "ellipse" | Shape |
widthMm | number | 40 | Shape width |
heightMm | number | 30 | Shape height |
pathD | textarea | — | Path data. SVG path syntax in millimetres (y down, 0,0 = hoop centre). Closed paths (Z) become fills, open paths become lines. |
svg | textarea | — | SVG markup. paths, rect, circle, ellipse, line, polyline, polygon and transforms are imported; text, images and gradients are skipped with a warning. |
fitWidth | number | — | Scale SVG to width. Optional. Default: the SVG’s own physical size (px at 96 dpi). |
text | text | — | Text. A–Z, a–z, 0–9 and . , ! ? - _ ' " : ; ( ) / & + # * = |
textSize | number | 12 | Letter height (capitals) |
textArc | number | 0 | Text on arc (radius). 0 = straight. Positive arches the baseline upwards (top of a badge), negative curves it downwards (bottom of a badge). |
font | select (single, outline) | "single" | Font style |
project | textarea | — | Project JSON. A .threadsmith.json project (see the app’s project schema). |
stitchType | select (auto, running, satin, tatami, contour, motif) | "auto" | Stitch type |
angle | number | 45 | Fill angle |
spacing | number | 0.4 | Row spacing / satin density |
stitchLength | number | 3.5 | Stitch length |
satinWidth | number | 3 | Satin column width (lines) |
satinMode | select (auto, fill, turning, border, rails) | "auto" | Satin mode |
directionLines | text | — | Satin direction lines. Optional, mm: "x1,y1 x2,y2; x1,y1 x2,y2". Each line must cross both edges of the column; the stitch is parallel to it there and turns gradually in between. Used by turning satin, rails and columns along open paths. |
pullComp | number | 0.2 | Pull compensation |
underlay | select (auto, none, center, edge, center-edge, edge-tatami, zigzag, full) | "auto" | Underlay |
travelUnder | boolean | true | Travel under fills. Fills that fall apart into sections are joined by travel runs routed inside the area that is still to be sewn, instead of jumps and trims. Projects keep their own per-object setting. |
autoSequence | boolean | true | Optimise the sewing order. Reorders objects for fewer colour changes, trims and jumps; overlapping objects keep their order. Used only when it is no worse than the original order. |
color | text | "sapphire" | Thread. #rrggbb or a built-in thread name such as ruby, emerald, gold, navy. |
hoop | select (50x50, 100x100, 130x180, 150x150, 160x260, 200x200, 200x300, 240x150, 360x200) | "130x180" | Hoop |
spm | integer | 700 | Machine speed |
includeStitches | boolean | false | Include the stitch list in the result. Adds result.stitchList ([x, y, type] in mm) for chaining into threadsmith-stitch-file. |
colorMatch | select (de2000, redmean) | "de2000" | Thread colour matching. SVG source: how artwork colours are matched to threads (within ΔE2000 8 or redmean 60, else a custom thread). Stored in the project. |
Example request
40 × 30 mm oval, automatic tatami with underlay
curl -X POST https://threadsmithdigitize.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{"source":"shape","shape":"ellipse","widthMm":40,"heightMm":30,"color":"ruby"}'
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://threadsmithdigitize.usefulweb.site/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
threadsmith_digitize - Local stdio connector:
node src/mcp-stdio.ts --tool=threadsmith-digitize
{
"mcpServers": {
"threadsmith-digitize": { "type": "http", "url": "https://threadsmithdigitize.usefulweb.site/mcp" }
}
}