API & MCP

Everything a person can do on Threadsmith Stitch File Writer, a program or AI agent can do with the same inputs and get the identical result.

HTTP API

Threadsmith Stitch File Writer

Encodes stitches as a Tajima DST (512-byte header, balanced-ternary 3-byte records, jumps split to ≤ 12.1 mm, colour changes, trims as zero-sum jumps, END), Brother PES (v1 wrapper around the PEC stitch block with thread palette indices and thumbnails, real trim flags), Janome JEF (header with hoop, extents and Janome thread indices) or Melco EXP file. The file is decoded again to verify every stitch position before you download it.

Inputs of Threadsmith Stitch File Writer
FieldTypeDefaultDescription
formatselect (dst, pes, jef, exp)"dst"File format
stitchestextarea—Stitch list (JSON). [[x, y], [x, y, "jump"], [x, y, "trim"], [x, y, "color"], …] in mm (y down), or {"cmds": […], "colors": [{"name", "hex"}]} from threadsmith-digitize.
projecttextarea—Or: Threadsmith project JSON. If given, the project is digitized first.
labeltext"DESIGN"Design label (DST/PES header, 8 characters)
colorMatchselect (de2000, redmean)"de2000"Thread colour matching. PES/JEF: how thread colours of a stitch list are matched to the machine chart. A project keeps the method it was saved with.

Example request

Tiny square outline with a jump and a colour change → DST

curl -X POST https://threadsmithstitchfile.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{"format":"dst","label":"SQUARE","stitches":"[[0,0],[10,0],[10,10],[0,10],[0,0],[30,0,\"jump\"],[30,0,\"color\"],[30,0],[40,5],[30,10]]"}'

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)

{
  "mcpServers": {
    "threadsmith-stitch-file": { "type": "http", "url": "https://threadsmithstitchfile.usefulweb.site/mcp" }
  }
}