mcpField
O
OpenSCAD

OpenSCAD

Local
github.comMedia & Design7Updated 5w ago

About OpenSCAD

OpenSCAD MCP Server renders PNG previews and exports STL geometry from SCAD source for agents and CAD workflows. It supports visual iteration as well as producing geometry artifacts for downstream use.

Key features

  1. 01Render PNG previews from SCAD
  2. 02Export STL geometry
  3. 03Set preview size and camera
  4. 04Includes iterative modeling skill

Use cases

  1. 01Review model shape during SCAD iteration
  2. 02Export geometry for fabrication or inspection
  3. 03Compare rendered parameter variants

MCP support

Exposes `render_scad_png` and `export_scad_stl` tools to MCP clients. Results are returned as image content and an embedded STL resource.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"fboldo-openscad": {
"command": "npx",
"args": [
"-y",
"openscad-mcp-server"
]
}
}
}
Run commandnpx -y openscad-mcp-server

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmopenscad-mcp-server1.0.6

Tools

2

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
widthnumberNoThe width of the output image in pixels (default: 800)
heightnumberNoThe height of the output image in pixels (default: 600)
scadCodestringYesThe OpenSCAD code to render
cameraPresetenumNoA named camera preset used when `cameraPosition` is not providedisometric | front | back | left | right | top | bottom
cameraPositionobjectNoCamera position as { x,y,z }. Example: { x: 0, y: -25, z: 20 }
cameraPosition.xnumberNoCamera X position
cameraPosition.ynumberNoCamera Y position
cameraPosition.znumberNoCamera Z position

Details

From the project README

OpenSCAD MCP Server

npm version npm downloads CI

An MCP (Model Context Protocol) server that renders PNG previews and STL geometry from OpenSCAD (SCAD) source code. It is designed to support iterative, agent-driven CAD workflows, where models can be previewed visually and exported for downstream use (e.g. fabrication, simulation, or inspection).

⚠️ Beta
This MCP server is currently in beta. Performance, APIs, and capabilities may change. Issues and contributions are welcome.

Use cases

  • Iterative agent-driven modeling
    Agents generate or modify OpenSCAD source, render PNG previews to evaluate shape and proportions, and refine the model across multiple turns.

  • Geometry artifact generation within MCP contexts
    Agents export STL files as concrete geometry artifacts that can be passed to downstream tools, stored, inspected, or handed off to other MCP-enabled systems.

  • Visual grounding for parametric design
    PNG previews provide visual grounding for parametric or programmatic SCAD code, reducing hallucination and enabling agents to reason about spatial changes.

  • Design validation and comparison
    Agents can render multiple variants of a model (e.g. parameter sweeps) and visually compare results before deciding which geometry to persist or export.

Available Tools

  • render_scad_png: Renders a PNG preview image from SCAD source.
    • Input: scadCode (string), optional width/height (numbers), optional cameraPreset and optional cameraPosition
      • cameraPreset: one of isometric, front, back, left, right, top, bottom
      • cameraPosition: { x, y, z }
    • Output: MCP ImageContent
  • export_scad_stl: Exports an STL generated from SCAD source.
    • Input: scadCode (string), optional filename (string)
    • Output: MCP embedded resource (STL)

Skill

This repository also includes an OpenSCAD iterative modeling skill that demonstrates how to use this MCP server to support an iterative SCAD → PNG → critique → refine loop.

Limitations

  • Performance: Rendering complex SCAD models can be slow, especially in a WASM environment.
  • Feature support: Not all OpenSCAD features may be fully supported or may have limitations in the WASM version.
  • Fonts: Text rendering is not currently supported. Support is planned for a future release.

Installation

The published package is intended to run over stdio. Configure it in your MCP client using npx:

{
  "mcpServers": {
    "openscad": {
      "command": "npx",
      "args": ["-y", "openscad-mcp-server"]
    }
  }
}

To run it over HTTP instead (e.g. in Docker), pass --http:

MCP_PORT=3000 npx -y openscad-mcp-server --http

The server exposes GET /health and a stateless streamable HTTP MCP endpoint at POST /mcp.

Using the Skill

Agents skills are a simple, open format for giving agents new capabilities and expertise.

The most straightforward to use the OpenSCAD iterative modeling skill is to install it using the skills CLI:

npx skills add fboldo/openscad-mcp-server --skill openscad-iterative-modeling

Local development

  • Install deps: bun install
  • Stdio (matches how clients run it): bun index.ts --stdio
  • HTTP (useful for manual testing): bun index.ts (or --http)
    • Port: MCP_PORT (default 3000)
    • Endpoints: GET /health, MCP at POST /mcp
  • MCP Inspector: bun run dev

Similar Projects

  • jhacksman/OpenSCAD-MCP-Server This project provides a different approach relying on generating images from user prompts, followed by 3D reconstruction and even 3D printer discovery. It's a very interesting project, and I recommend checking it out if you are interested in OpenSCAD and MCP servers.

  • petrijr/openscad-mcp Similar to this project, but it uses a Python-based server and relies on the OpenSCAD CLI for rendering.

Relevant Links

License

MIT — see LICENSE.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.