OpenSCAD MCP Server

A Model Context Protocol (MCP) server that lets AI
assistants design 3D-printable parts and assemblies in OpenSCAD:
render with a stated scale, measure exact geometry, check assemblies for interference
and clearance, extract holes and features, judge printability, and export. Built with
FastMCP for Python; OpenSCAD 2021.01 is the supported floor
and dev snapshots are used when present.
Prerequisites
- OpenSCAD installed on your system
- uv (recommended) or Python 3.10+
Installation
The server is published on PyPI as openscad-mcp, so uv
runs it with no clone and no virtualenv: uvx openscad-mcp. uv keeps a cached
copy; uv tool upgrade openscad-mcp (or uvx openscad-mcp@latest) pulls a
new release, and uvx [email protected] pins one.
Claude Code
Add the server with a single command:
claude mcp add openscad --transport stdio -- uvx openscad-mcp
Or, if OpenSCAD is not on your PATH:
claude mcp add openscad --transport stdio \
--env OPENSCAD_PATH=/path/to/openscad -- uvx openscad-mcp
Use the --scope flag to control where the configuration is saved:
| Scope | Flag | Effect |
|---|
| Local (default) | --scope local | Available only to you in the current project |
| Project | --scope project | Shared with the team via .mcp.json |
| User | --scope user | Available to you across all projects |
The repository is also a Claude Code plugin (skill plus server):
/plugin marketplace add robertcoop/openscad-mcp then
/plugin install openscad-mcp@openscad-mcp.
Claude Desktop
Add to your configuration file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"openscad": {
"command": "uvx",
"args": ["openscad-mcp"],
"env": {
"OPENSCAD_PATH": "/usr/bin/openscad"
}
}
}
}
Then restart Claude Desktop.
Cursor / Windsurf / VS Code
Add a .mcp.json file to your project root:
{
"mcpServers": {
"openscad": {
"command": "uvx",
"args": ["openscad-mcp"]
}
}
}
Manual / Standalone
# From PyPI (no install required)
uvx openscad-mcp
# The development version, straight from GitHub
uvx --from git+https://github.com/robertcoop/openscad-mcp.git openscad-mcp
# Or clone and run locally
git clone https://github.com/robertcoop/openscad-mcp.git
cd openscad-mcp
uv run openscad-mcp
# Run an assembly check file from a shell or a Makefile (exit code 0/1/2)
uvx openscad-mcp check checks.yaml --allow /path/to/project
Available Tools
Every tool response carries errors, warnings and hints parsed from
OpenSCAD's output. Check them: OpenSCAD exits 0 on a failed assert() or an
unknown module and draws a blank scene.
Rendering
| Tool | Description |
|---|
render | Images with a text digest before each one (camera, view direction, scale, bbox). mode=views (one image per view, or a custom camera), mode=section (exact cross-section with a scale bar), mode=parts (each part in its own colour, isolate ghosts the rest), mode=compare (before/after). grounded=true gives an orthographic view with a stated mm/px scale; annotate=true adds a scale bar, axis triad and bbox dimensions |
Assemblies
| Tool | Description |
|---|
check | Relations between named parts, exported separately and never unioned: mode=interference (clear / contact / interference with penetration depth and a witness point), clearance (exact minimum distance with closest points), contact (area, normal, plane; `kind=static |