openscad-mcp-server
An MCP server that gives LLMs the ability to design, build, and visually verify 3D models using OpenSCAD — all through natural conversation.
The server handles the entire workflow: discovering and downloading OpenSCAD libraries on demand, saving code, compiling STL files in Docker/Finch containers, rendering 8-angle inspection images, and returning those images directly to the LLM's vision model as inline base64 PNGs. A built-in workflow prompt guides the LLM through systematic per-angle inspection with confidence scoring, so it catches defects before declaring a model complete.
Why this exists
LLMs can write OpenSCAD code, but they can't run it, see the result, or iterate on mistakes. This server closes that loop. The LLM writes code, the server compiles and renders it in a container, and the LLM sees the rendered model from 8 angles — then decides whether to fix issues or finalize.
Key design choices:
- Vision-native: Rendered images come back as MCP
ImageContentblocks, not file paths. The LLM sees the model directly. - Zero config: The
inittool auto-detects Docker or Finch and uses the current working directory so files are visible in your IDE. Settings are persisted via the LLM's memory mechanism. No env vars or config files needed. - Library-aware: Libraries are discovered from the official OpenSCAD catalog and downloaded on demand. The server enforces that the LLM reads library source code before using it — no guessing at APIs.
- Correctness-first: The workflow prompt requires per-angle confidence scoring (overall = min of all angles) and forbids declaring a model complete below 0.5 confidence.
Quick start
Prerequisites
Run with uvx (no install needed)
uvx openscad-mcp-server
Or install and run
pip install openscad-mcp-server
openscad-mcp-server
The server communicates over stdio, so it's meant to be launched by an MCP client (Claude Desktop, Kiro, etc.), not run interactively.
The server uses the official openscad/openscad Docker Hub image for both STL compilation and rendering. It's pulled automatically on first use — no manual image builds needed.
MCP client configuration
Kiro
Add to .kiro/settings/mcp.json:
{
"mcpServers": {
"openscad": {
"command": "uvx",
"args": ["openscad-mcp-server"]
}
}
}
Claude Desktop
Add to your Claude Desktop config:
{
"mcpServers": {
"openscad": {
"command": "uvx",
"args": ["openscad-mcp-server"]
}
}
}
The server auto-detects the workspace directory from its process working directory. If your MCP client doesn't set the cwd to the workspace folder, you can override it with the OPENSCAD_WORKSPACE environment variable in your MCP config:
{
"mcpServers": {
"openscad": {
"command": "uvx",
"args": ["openscad-mcp-server"],
"env": {
"OPENSCAD_WORKSPACE": "/path/to/your/project"
}
}
}
}
Tools
The server exposes 14 tools:
| Tool | Description |
|---|---|
init |
Auto-detect Docker/Finch, use current working directory, return persistence content |
save-code |
Save OpenSCAD code to the working area (enforces library review) |
check-syntax |
Fast syntax validation without full STL compilation |
build-stl |
Compile .scad → .stl in a container (returns mesh metadata) |
measure-stl |
Parse an STL file and return dimensional metadata without rendering |
render-images |
Render STL from 8 camera angles (or selective via angles param), return inline base64 PNG images |
browse-library-catalog |
Fetch the official OpenSCAD library listing |
fetch-library |
Download a library from its source repository |
read-library-source |
Read library module signatures and file listing (compact overview, no full source) |
read-library-file |
Read the source of a specific file or module from a fetched library |
list-reviewed-libraries |
Show which libraries have been reviewed this session |
submit-feedback |
Record user feedback with artifact snapshots and confidence data |
list-feedback |
List all feedback records for analysis |
finalize |
Copy working area artifacts to the final output directory |
Resources
| Resource | URI | Description |
|---|---|---|
| Syntax Reference | openscad://syntax-reference |
OpenSCAD language reference (primitives, transforms, booleans, modules) |
| Library Reference | openscad://library-reference/{name} |
Dynamic reference generated from fetched library source |
| Common Pitfalls | openscad://pitfalls |
Manifold errors, z-fighting, boolean order, missing $fn, etc. |
Prompts
| Prompt | Description |
|---|---|
openscad-workflow |
Full step-by-step workflow: init → library discovery → code → build → render → inspect → iterate → finalize |
How the workflow works
User: "Make me a phone stand with a 75° angle"
│
▼
┌─────────────────────────────────────────────┐
│ 1. init → detect Docker/Finch │
│ 2. browse-catalog → find relevant libraries │
│ 3. fetch-library → download BOSL2 │
│ 4. read-source → understand the API │
│ 5. save-code → write OpenSCAD code │
│ 6. build-stl → compile to STL │
│ 7. render-images → 8 angles, inline PNGs │
│ 8. inspect → per-angle confidence │
│ 9. iterate → fix issues, re-render │
│ 10. finalize → copy to output dir │
└─────────────────────────────────────────────┘
│
▼
Output: model.stl + model.scad + 8 inspection images
The LLM inspects each rendered angle individually, assigns per-angle confidence scores, and computes the overall confidence as the minimum across all angles. If any angle scores below 0.5, the LLM must iterate before finalizing.
Artifact layout
your-project/
├── working/ # Latest iteration (overwritten each cycle)
│ ├── model.scad
│ ├── model.stl
│ └── renders/
│ ├── front.png
│ ├── back.png
│ ├── left.png
│ ├── right.png
│ ├── top.png
│ ├── bottom.png
│ ├── front-right-top-iso.png
│ └── back-left-top-iso.png
├── output/ # Final output (populated on finalize)
├── libraries/ # Downloaded OpenSCAD libraries
└── feedback/ # User feedback records with artifact snapshots
Development
# Clone and install with test dependencies
git clone https://github.com/your-org/openscad-mcp-server.git
cd openscad-mcp-server
uv sync --extra test
# Run tests
uv run pytest tests/ -v
# Run with Hypothesis verbose output
uv run pytest tests/ -v --hypothesis-show-statistics
Test suite
The test suite includes 72 tests covering all 25 correctness properties from the design spec, validated with Hypothesis property-based testing:
- Save-code round trip and filename normalization
- Container command generation (runtime-agnostic)
- Mount correctness and error propagation
- Render output (8 angles, PNG format, MCP ImageContent blocks)
- Library catalog parsing, caching, and fetch error handling
- Feedback record completeness, index round trip, confidence disagreement
- Working area overwrite invariant and finalize correctness
- Session state tracking and confidence score computation
- Version-tag matching for release pipeline
- Server registration (tools, resources, prompts)
CI/CD
- PR merge → main: Automatically creates a git tag and GitHub release from the version in
pyproject.toml - Tag push (
v*): Builds and publishes to PyPI using trusted publishing (OIDC)
License
MIT
Metadata
Release files for openscad-mcp-server 0.15.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| openscad_mcp_server-0.15.1.tar.gz | 115.9 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| openscad_mcp_server-0.15.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 163.1 kB
Release files / openscad_mcp_server-0.15.1.tar.gz
| Download URL | openscad_mcp_server-0.15.1.tar.gz |
|---|---|
| Size | 115.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
55dedf883c17b9897e9379b697fcb9efd463b43bcf608f70d7760e8edd6116e0
|
|
BLAKE2b-256 checksum How to use checksums |
8a0674cbb3e065cae99414ec81eb268224c3ae0696869fe403dc5d11a44d1bd7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 19, 2026.
Transparency logRelease files / openscad_mcp_server-0.15.1-py3-none-any.whl
| Download URL | openscad_mcp_server-0.15.1-py3-none-any.whl |
|---|---|
| Size | 47.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
53163e355e6a99a903a6d7a4299945ef475fdcaf4c5f133d4b862b98cf78b79c
|
|
BLAKE2b-256 checksum How to use checksums |
89a26d7e9b8dd0708c871123e7b501007b8240ed10edb656e200e864bca8357b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 19, 2026.
Transparency logSecurity for openscad-mcp-server 0.15.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for openscad_mcp_server-0.15.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 19, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.