A CAD whose primary user is an AI agent.

Wright CAD is a headless parametric CAD. The agent writes a short script, the engine builds watertight solids, and you get STL and 3MF files ready for the slicer. The viewer is just another client.

RustPython clientMCP serverMIT
A drawing of a cross block next to the 3D model Wright CAD rebuilt from it
A drawing in, a parametric part out. The agent read the dimensions off the picture and rebuilt the part with a script.

The program is the function

The agent doesn't edit a feature tree. It authors a parametric program with named parameters and expressions, then turns knobs. Every change re-executes the program but only regenerates the geometry whose inputs moved, and entity ids stay the same. Try it on the cross block from the showcase.

set_parameter("arm", 15)
entity #1 · ids unchanged
volume 0 cm³

The bus is the product

Wright CAD inverts the usual GUI-first design. A headless core and its command bus do the work. The agent's client and the human's viewer both talk to that bus and nothing else.

Agents and scripts

  • Python client, no dependencies
  • MCP server for any agent host
  • Any language that speaks JSON-RPC

wright-view

  • wgpu viewer for the human
  • Pulls snapshots with get_scene
  • Chooses its document locally
  • Owns no document state
JSON-RPC · stdio / TCP

wright server and core

  • Documents, entities, parameters and the program
  • Booleans, sketches with constraints, extrude, revolve
  • Fillet and chamfer with geometric edge filters
  • Undo and redo for everything on the bus
  • Deterministic tessellation and a software renderer
  • STL, 3MF and .wcad export

One API

No side channel exists between the viewer and the engine. Every client gets the same scriptable surface.

Deterministic

Integer ids, stable tessellation and replayable command sequences. Tests and agents can rely on exact repetition.

Built for agents

Errors carry recovery hints. A new entity arrives with its full mesh, so there is no second round trip.

A dumb renderer

The viewer draws buffers and owns no logic. Anything it can show, a script can reproduce.

From a picture to a printable part

The agent is handed a drawing with a front and a 3/4 view. It writes examples/cross_block.py, renders its own model headlessly, and compares the silhouette to the drawing (0.99 IoU).

  1. ReadDerive 45 × 45 mm in plan, 15 mm arms, 50 mm tall from the 9 mm scale bar.
  2. AuthorWrite a parametric program: span, arm, height, twelve sketch lines, extrude.
  3. CheckCall render_offscreen from the drawing's camera and compare silhouettes.
  4. FinishRound the top and bottom rims with fillet and a normals filter. Leave the sharp plan corners alone.
  5. DeliverExport STL and 3MF for the slicer, plus a .wcad that reopens with its knobs.
The source picture
The source picture to resemble including the size with the scale. See examples/example_body.png.
The finished cross block with rounded top and bottom rims
The finished part: 1 mm rounds on the rims, driven by the round_r knob.

From a sentence to a printable part

The brief was one line: Use the wright [sic] tool to create me a M10 screw with 20mm length. No drawing, no dimension table. The agent chose ISO 4762 socket-head proportions, drove the MCP server, and watched the part appear in the live viewer.

  1. AskM10 and 20 mm are the only hard facts. Head, drive, pitch and chamfer are choices the agent makes and can justify.
  2. Modelthread sweeps a real helical thread with a 60° included angle at the M10 coarse pitch; a Ø16 × 10 mm head is unioned on top.
  3. Verifyvalidate comes back watertight: 0 open edges, 0 non-manifold edges, 0 self-intersections, 2949.9 mm³.
  4. Lookrender_offscreen returns a PNG inline, so the agent reviews its own work instead of guessing at it.
  5. DeliverA 10,578-triangle STL and a replayable .wcad with seven named parameters.
An agent session showing the one-line prompt and the agent's summary of the screw it built
The whole session: one sentence in, then thread, head, chamfer, validation and file list out. About 22k tokens.
The M10x20 screw in the Wright CAD viewer, labelled M10x20_screw #5
The part in the live viewer while the agent worked. The viewer is another bus client: no document state, no hidden modelling code.
Headless render of the screw from a three-quarter view
Headless render from the engine's software rasterizer. Same solid, no GPU, byte-identical every time: Ø16 mm head, 8 mm hex socket, 20 mm of thread.
Side view of the screw showing the 60 degree thread angle
Side view: 1.5 mm coarse pitch, a 60° thread angle, and a 0.6 mm chamfer on the head rim. The thread is geometry, not a texture.

Both files live in examples/m10x20_screw/. The STL goes to the slicer; the .wcad is the source of truth: opening it replays the program and restores its seven parameters, so setting length to 30 turns it into an M10 × 30.

A protocol an agent can learn in a minute

Line-delimited JSON-RPC 2.0, one request and one response per line. Dimensions are expressions over named parameters, in millimeters and degrees, with Z up.

On the wire

// request
{"jsonrpc":"2.0","id":1,"method":"add_box",
 "params":{"doc":1,"name":"base",
  "center":[0,0,"wall/2"],
  "size":[80,40,"wall*2"]}}

// response: the mesh comes back with the entity
{"jsonrpc":"2.0","id":1,
 "result":{"entity_created":
  {"doc":1,"entity":1,"mesh":{...}}}}

Commands cover documents, primitives, booleans, sketches with arcs, splines and construction geometry, constraints (including tangent, equal, symmetric and angle), trim, extend, offset, extrude, revolve, patterns and mirror, shell, holes, sweep, loft, threads, fillet, chamfer, picking, validation, scene diff, export, undo and redo, and rendering.

From Python

from wright import Wright

with Wright.spawn() as cad:
    cad.initialize()
    doc = cad.create_document("bracket")["doc"]

    cad.set_parameter(doc, "wall", 2.0,
        description="plate thickness [mm]")
    cad.set_parameter(doc, "plate_len", 80.0)
    base = cad.add_box(doc, "base",
        center=(0, 0, "wall/2"),
        size=("plate_len", 40, "wall*2"))

    cad.set_parameter(doc, "wall", 4.0)
    # only downstream features rebuild; ids unchanged
    cad.undo(doc)

The expression grammar is tiny and safe: + - * /, parentheses, identifiers. A typo lists the valid parameter names.

Sketch completeness. Sketches now draw arcs and interpolating splines, close profiles with tangent joints, and use equal, concentric, symmetric, angle and point-on-line constraints. Construction geometry guides the solve without joining the extrusion; trim_sketch, extend_sketch and offset_sketch edit the drawing, and every solve names an unsatisfied or redundant constraint by id instead of quietly compromising.

Trust loop. validate checks every solid for watertightness, non-manifold edges, self-intersections, volume and an approximate thinnest wall (optionally against min_wall_mm), and every sketch for solver status, conflict diagnostics and a closed profile. diff_scene compares two revisions by entity signature — against another open document or a saved .wcad — and names what changed: added, removed and modified entities with field-level detail, parameter values and the program. Both are queries: no program entry, no state change. A rebuild is proven correct, not assumed.

Shape leverage. linear_pattern and circular_pattern repeat solids, mirror reflects them, shell hollows in place (open faces by outward normal), and hole cuts a real through, blind, counterbore or countersink hole. sweep carries a profile along a polyline or helix, loft morphs between profiles, and thread builds a helical screw thread: union it for a screw, subtract it for a threaded hole.

Plug it into your agent

The MCP server is another adapter over the bus. It has no dependencies, and it exposes three tools, one per intent, to keep round trips cheap. The handshake returns instructions that teach the agent the command language, so no README is needed.

Claude Desktop and other hosts

{
  "mcpServers": {
    "wright": {
      "command": "/path/to/wright-cad/.venv/bin/wright-mcp"
    }
  }
}

wright_execute runs a batch of bus commands and stops at the first error with a recovery hint. wright_scene returns a compact state without raw meshes. wright_render returns a deterministic PNG inline so the agent can see what it built.

Watch the agent draw

# 1. shared backend
./target/debug/wright --tcp 7860

# 2. point the MCP server at it
WRIGHT_CONNECT=127.0.0.1:7860 wright-mcp

# 3. the viewer refreshes on every change
./target/debug/wright-view --port 7860
# labels: name #id · Tab/[ ]/1-9: switch document · click: pick · C: copy selector

The TCP server shares one document space and broadcasts scene_changed after every mutation; each notification names the affected document (including the new id for create/open). Without WRIGHT_CONNECT, the MCP server runs a private engine. The viewer shows one document at a time and chooses it locally (following the first until you switch), so several viewers can watch different documents on one engine. A click sends a ray through pick; the HUD shows the exact {entity,normal,near} face or {direction,near,near_radius} edge selector to hand to the agent, who passes it straight to add_sketch, fillet or chamfer.

Restarts self-heal: the client reconnects (retrying briefly) and the viewer's watcher reconnects and re-fetches by itself. The MCP result then carries reconnected with the documents that survived; a restarted engine is empty, so the agent replays its script.

Quickstart

Build and run the agent seat

cargo build

python3 -m venv .venv
.venv/bin/pip install -e ./python
.venv/bin/python examples/hello_wright.py

Add the human seat

./target/debug/wright --tcp 7860 &
./target/debug/wright-view --port 7860

# drag = orbit, wheel = zoom, L = labels, Tab = switch document, click = pick, R = refresh

More examples live in examples/: a printable bracket, a revolved bushing, face sketches, a sketch-completeness tour (arcs, splines, construction geometry, trim/offset and conflict diagnostics), a face/edge pick that drives a sketch and a fillet, a validate-and-diff trust loop, and a save and load round trip.

Roadmap

The script is the source of truth. The next milestones make the agent-authored script loop trustworthy and expressive. A GUI feature tree is deliberately not on the list.

Shipped

  • Bus, engine, clients Python client and wgpu viewer
  • Parametric layer parameters, expressions, replay
  • MCP and live preview shared engine, auto-refresh
  • Mesh booleans Manifold, bit-deterministic
  • Headless rendering software rasterizer, ortho cameras
  • Sketches and constraints deterministic solver
  • Extrude and revolve watertight, printable solids
  • Persistence byte-stable .wcad files
  • Fillet and chamfer geometric edge filters
  • 3MF export named, colored objects
  • Face and datum sketch planes
  • Script as source embedded scripts, get_script
  • Labels and pick click a face, copy a real selector
  • M14 Validate and scene diff prove the rebuild is correct
  • M15 Incremental rebuild regenerate only what a knob affects
  • M16 Shape leverage patterns, mirror, shell, holes, sweep, loft, threads
  • M17 Sketch completeness arcs, splines, construction, trim/extend/offset, conflict diagnostics

Next

  • M18 Interoperability mesh import, DXF/SVG, STEP
  • M19 Assemblies and drawings