tscad GitHub

tscad MCP server

tscad mcp runs a Model Context Protocol server over stdio (spec 2025-06-18), so Claude (or any MCP client) can design parametric CAD with tscad: read the element reference, write TSX, evaluate it with the B-rep kernel, look at a rendering, and export STEP/STL/3MF/GLB/OBJ/DXF/SVG.

Add it to Claude Code

claude mcp add tscad -- bunx tscad mcp

Inside a project that has tscad installed (bun add tscad), use the local copy instead:

claude mcp add tscad -- bun x tscad mcp

Then ask for a part: "Design a NEMA 17 motor mount plate, 5 mm thick, with counterbored M3 holes, and export it to STEP." Claude reads the docs, writes the model, evaluates and renders it, fixes what fails, and writes the file. Relative paths (models, exports) resolve against the directory Claude Code was started in.

Add it to Claude Desktop

Edit claude_desktop_config.json (Settings → Developer → Edit Config):

{
  "mcpServers": {
    "tscad": {
      "command": "bunx",
      "args": ["tscad", "mcp"]
    }
  }
}

If bunx is not on the app's PATH, use the absolute path (which bunx). Claude Desktop starts servers in an unspecified working directory, so give absolute paths for file, path and baseDir (or ask Claude to).

Any other MCP client: run bunx tscad mcp as a stdio server (newline-delimited JSON-RPC).

Tools

ToolWhat it does
tscad_docsThe authoring guide (default), the element/props reference generated from the type definitions (topic: "elements"), the parts library (topic: "parts"), or exact props of named elements (element: "extrude" or a list).
tscad_list_examples / tscad_read_exampleThe bundled example models, as templates.
tscad_evaluateCompile + evaluate a model (source TSX text or file path, optional params). Per part: ok, volume (mm³), mass (g, from material/density), size and bounding box, face/edge counts, timings; warnings; params. Errors name the TSX line with a code frame.
tscad_renderSame, plus a PNG (view: iso/front/top/... or "az,el", width, height, background, ortho).
tscad_exportWrite step, stl, 3mf, glb, obj, dxf or svg to path; returns the path and size. DXF/SVG come from <drawing>s, or else a section of each part at sectionZ (default mid-height).
tscad_platePrint layout: orients each part for least overhang (or orient: "keep") and packs parts and copies onto as many beds as needed. Returns part, plate, bottom face, overhang % and height; with path writes a 3MF (orientation notes per object) or STL per plate.
tscad_checkDesign checks: 3D-printing overhangs (faces steeper than maxOverhangDeg, with their location and a selector), the thinnest wall and where it is, bed fit (bed), watertight meshes, and interference between parts (the volume and location of each overlap).
tscad_pick_selectorsThe edge (or face) nearest a point (or by index) and selectors that pick it (">X and >Z" / edges.max("x").and(edges.top())), with how many each selects. For edges= on <fillet>/<chamfer> and open= on <shell>.

Every model tool takes:

Tool failures (a model that doesn't compile, a kernel error) come back as results with isError: true and a readable message, so the agent can fix the model and retry. Calls are evaluated one at a time on one kernel session, which caches unchanged subtrees between calls.

Notes