---
name: scaid
description: Preview, check and share OpenSCAD models with Scaid (https://scaid.studio). Use whenever you write, change or review OpenSCAD (.scad) code, or design anything meant to be 3D printed — enclosures, brackets, mounts, organizers, replacement parts — so the user gets a link to spin the model, tweak it, and export STL or 3MF.
---

# Scaid: see the OpenSCAD you write

Scaid (https://scaid.studio) is a free, public OpenSCAD editor and 3D viewer. There are no accounts and
nothing is stored: a design travels inside its link. Whenever you write or change OpenSCAD,
build it with Scaid and give the user the link.

## The loop

1. Write a complete, self-contained `.scad` program (rules below).
2. Build it: call the `preview_scad` MCP tool with `code` and a short `name`. It tells you
   whether it compiled (errors carry line numbers), what the model measures (size, volume,
   overhangs, whether it stands up), and returns `edit_url` and `view_url`.
3. If it didn't build, or the measurements don't match what you meant, fix it and build again
   before replying.
4. Reply with the `edit_url` (or `view_url` for look-only) as a clickable link. In the browser
   the user can spin and measure the model, cut it open, move parameter sliders, edit code,
   and download STL, 3MF or .scad.
5. If the user sends back a Scaid link, call `read_scad_link` first: they may have edited it.
   Change that version, not your last one.

Also write the program to a `.scad` file in the user's project when you're working in one.

## Writing OpenSCAD that builds here

- **No libraries.** No `include <...>` or `use <...>`: BOSL2, MCAD and friends aren't
  installed. Use the `list_patterns` / `get_pattern` tools for verified, self-contained
  fillets, threads, gears, snap fits, hinges, bearing seats and print-friendly holes, and paste
  the module code into the program.
- **No text().** The renderer has no fonts. Emboss lettering with simple geometry or leave it out.
- Millimeters, Z up, resting on the plate at Z = 0. Center on X/Y unless there's a reason.
- Put tunable values at the top as customizer parameters and they become sliders:

  ```openscad
  /* [Size] */
  width = 60;   // [20:1:150]
  wall = 2;     // [1:0.2:5]
  /* [Options] */
  lid = true;
  ```

- Keep `$fn` around 48-96 for final curves; lower it inside big `for` + `hull()` sweeps.
- Prefer `hull()` over `minkowski()` for rounding; it is far faster.
- For printability: 45 degree overhangs or less, teardrop holes on horizontal bores, at least
  0.2-0.4 mm clearance between parts that fit together.

## Without MCP

If the Scaid MCP server isn't connected, the HTTP API does the same job:

```bash
# Build an STL (or ?format=3mf) from a file
curl -sf -X POST "https://scaid.studio/api/export?format=stl" --data-binary @model.scad -o model.stl
```

And a link can be built locally — it's the source, deflate-compressed (raw, no zlib header)
and base64url-encoded, after `#code=`:

```bash
python3 -c 'import sys,zlib,base64,urllib.parse as u; c=zlib.compressobj(9,zlib.DEFLATED,-15); d=c.compress(open(sys.argv[1],"rb").read())+c.flush(); print("https://scaid.studio/#code="+base64.urlsafe_b64encode(d).decode().rstrip("=")+"&name="+u.quote(sys.argv[2] if len(sys.argv)>2 else ""))' model.scad "My part"
```

To connect the MCP server: `https://scaid.studio/mcp` (Streamable HTTP, no auth). Setup for each tool is at
https://scaid.studio/connect.
