# Using SolidCraft with AI for hobbyist 3D CAD

> Design 3D-printable enclosures, cable combs, and motor mounts in SolidCraft with AI over MCP and the built-in Assistant, plus CLI resizing.

Author: [Flavio Copes](https://flaviocopes.com/about/) | Published: 2026-11-26 | Topics: [AI](https://flaviocopes.com/tags/ai/) | Canonical: https://flaviocopes.com/solidcraft/

[SolidCraft](https://solidcraft.io) is an open-source parametric 3D CAD application built in Rust. You can run it as a desktop app on macOS, Windows, and Linux, open it in a browser at [solidcraft.io/app](https://solidcraft.io/app), or drive it from the terminal and AI agents.

The source code lives at [tangency-labs/solidcraft](https://github.com/tangency-labs/solidcraft) under a dual MIT / Apache-2.0 license. What caught my eye is how it connects to AI. Instead of asking a model to write fragile OpenSCAD scripts or generate uneditable meshes, an agent calls the same parametric CAD commands you click in the toolbar. Every sketch, fillet, hole, and pattern lands on a real feature timeline you can inspect and edit by hand.

That setup is great for hobbyists. If you own a 3D printer, tinker with ESP32 or Raspberry Pi boards, build robotics mounts, or just want a custom bracket for a shelf, you rarely want to spend a weekend relearning Fusion or FreeCAD menus. You want a clean, dimensioned part you can tweak and slice.

In this tutorial we'll connect an AI agent to SolidCraft, see the four ways to drive it, and build three real hobbyist parts from scratch: a vented electronics enclosure, a parametric under-desk cable comb, and a NEMA 17 stepper motor mount with 3D-printable counterbore bridges.

## Why parametric CAD works better with AI than mesh generators

AI 3D generators that spit out an STL or OBJ mesh are fine for figurines. They fall apart the moment a part has to fit around a real USB-C plug, a 25 mm desk, or four M3 screws spaced 31 mm apart.

SolidCraft works with exact **B-rep** (boundary representation) solids and named **parameters**. When an agent builds a box in SolidCraft, it does not push triangles around. It defines `L = 74 mm`, `W = 52 mm`, and `wall = 2.4 mm`, sketches a rectangle tied to those names, extrudes it, rounds the corners, and shells the inside.

Change `L` to `96 mm` later and every standoff, wall, and cutout moves with it. You can also export an exact **STEP** file for CNC machining or another CAD tool, or tessellate it to **STL** and **3MF** for your slicer.

## Four ways to use AI with SolidCraft

SolidCraft ships both a desktop app (`SolidCraft`) and a companion CLI (`solidcraft-cli`) inside the same download. On macOS, the universal disk image for v0.49.1 is 491 MB and includes both binaries.

Depending on how you like to work, there are four ways to combine SolidCraft with AI:

| Workflow | How you run it | Best for | AI tokens per resize |
| --- | --- | --- | --- |
| Built-in Assistant | `Cmd+Shift+A` inside the desktop app | Interactive design, attaching photos or sketches, selecting a face and saying "fillet this" | Uses your local agent or API endpoint |
| Bridged MCP | `solidcraft-cli mcp --connect 127.0.0.1:27878` | Driving the live SolidCraft window from Claude Code, Cursor, or Codex while watching | Uses your MCP host |
| Headless MCP | `solidcraft-cli mcp --headless --allow-path DIR` | Automated modeling, testing parameter ranges, generating variants with no window | Uses your MCP host |
| CLI parameter overrides | `solidcraft-cli run --in part.sc --param ...` | Re-exporting an existing AI-built `.sc` design in new sizes | Zero |

The combination of the first three and the fourth is what makes the workflow shine. You spend AI turns once to create a clean parametric `.sc` file. After that, generating five more sizes for different desks or boards is a one-line shell command.

## Setting up SolidCraft for AI agents

Download the installer for your system from [solidcraft.io/download](https://solidcraft.io/download). On macOS, opening the app links `solidcraft-cli` into `/opt/homebrew/bin` or `/usr/local/bin` (you can also run **Help > Install solidcraft-cli command**).

### Option 1: The built-in Assistant panel

Press `Cmd+Shift+A` on macOS (`Ctrl+Shift+A` on Windows and Linux) to open the Assistant side panel inside SolidCraft.

![SolidCraft desktop window with the built-in Assistant panel open on the right, showing agent setup commands, permission controls, and selection attachments](https://flaviocopes.com/images/solidcraft/assistant-panel.webp)

SolidCraft does not sell or proxy an AI subscription. The panel connects over ACP to coding agents you already run on your machine: Claude Code, Codex, Google Antigravity, OpenCode, Mistral Vibe, and xAI Grok. If an adapter is missing, the panel lists its install command with a Copy button. You can also point it at any OpenAI-compatible or Anthropic-compatible endpoint, including Ollama or LM Studio running locally.

Three controls at the bottom of the panel make hobbyist CAD much easier than pasting text into a chat window:

- The permission menu (`Ask`, `Edits`, `All`) controls whether the agent asks before running modeling commands.
- **Attach view** sends a snapshot of the 3D viewport with your prompt.
- **Attach selection** tells the agent the exact face or edge you clicked in the viewport, so you can click an inner rim and ask it to add a 1.5 mm chamfer.
- The **+** button lets you drop up to eight files onto a message: a reference photo, a napkin sketch, a datasheet, or an existing STEP/STL file you want to build an enclosure around.

### Option 2: Connecting Claude Code, Cursor, or Codex over MCP

If you already live inside Claude Code, Cursor, Codex, OpenCode, or Claude Desktop, SolidCraft ships an [MCP server](https://flaviocopes.com/what-is-mcp/) inside `solidcraft-cli`.

To preview what it would configure without changing any files, run `--dry-run`:

```bash
solidcraft-cli mcp setup --dry-run
```

On my Mac, `mcp setup` checks ten clients (`opencode`, `claude-desktop`, `claude-code`, `cursor`, `codex`, `gemini`, `copilot`, `windsurf`, `zed`, and `vscode`) and shows the exact JSON or TOML entry it will add. Drop `--dry-run` to write the config (it saves a `.bak` backup first), or add a single client manually in Claude Code:

```bash
claude mcp add solidcraft -- solidcraft-cli mcp --allow-path ~/cad-projects
```

Notice the `--allow-path` flag. By default, SolidCraft's MCP server sandboxes file access to its recovery directory, a temporary scratch folder, and folders of designs you already opened or saved. It refuses hidden folders like `~/.ssh` or `.env`. When I launched the headless server from the terminal, stderr printed the exact boundary:

```txt
solidcraft mcp: files limited to /Users/flaviocopes/Library/Application Support/SolidCraft/recovery, .../solidcraft-mcp-87151-1a1936a0 and the folders of designs opened or saved here (--allow-path DIR adds one, --allow-any-path lifts the limit)
```

If you want to watch the agent model live inside the desktop app instead of running headless, turn on **Preferences > Assistant > Agents through MCP > Let AI agents connect**. The app opens a localhost-only control port (`127.0.0.1:27878`) guarded by a per-launch token, and `solidcraft-cli mcp` finds it automatically.

## How an AI agent actually models in SolidCraft

When an MCP host starts `solidcraft-cli mcp --headless`, the server advertises **27 tools** over JSON-RPC 2.0. You can verify the handshake from the shell:

```bash
printf '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}\n{"jsonrpc":"2.0","method":"notifications/initialized"}\n{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}\n' \
  | solidcraft-cli mcp --headless
```

That returns protocol version `2025-06-18` and the full tool list:

- **Modeling:** `batch`, `execute`, `set_parameter`, `undo`, `redo`, `new_design`
- **Verification:** `measure`, `body_topology`, `check_parameters`, `screenshot`, `compare_picture`, `inspect_design`
- **Files and guidance:** `open`, `save`, `export`, `skill_reference`, `list_commands`, `describe_command`

Two details here are worth calling out because they solve the biggest headaches when agents write CAD.

First, SolidCraft embeds five [Agent Skills](https://flaviocopes.com/agent-skills/) right inside the binary (`solidcraft-modeling`, `solidcraft-editing`, `solidcraft-checking`, `solidcraft-mechanisms`, and `solidcraft-reporting`). An agent calls `skill_reference` once at the start of a session to learn the coordinate conventions, predictable sketch IDs, and known geometry traps without downloading 350 KB of command docs.

Second, `batch` is all-or-nothing. If step 9 in a 15-step modeling batch fails, SolidCraft rolls back steps 1 through 8 and returns `failed.index` and `failed.error`. The agent fixes that one parameter and retries cleanly instead of piling broken features on top of a half-built solid.

```mermaid
flowchart TD
  accTitle: How an AI agent builds and verifies a part in SolidCraft
  accDescr: The user describes a part with real measurements. The agent loads the built-in modeling skill, sends parametric commands in batches to the B-rep kernel, checks exact volume and bounding box with measure, inspects a GPU screenshot, tests parameter changes with check_parameters, and exports STL, 3MF, or STEP files.
  U[User prompt with caliper measurements] --> S[Agent reads skill_reference]
  S --> B[Send parametric commands via batch]
  B --> K{B-rep kernel rebuild}
  K -->|Step fails| R[Automatic rollback + error index]
  R --> B
  K -->|All steps pass| M[Verify with measure + GPU screenshot]
  M -->|Geometry off| B
  M -->|Looks right| P[Dry-run resize with check_parameters]
  P --> E[Save .sc and export .stl / .3mf / .step]
```

And headless screenshots run on your GPU when one is available. Running `solidcraft-cli gpu` on my MacBook Pro picked `Apple M4 Pro` over Metal (`renderer: "gpu"`), rendering a 1400×900 viewport PNG in 7 ms.

## Project 1: A parametric electronics enclosure

A common weekend 3D-printing project is an enclosure for an ESP32, a temperature sensor, or a small Raspberry Pi accessory. You measure the board with calipers, add wall clearance, place four mounting standoffs, cut a USB-C opening, and add ventilation slots.

Here is the kind of prompt that gives an agent everything it needs without making it guess:

```txt
Create a parametric electronics enclosure in SolidCraft:
- Outer dimensions: L=74 mm, W=52 mm, H=26 mm, wall=2.4 mm, corner_r=5 mm
- Fillet the four outer vertical corners, then shell open from the top face
- Add four internal corner standoffs (boss_d=6.5 mm, boss_h=6 mm, inset=8 mm from each outer edge) with 2.4 mm pilot holes for M2.5 screws
- Cut a USB-C port (usb_w=11 mm, usb_h=6.5 mm) centered on the +X wall at height wall + boss_h
- Cut 7 vertical vent slots (2.6 mm × 10 mm, 6 mm spacing) on the front -Y wall
- Verify with measure and a screenshot, then test resizing to 96 × 64 × 34 mm with check_parameters
```

Over MCP, the agent splits that into two `batch` calls: first the outer shell, then the standoffs and cutouts. Here is the first batch that creates the parameters, centered base sketch, extrusion, corner fillets, and shell:

```json
{
  "commands": [
    {"command": "parameters.add", "params": {"name": "L", "expression": "74 mm"}},
    {"command": "parameters.add", "params": {"name": "W", "expression": "52 mm"}},
    {"command": "parameters.add", "params": {"name": "H", "expression": "26 mm"}},
    {"command": "parameters.add", "params": {"name": "wall", "expression": "2.4 mm"}},
    {"command": "parameters.add", "params": {"name": "corner_r", "expression": "5 mm"}},
    {"command": "sketch.create", "params": {"plane": "XY", "name": "BaseSketch"}},
    {"command": "sketch.draw.dimensioned", "params": {
      "command": "sketch.rectangle.center",
      "params": {"center": [0, 0], "corner": [37, 26]},
      "dimensions": {"width": "L", "height": "W"}
    }},
    {"command": "sketch.finish", "params": {}},
    {"command": "solid.extrude", "params": {"distance": "H", "name": "OuterBox", "body_name": "Enclosure"}},
    {"command": "solid.fillet", "params": {
      "edges": [[37, 26, 13], [-37, 26, 13], [37, -26, 13], [-37, -26, 13]],
      "radius": "corner_r",
      "name": "OuterCorners"
    }},
    {"command": "solid.shell", "params": {
      "faces": [[0, 0, 26]],
      "thickness": "wall",
      "name": "HollowShell"
    }}
  ]
}
```

Notice that the outer corners are filleted *before* `solid.shell`. That way the inside corners automatically follow the outer radius with an even 2.4 mm wall thickness.

The second batch adds one standoff cylinder at `["L/2 - inset", "W/2 - inset", "wall"]`, cuts its M2.5 pilot hole, patterns both 2×2 with spacings `"L - 2*inset"` and `"W - 2*inset"`, cuts the USB-C opening on `+X`, and cuts the 7 vent slots on `-Y`.

When I ran both batches through `solidcraft-cli mcp --headless`, Stage 1 finished in 390 ms and Stage 2 finished in 774 ms. Opening the saved `enclosure.sc` file in the SolidCraft desktop app shows the finished part, the model browser on the left, and all ten timeline steps along the bottom:

![The parametric electronics enclosure open in SolidCraft, showing the rounded shell, seven side ventilation slots, USB-C cutout, internal mounting standoffs, and the feature history timeline at the bottom](https://flaviocopes.com/images/solidcraft/enclosure-app.webp)

Running `measure` over MCP confirms the part is a single closed solid before you slice it:

```json
{
  "name": "Enclosure",
  "closed": true,
  "faces": 67,
  "edges": 168,
  "volume_mm3": 22630.4,
  "area_mm2": 20030.0,
  "mass_g": 29.19,
  "bbox": {
    "min": [-37.0, -26.0, 0.0],
    "max": [37.0, 26.0, 26.0]
  }
}
```

### Testing a resize without touching the design

One of the best MCP tools in SolidCraft is `check_parameters`. It checkpoints the open design, applies a set of candidate parameter values in one rebuild, checks for broken features, measures the result, and rolls the design back to its original state.

I tested resizing the enclosure from `74 × 52 × 26 mm` to `96 × 64 × 34 mm`:

```json
{
  "set": {
    "L": "96 mm",
    "W": "64 mm",
    "H": "34 mm"
  }
}
```

It completed in 1,112 ms, recomputed 10 features, reported `errors: []`, and gave the exact new bounding box (`[-48, -32, 0]` to `[48, 32, 34]`), volume (`37,826.7 mm³`), and estimated filament mass (`48.80 g` at default `1.29 g/cm³` density).

### Comparing export formats and sizes

From the same `enclosure.sc` design, I exported four files to see how format and mesh quality affect size and speed:

| File | Format | Quality | File size | Export time | Best use |
| --- | --- | --- | --- | --- | --- |
| `enclosure.sc` | Native SolidCraft | Parametric | 137 KB | Saved | Editable source with full timeline |
| `enclosure.step` | STEP AP242 | Exact B-rep | 132 KB | 5 ms | CNC, FreeCAD, Fusion, sharing exact geometry |
| `enclosure.3mf` | 3MF | Standard | 338 KB | 347 ms | Bambu Studio, PrusaSlicer, OrcaSlicer |
| `enclosure-standard.stl` | Binary STL | Standard | 1.38 MB | 106 ms | Everyday 3D printing |
| `enclosure-fine.stl` | Binary STL | Fine | 4.36 MB | 295 ms | Tight curves and larger radii |

For 3D printing, 3MF is a clear winner here: less than a quarter the size of a standard STL and natively supported by every modern slicer.

## Project 2: A desk cable comb you can resize with zero AI tokens

Home organization is where parametric CAD pays off fast. You measure your desk thickness, count the cables hanging behind it, and print a C-clamp cable comb that slides right onto the edge.

I built a parametric cable comb in one 15-command batch (`271 ms`) driven by seven parameters:

- `desk_t = 25 mm` (desk thickness)
- `slots = 5` (unitless count of cable slots)
- `slot_w = 6.5 mm` (fits USB-C and power leads)
- `pitch = 13 mm` (spacing between slot centers)
- `wall = 4 mm`, `arm = 32 mm`, `tray = 22 mm`
- `width = slots * pitch + 14 mm` (computed automatically from the slot count)

The baseline 5-slot clamp for a 25 mm desk measured `79.0 mm` wide, `33.0 mm` tall, and `37,462.3 mm³` (`48.33 g`).

Now suppose you want a second one for a thicker 32 mm workbench that holds 7 cables instead of 5. Because the AI built a real parametric `.sc` file, you don't need to open a chat or spend a single token. You override the parameters directly with `solidcraft-cli run`:

```bash
solidcraft-cli run --in cable-comb.sc \
  --param desk_t="32 mm" \
  --param slots=7 \
  --out cable-comb-32mm-7slots.stl \
  --save cable-comb-32mm-7slots.sc
```

SolidCraft rebuilt the model with 7 rounded channels and a 32 mm jaw opening, updating the total width to `105.0 mm`, height to `40.0 mm`, volume to `52,475.2 mm³` (`67.69 g`), and exporting a 295 KB STL ready for the slicer:

![Headless GPU render of the resized 7-slot under-desk cable comb generated by overriding desk_t and slots on the command line](https://flaviocopes.com/images/solidcraft/cable-comb-7slots.webp)

You can wrap that command in a tiny shell loop and spit out an entire kit of 20 mm, 25 mm, 30 mm, and 35 mm clamps in two seconds.

## Project 3: A NEMA 17 motor mount with 3D-printable counterbores

Mechanical brackets, router jigs, and robotics adapter plates are full of tedious fastener math: clearance hole diameters, socket-head counterbore depths, and bolt-circle spacing.

SolidCraft's `solid.hole` command has ISO standards and 3D-printing helpers built right into the engine. For a NEMA 17 stepper motor adapter plate (`50 × 50 × 6 mm`, `22.5 mm` central pilot bore, `31 mm` bolt spacing), you don't look up M3 socket-head dimensions at all. You pass `clearance: "M3"` and `head: "ISO 4762"`, plus `bridge: "0.2 mm"`:

```json
{
  "command": "solid.hole",
  "params": {
    "sketch": "BoltPoint",
    "clearance": "M3",
    "fit": "normal",
    "head": "ISO 4762",
    "bridge": "0.2 mm",
    "name": "M3MountHole"
  }
}
```

That `bridge: "0.2 mm"` option is a classic 3D-printing trick built into a single parameter. Counterbored holes printed upside-down normally sag in mid-air because a circular overhang has nothing underneath it. SolidCraft automatically cuts two 0.2 mm sacrificial bridge steps below the counterbore floor (a straight slot, then a square) so your printer bridges cleanly in straight lines without supports. You poke through the thin layer with a screwdriver after printing.

Here is the GPU render of the completed NEMA 17 plate (`1,717 ms` build time, `11,918.5 mm³`, `55` faces, `15.37 g`). Zoom into the four counterbored M3 holes and you can see the sacrificial bridge geometry inside each one:

![Headless GPU render of the parametric NEMA 17 stepper motor adapter plate with a 22.5 mm pilot bore and four ISO 4762 M3 counterbored holes showing built-in 0.2 mm 3D-printing bridge layers](https://flaviocopes.com/images/solidcraft/nema17-mount.webp)

Exporting the plate gave a 64 KB `.sc` source, a 108 KB `.step` file for CNC machining, a 243 KB `.3mf`, and a 909 KB `.stl`.

## Other hobbyist workflows SolidCraft supports

Beyond the three parts above, a few built-in features are tailored for makers and small workshops:

- **KiCad PCB import:** SolidCraft can import KiCad boards directly so an agent can measure the real component heights and connector positions before building a matching case around them.
- **Modifying existing downloads:** You can import STEP, IGES, FreeCAD `.FCStd`, Rhino `.3dm`, and STL/3MF files. Closed straight-extrusion STLs can even be reconstructed back into editable parametric solids with `mesh.convert`.
- **Slicer-ready orientation:** Passing `lay_on_print_faces: true` to `file.export` automatically rotates parts onto their designated print face when writing STL or 3MF files.
- **Sheet metal and laser cutting:** SolidCraft includes flanges, bends, flat patterns, and current-view DXF export for laser cutters, vinyl cutters, and CNC routers.
- **Robotics assemblies:** Multi-part assemblies with joints can export to URDF and OpenUSD for robot simulators.

## Practical tips for prompting CAD agents

Running real builds in SolidCraft taught me a few habits that save wasted turns:

1. **Always start with calipers and millimeters.** Tell the agent exact measurements (`"wall 2.4 mm"`, `"M3 clearance"`, `"0.3 mm print tolerance around the PCB"`). Vague prompts like "make a sturdy box" produce arbitrary numbers that won't fit your hardware.
2. **Ask for named parameters up front.** If you tell the agent to put key dimensions in `parameters.add`, you can change them later in the GUI's Parameters dialog or from `solidcraft-cli run --param`. Plain hardcoded coordinates never update when you resize.
3. **Make the agent verify visually.** A feature can succeed with zero kernel errors and still put a cutout on the wrong side wall. When I first drafted the enclosure's vent slots on an offset `XZ` sketch plane, the cut extruded away from the wall into empty air. Checking the `measure` center of mass and an isometric `screenshot` caught it right away.
4. **Keep risky steps in their own batch.** Fillets along complex intersections and booleans between curved surfaces are where CAD kernels are pickiest. Put them in a separate batch so a failure does not roll back your sketches and base solid.

## How I would use it

I don't do mechanical CAD every day, so I forget half the keyboard shortcuts in traditional CAD apps between projects. That is the exact gap where SolidCraft + an agent makes sense, the same way [AI agents make existing software more useful](https://flaviocopes.com/good-software-and-agents/) when an app exposes a clean command layer. I saw the same pattern when [letting an agent edit my videos](https://flaviocopes.com/agent-video-editing/) through Borumi's MCP server.

If I were designing a custom desk accessory, a camera mount, or an enclosure for a small hardware project, I would connect Claude Code or Codex to SolidCraft over bridged MCP so I can watch the model appear live in the desktop window. I would let the agent scaffold the parameters, sketches, standoffs, and fastener holes in two or three batches, then take over with the mouse in SolidCraft to tweak a fillet, inspect clearances, and drag the timeline scrubber if something looked off.

Once the base design printed well, I would keep the `.sc` file in a small git folder alongside a short command showing the `--param` overrides. Anytime I needed a wider version or a different mounting spacing, I would regenerate the `.3mf` from the terminal without spinning up an agent.

### Where SolidCraft with AI is a poor fit

It helps to know what *not* to use it for:

- **Organic sculpting and miniatures:** Characters, tabletop minis, ergonomic handles with sculpted curves, and decorative statues belong in Blender, Nomad Sculpt, or ZBrush, not a parametric B-rep CAD tool.
- **Complex industrial assemblies:** SolidCraft is at v0.49.1 and moves fast, with 75 of 76 public reference parts matching analytic/FreeCAD oracle measurements. It is great for single parts and modest assemblies, not a 500-part production gearbox with strict enterprise PLM requirements.
- **Zero-verification printing:** An AI agent cannot hold a caliper against your circuit board or know your printer's exact horizontal expansion. Treat the agent as a fast CAD drafter, inspect every screenshot and `measure` output, and print a quick clearance test slice before committing to a six-hour print.

If you want to understand how the protocol behind `solidcraft-cli mcp` works under the hood, read [what MCP is](https://flaviocopes.com/what-is-mcp/) or walk through [building an MCP server in TypeScript](https://flaviocopes.com/build-mcp-server/).
