openscad-wasm-mcp

OpenSCAD for AI agents, no native install

An MCP server that runs OpenSCAD through WebAssembly in Node.js. Ask an agent for a model, get a preview link and printable STL.

From prompt to print

One conversation, a printable model

Connect the server to an MCP client, describe what you want, and walk the result from chat to slicer.

01

Ask the agent

Describe a part in natural language. The agent writes OpenSCAD and calls the MCP tools.

Hermes Agent chat creating a 3D rabbit model
02

Preview in the browser

Interactive STL viewer links let you rotate and zoom before you download.

Interactive 3D preview of an exported STL model
03

Open the SCAD source

Download the generated .scad and open it in desktop OpenSCAD.

Generated SCAD source and preview in OpenSCAD
04

Slice and print

Download the STL directly and load it in your slicer.

Exported STL loaded in PrusaSlicer for 3D printing

WASM OpenSCAD, MCP-shaped

Built for agents that need real geometry tools, not screenshots of a CAD UI.

No host OpenSCAD binary

Runs openscad-wasm in Node.js. Docker Compose is enough to start.

Allowlisted tool surface

Validate, export, preview, analyze, and manage workspace files. No shell, no raw CLI args.

Preview links built in

Opaque tokens serve an interactive Three.js viewer from the same HTTP server.

Hardened by default

Path safety, size limits, timeouts, concurrency caps, and a locked-down Compose setup.

What agents can call

Structured tools with Zod-validated inputs and artifact metadata in responses.

  • openscad_validate Validate SCAD and return diagnostics
  • openscad_export_model Export stl, 3mf, off, csg, dxf, or svg
  • openscad_render_preview Interactive 3D preview link or WebP mesh preview
  • openscad_create_preview_link Create a browser STL viewer link
  • openscad_analyze_model Bounding box and triangle count from STL
  • workspace_* List, read, write, and delete workspace files

Up in one Compose command

The service listens on http://127.0.0.1:3333/mcp. Point your MCP client at that URL.

docker compose up --build

Optional MCP_AUTH_TOKEN protects /mcp with a Bearer token. See the README for Hermes and other clients.

Build models with your agent

Clone the repo, start Compose, and connect an MCP client. MIT-licensed project source.

Open repository