ClassCAD
v0.6.3Build and verify CAD parts and assemblies with the ClassCAD engine, locally, no server needed.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
login Sign in to ClassCAD
Sign this machine in to ClassCAD (a free classcad.ch account; Google, GitHub or email). Call it RIGHT AFTER installing the MCP. Not signed in: the first call opens the sign-in page in the user's browser and returns its link — show it to the user as a clickable link too — and the next call WAITS (up to ~50 s per call) until they have signed in in the browser, then returns their account. Call again while it reports "still waiting". Already signed in: returns the account at once. logout: true signs the machine out.
| Parameter | Type | Description |
|---|---|---|
logout | boolean | Sign this machine out instead. |
account ClassCAD account and plan
The signed-in classcad.ch account: its plan (and until when), whether it allows commercial use, which exports, and WHERE A WEB APP built with ClassCAD may run under it — localhost always (any port), public https domains only as registered on the account (from the plan that has them) — plus the public access token (ccpk_…) that goes into the app's page, or where to make one. Call it FIRST when the user wants their own app, website, configurator or deployment around a model; then follow docs(["recipes/buerli-app"]). Read-only: tokens and domains are made on the account page.
view Open the app
The live CAD app of this session (Buerligons), docked into the same engine: returns its link and says how to bring it up. Where the session is shared from the start the link is its share link (it works from anywhere); local: true returns the link that works on this machine only instead — for when the share link does not load. The app shows every change as it happens, and the user can work in it — turn and zoom, select, measure, edit sketches and features, export STEP or STL. Call it when the user asks to see, turn or edit the model, or asks for the link. If the user already has it open, no…
| Parameter | Type | Description |
|---|---|---|
drawing * | string | The drawing this call works on. "new" opens a new, empty drawing, and the answer names its id; from then on pass that id (e.g. "d-k3v9q2xa") in every call of this conversation about that model. A draw… |
local | boolean | Return the link of the app on this machine (127.0.0.1), which needs no share service: use it when the share link does not load. |
open | boolean | true: open the user's default browser now. false: only return the link. Default: bring it up where it belongs, unless the user already has it open. |
get_selection What the user selected
What the user has selected in the app docked into this session: faces, edges and vertices of a body, or objects of the model tree (sketch entities, dimensions, features). Call it when the user points at something instead of naming it ("this face", "the selected edges", "here"). Each item has `kind` (face | edge | vertex | object) and `objectId` — the tree object: the picked object itself, or the solid a picked face, edge or vertex belongs to (`object` names its class). Geometry also has `graphicId`, the id API calls take for that face, edge or vertex (e.g. v1.sketch.create({ planeId })), its…
| Parameter | Type | Description |
|---|---|---|
drawing * | string | The drawing this call works on. "new" opens a new, empty drawing, and the answer names its id; from then on pass that id (e.g. "d-k3v9q2xa") in every call of this conversation about that model. A draw… |
set_selection Select something for the user
Selects things in the app docked into this session, so the user sees what you mean: faces, edges or vertices by their `graphicId` (from getGeometryIds, pick results or get_selection), tree objects by their `objectId`. The app highlights them. Returns what is selected there afterwards. Geometry ids must be current ones (see get_selection); pass `prodRefId` from a previous get_selection when the part is an instance in an assembly. An empty `items` clears the selection.
| Parameter | Type | Description |
|---|---|---|
drawing * | string | The drawing this call works on. "new" opens a new, empty drawing, and the answer names its id; from then on pass that id (e.g. "d-k3v9q2xa") in every call of this conversation about that model. A draw… |
items * | array | What to select. |
replace | boolean | Replace the current selection (default) or add to it (false). |
session_info Session info
Return ClassCAD MCP session status: the drawing's id, the link of the app docked into this session (app) or of the read-only 3D view (viewer), the link the session is shared with others under (shared; null while it is not), who else is in the session (peers), sign-in (auth), transport (ws = ClassCAD worker, wasm = the MCP's own local engine), engine policy, whether a local WASM engine is available, WS URL, current session id, the invite this session joined with (shareToken), connection state, package version. DAEMON: every connection of a host to this MCP is a session in ONE shared daemon proc…
| Parameter | Type | Description |
|---|---|---|
drawing | string | The drawing this call works on. "new" opens a new, empty drawing, and the answer names its id; from then on pass that id (e.g. "d-k3v9q2xa") in every call of this conversation about that model. A draw… |
use_session Switch session
Make this the FIRST call of a drawing (drawing: "new") when the user names a session or hands you a session/token URL — a drawing opens its engine link lazily, so its first tool call decides which session it is. Modes: (1) sessionId — attaches to a named ClassCAD session (ClassCAD-Session-Id header) on the configured worker; empty/omitted = fresh worker-assigned session. (2) url — a ws(s):// URL from a multi-client server, typically carrying an invite token (wss://host/?invite=…); connected VERBATIM. (3) an http(s):// APP SHARE LINK from a buerli app's Session Management (…?invite= 
| Parameter | Type | Description |
|---|---|---|
drawing * | string | The drawing this call works on. "new" opens a new, empty drawing, and the answer names its id; from then on pass that id (e.g. "d-k3v9q2xa") in every call of this conversation about that model. A draw… |
engine | string | Engine for the MCP's own session when no url is given: auto (worker, else local WASM), drogon (the ClassCAD worker only), wasm (the local engine only). Sticks for the session until changed. |
sessionId | string | Target session id (named-session model, worker only). Empty string or omitted = no header (worker-assigned session). |
url | string | ws(s):// URL to connect to VERBATIM — e.g. a multi-client token/invite URL (wss://host/?invite=…). An http(s):// app share link with ?invite= is accepted too: the invite token is extracted and app… |
clear Clear drawing
Empty the drawing (v1.common.clear), to start over in it: a drawing persists between requests, part.create refuses a second root, and anything built on the old part would carry its geometry along. For a new, unrelated model next to this one, open a new drawing instead (drawing: "new"). Not needed for changes to the current model. The graphic and renders are empty afterwards too — no reconnect needed.
| Parameter | Type | Description |
|---|---|---|
drawing * | string | The drawing this call works on. "new" opens a new, empty drawing, and the answer names its id; from then on pass that id (e.g. "d-k3v9q2xa") in every call of this conversation about that model. A draw… |
keepIds | array | Object IDs to preserve. Omit to wipe everything. |
save Save drawing
Write the current drawing to a file, or return it as base64. Formats: STP (STEP, exact geometry), STL (triangles), GLB (binary glTF: triangles with colours, for 3D viewers and the web), OFB (ClassCAD's own format: the model with its features, to open again in ClassCAD or Buerligons), JSON. With `path` the file is written to disk and only its path and size come back — the way to hand the user a model (give them the path); without it the content is returned base64-encoded, which is large. The user can also save the model themselves from what `view` opens.
| Parameter | Type | Description |
|---|---|---|
drawing * | string | The drawing this call works on. "new" opens a new, empty drawing, and the answer names its id; from then on pass that id (e.g. "d-k3v9q2xa") in every call of this conversation about that model. A draw… |
format * | string | Output format. |
analytic | boolean | STP only: write planes, cylinders, cones, spheres and tori as such instead of as B-spline surfaces. Other CAD systems read such a file faster and recognise its holes and flats. |
path | string | Absolute file path to write, e.g. /Users/me/Desktop/flange.stp (folders are created). Omit to get the content back as base64. |
load Load drawing
Load a drawing, replacing the current one: from a file on disk (`path`) or from base64-encoded content. Formats: STP (STEP), STL, OFB, JSON. Prefer `path`: the file is read here and never passes through the conversation, which is the only practical way for a model file of real size. Give exactly one of `path` and `content`.
| Parameter | Type | Description |
|---|---|---|
drawing * | string | The drawing this call works on. "new" opens a new, empty drawing, and the answer names its id; from then on pass that id (e.g. "d-k3v9q2xa") in every call of this conversation about that model. A draw… |
format * | string | Input format. |
content | string | Base64-encoded payload, when there is no file. |
path | string | Absolute path of the file to load, e.g. /Users/me/parts/bracket.step. |
checkpoint Checkpoint drawing
Save the WHOLE drawing state under a label (in-memory, server-side — cheap and instant). Use BEFORE risky sequences (large booleans, trims, experiments): if the attempt goes wrong, restore({label}) brings the drawing back exactly instead of delete-archaeology. Re-using a label overwrites it; at most 5 checkpoints are kept (oldest dropped). Checkpoints die with the server process and with a use_session switch.
| Parameter | Type | Description |
|---|---|---|
drawing * | string | The drawing this call works on. "new" opens a new, empty drawing, and the answer names its id; from then on pass that id (e.g. "d-k3v9q2xa") in every call of this conversation about that model. A draw… |
label | string | Checkpoint name, e.g. "before-boolean". Default "checkpoint". |
restore Restore checkpoint
Replace the drawing with a previously checkpointed state (clear + reload). Without a label, the MOST RECENT checkpoint is restored. All ids from after the checkpoint are stale afterwards — re-read them (tree/find) before further operations.
| Parameter | Type | Description |
|---|---|---|
drawing * | string | The drawing this call works on. "new" opens a new, empty drawing, and the answer names its id; from then on pass that id (e.g. "d-k3v9q2xa") in every call of this conversation about that model. A draw… |
label | string | Checkpoint name. Default: the most recently created one. |
tree Structure tree
Return the cached drawing structure tree. Pass refresh=true to force a fresh server fetch first.
| Parameter | Type | Description |
|---|---|---|
drawing * | string | The drawing this call works on. "new" opens a new, empty drawing, and the answer names its id; from then on pass that id (e.g. "d-k3v9q2xa") in every call of this conversation about that model. A draw… |
refresh | boolean | Force a server round-trip before reading the cache. |
find Find nodes
Search the cached structure tree by class and/or name substring. Returns slim records (id, class, name, parent).
| Parameter | Type | Description |
|---|---|---|
drawing * | string | The drawing this call works on. "new" opens a new, empty drawing, and the answer names its id; from then on pass that id (e.g. "d-k3v9q2xa") in every call of this conversation about that model. A draw… |
name | string | Match nodes whose name contains this substring (case-insensitive). |
refresh | boolean | |
type | string | Match nodes whose class === type (e.g. "CC_Part", "CC_Box"). |
inspect Inspect node
Return the full record for a single tree node by ID, including members and children.
| Parameter | Type | Description |
|---|---|---|
drawing * | string | The drawing this call works on. "new" opens a new, empty drawing, and the answer names its id; from then on pass that id (e.g. "d-k3v9q2xa") in every call of this conversation about that model. A draw… |
id * | string | number | Node ID. |
refresh | boolean |
list_methods List API methods
Search/list the v1.<domain>.<method> surface. `search` as a string: one BM25-ranked list over method name + summary (whole words), CAD synonyms expanded (split→slice, hole→bore, round→fillet, …). `search` as an ARRAY with ONE CONCEPT PER ENTRY (e.g. ["expression", "box", "fastened constraint", "mass properties"]): one group per entry, each ranked on its own, so every concept gets its own top matches (a group note flags entries that are likely workflows, not methods). PLUS `docs`: the recipes/guides whose title, headings or text match (e.g. "shared parameters assembly" → recipes/assem…
| Parameter | Type | Description |
|---|---|---|
domain | string | Restrict to one domain. |
limit | integer | Max ranked results: total for a string search (default 25), per group for an array (default 8). |
search | Keyword(s) to rank against name + summary (case-insensitive, synonyms expanded). Array = one group per entry — put one concept in each. | |
withSummaries | boolean | Include one-line summaries (default true). |
docs Fetch documentation (bulk)
Fetch documentation in BULK — one call, many documents. Keys can be: v1 methods ("v1.part.box" or a unique bare name), topic docs ("DATA", "STRUCTURE", "GRAPHICS"), recipes ("recipes/verification" — MANDATORY in every build fetch, "recipes/clean-construction" — every assembly and multi-part model, "recipes/constrained-sketching", "recipes/parametric-part", "recipes/assembly-parameters", "recipes/pattern-then-subtract", "recipes/direct-modeling-eif", "recipes/buerli-app"), guides ("part/expression-workflow", "assembly/generic", …) and domain overviews ("api/part"). PLAN FIRST: pick ever…
| Parameter | Type | Description |
|---|---|---|
keys * | array | Documentation keys, e.g. ["DATA", "v1.part.extrusion", "v1.part.chamfer", "recipes/parametric-part"]. |
describe_method Describe API method
Full documentation for ONE key — prefer docs([...]) to fetch everything you need in a single round; use this only for a single follow-up lookup. Accepts full ("v1.part.box") or bare ("box") names — ambiguous bare names list the candidates. Also serves whole documents ("DATA", "api/part", "recipes/parametric-part"). Same size cap and paging as docs: a large document answers with page 1 and names the next page ("api/part#2").
| Parameter | Type | Description |
|---|---|---|
method * | string | Method name ("v1.part.box", "box"), topic doc ("DATA") or recipe ("recipes/constrained-sketching", "recipes/parametric-part"). |
snapshot Snapshot drawing
Render the current drawing as an inline PNG (also written to disk: outDir, else $CLASSCAD_SNAPSHOT_DIR, else <tmpdir>/classcad-snapshots). The image is returned to the MODEL as an inline image block — no follow-up Read is needed to see it. The USER usually does not see tool results. At the end of a build (not after every tweak), SHOW them the render: with a file-sending tool (Claude Code: SendUserFile), send the saved PNG; otherwise embed it in your reply as a Markdown image with its absolute path,  — Codex and most chat hosts display that. Hosts preview only files…
| Parameter | Type | Description |
|---|---|---|
drawing * | string | The drawing this call works on. "new" opens a new, empty drawing, and the answer names its id; from then on pass that id (e.g. "d-k3v9q2xa") in every call of this conversation about that model. A draw… |
annotate | boolean | Measurement overlay: bbox extents, view-oriented axes triad, scale bar. |
colors | string | "native" (default): the model's own colors. "distinct": one palette color per body. |
frame | object | Pin the frame reported by an earlier snapshot (same view/size) for pixel-comparable before/after. |
height | integer | Pixels (default 900). |
highlight | array | Ids rendered in signal color: graphic container ids, owning solid ids, face mesh ids, edge ids. CAUTION: face/edge ids are only stable within one graphic payload (recalc reassigns them) — across too… |
highlightAt | array | World points [[x,y,z],…]: the closest FACE in the rendered payload is highlighted per point. Geometrically anchored — the robust way to highlight a face found via run_script (return a point on it,… |
label | string | Filename label. Default "snapshot". |
layers | array | Content layers to render. Default ["solid"]. |
lines | boolean | Line style instead of shading: visible edges and silhouettes solid, hidden edges dashed. Hidden lines show bores, pockets, hollow vs solid. Works for the single view and every sheet panel. |
lookAt | array | World-space [x,y,z] that lands at screen center. Omit for bbox center. |
markers | array | Probe markers (crosshair + label) at world coordinates, drawn on top. |
outDir | string | Absolute directory for the PNG (created if missing). Pass your session scratchpad when the user should see the file — hosts preview only files in session folders. |
recalc | boolean | Default false. Opt in only to regenerate; keep false for solid.*/entity-injection sessions — a recalc invalidates curve shape ids and can destroy injected bodies. |
section | object | Cut the solids at a plane; the positive side of the normal is removed. The cut faces are filled and hatched like a drawing's section (wall thicknesses, bores and pockets read directly); cap: false lea… |
sheet | Multi-view sheet in ONE image. true or 4 views = quadrants (default top/iso/front/right; ortho views share one scale). 2 views = side-by-side panels labeled A | B — use for the mirror check: [matche… | |
sketchOverlay | boolean | Draw sketch curves in 3D on their actual plane over the solid render. |
source | string | "stl": render the tessellated STL export instead of the engine graphic (explicit fallback; no brep edges). |
supersample | integer | Anti-aliasing: render at k× and downscale to width×height (default 2; 1 = raw aliased pixels). Output size and image tokens are unchanged. |
techDrawing | Technical drawing in ONE image: front, top and side view in line style (hidden edges dashed), aligned at one scale, plus a shaded iso. "first-angle" (ISO E, Europe; true): top view BELOW front, view f… | |
view | Camera: named view (default "iso") or arbitrary orthographic camera. | |
width | integer | Pixels (default 1200). |
xray | boolean | Translucent bodies — hidden geometry shines through. |
zoom | number | Multiplier on auto-fit scale. 1=fit-all (default), >1 zooms in. |
run_script Run script
Execute JavaScript against the CAD session — THE tool for any build involving computation, repetition, or more than a handful of operations. The script runs as an async function body with: • api.v1.<domain>.<method>(params) — ClassCAD calls, await-able, → { result, maxLevel, messages }. Typos throw immediately with suggestions. Strict: a call that ends at maxLevel ≥ 51 THROWS (the message carries the engine error) — method docs describing "null/[] with maxLevel 51" are the non-script result; wrap intentional probes (e.g. getGeometryIds where a miss is expected) in try/catch. • aw…
| Parameter | Type | Description |
|---|---|---|
drawing * | string | The drawing this call works on. "new" opens a new, empty drawing, and the answer names its id; from then on pass that id (e.g. "d-k3v9q2xa") in every call of this conversation about that model. A draw… |
script * | string | JavaScript source. Executed as an async function body — use await directly, return a (small) summary value. |
label | string | Short label describing what this script does. |
timeoutMs | integer | Timeout for awaited work in ms (default 60000). |