Skip to main content

dcc-mcp-openscad

DCC-MCP · OPENSCAD

Production OpenSCAD adapter for deterministic model inspection, validation, geometry export, and PNG rendering through DCC-MCP.

Parameterized OpenSCAD bracket moving through topology validation to a game-ready mesh

Illustrative workflow based on the live OpenSCAD → FreeCAD → Blender/Godot acceptance run; generated source is retained in docs/images/dcc-mcp-openscad-showcase-source.png.

Part of the DCC-MCP host matrix

dcc-mcp-openscad — OpenSCAD adapter for deterministic model validation, export, and rendering.

It is one of 47 host adapters in the DCC-MCP catalog. Every adapter speaks the same MCP protocol and builds on the same core runtime contract; each one exposes the tools its own host needs on top of that.

This block is generated from the catalog entry in dcc-mcp-catalog.yml. Re-run the generator after changing the catalog.

Capabilities

  • Detect the standalone OpenSCAD CLI and report version-specific capabilities.
  • Inspect modules, functions, variables, and include/use references without executing source.
  • Validate a parameterized model with structured warning/error diagnostics.
  • Export STL (explicit binary or ASCII), 3MF, AMF, OFF, CSG, DXF, SVG, PDF, and OpenSCAD diagnostic formats.
  • Render bounded PNG previews or full geometry renders with typed camera, projection, color-scheme, size, and parameter inputs.
  • Stage outputs atomically, read the artifact back to prove the write landed, and return file size plus SHA-256 provenance.

The adapter does not accept arbitrary OpenSCAD command-line arguments or raw -D expressions. JSON scalar/array parameters are encoded by the adapter.

Requirements

  • Python 3.7+
  • dcc-mcp-core 0.20.36+
  • OpenSCAD inside the verified compatibility matrix

Supported ranges are declared in compat_matrix.json and enforced before any tool runs: OpenSCAD 2021.01.x and 2026.09.x. A host outside the matrix is refused with an explicit error code rather than run unverified, and dcc-mcp-openscad doctor --json always reports the version it found together with that verdict.

On Windows, point to openscad.com when possible; if openscad.exe is configured and a sibling openscad.com exists, the adapter selects the console launcher automatically.

Runtime boundary

OpenSCAD is not a Python host and has no embedded interpreter for the adapter to run inside. The adapter is a Python process that supervises an openscad CLI child process:

host side (this adapter)               OpenSCAD side (child process)
-----------------------------------    ---------------------------------
external Python 3.7+                   `openscad` CLI executable
dcc_mcp_openscad.bridge                --version / --help probes
dcc_mcp_openscad._process              one supervised process tree per call,
                                       bounded by a single absolute deadline
dcc_mcp_openscad._probe_supervisor     owning the child's stdout/stderr files

What follows from that boundary:

  • The Python version that matters is the host-side one that owns the wheel. There is no second interpreter, so there is no host/embedded version mismatch to diagnose.
  • Every CLI call is a fresh process with a bounded deadline: no persistent session, no in-process state, no shared memory.
  • Arguments cross the boundary as an argument vector, never through a shell, so a model path or parameter is never interpreted as shell syntax.
  • Results come back as files plus bounded captured output, and a mutating tool re-reads the artifact to prove the write landed (see docs/write-contract.md).

Install

See install.md for wheel-only setup, platform discovery, the official six-verb Install SOP lifecycle, ownership receipts, rollback, and troubleshooting.

python -m pip install dcc-mcp-openscad
dcc-mcp-openscad doctor --json
dcc-mcp-openscad install --yes --json
dcc-mcp-openscad

For an explicit standalone readiness check:

dcc-mcp-openscad verify --executable "C:\Program Files\OpenSCAD\openscad.com" --json

For development:

python -m pip install -e ".[dev]"
python -m pytest

Configuration

Variable Purpose Default
DCC_MCP_OPENSCAD_EXECUTABLE Exact OpenSCAD executable or install directory PATH and standard install locations
DCC_MCP_OPENSCAD_ALLOWED_ROOTS os.pathsep-separated source/output roots server working directory
DCC_MCP_OPENSCAD_MAX_SOURCE_BYTES Maximum source size 4 MiB
DCC_MCP_OPENSCAD_MAX_TIMEOUT_SECS Maximum per-call deadline 1800 seconds
DCC_MCP_OPENSCAD_PORT Fixed adapter port when direct addressing is required OS-assigned

The service registers as a standalone DCC-MCP instance. It has no bound GUI PID and needs no OpenSCAD window.

Agent workflow

Use the standard discovery path:

dcc-mcp-cli list
dcc-mcp-cli search --query "OpenSCAD validate export STL"
dcc-mcp-cli load-skill openscad-pipeline --dcc-type openscad --instance-id <instance-short>
dcc-mcp-cli describe openscad.<instance-short>.openscad_pipeline__validate_model

Then call inspect_source → validate_model → export_model or render_preview. Long calls are asynchronous and should be polled through the core job tools returned by the call.

examples/production_smoke.scad is a parameterized enclosure used by the live acceptance test. Override width, depth, height, wall, corner_radius, or vent_count to verify safe parameter encoding and reproducible artifacts.

Safety contract

  • Source and output paths must remain under configured allowed roots.
  • Existing outputs are never replaced unless overwrite=true is explicit.
  • Exports use sibling temporary files and become visible only after success.
  • A mutating tool returns only after re-reading the artifact and proving the write landed; a mismatch is an explicit error naming the expected and actual values instead of a reported success.
  • Parameter names, values, nesting, count, image dimensions, formats, and deadlines are bounded.
  • Cancellation and timeouts terminate the owned OpenSCAD child process.
  • Captured process output is limited to 64 KiB per stream.

Verification

CI installs a real OpenSCAD for every supported range -- each binary pinned by version and SHA-256 -- and runs the end-to-end case that validates, exports STL, and renders PNG. The job fails if that case is skipped, so a missing host cannot look like a pass. See install.md for the ranges and the error codes.

OpenSCAD CLI reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_OpenSCAD_in_a_command_line_environment

Metadata

Release files for dcc-mcp-openscad 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dcc-mcp-openscad 0.4.1
File Size Uploaded
dcc_mcp_openscad-0.4.1.tar.gz 85.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dcc-mcp-openscad 0.4.1
File Interpreter ABI Platform
dcc_mcp_openscad-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 137.5 kB

Release files / dcc_mcp_openscad-0.4.1.tar.gz

Download URL dcc_mcp_openscad-0.4.1.tar.gz
Size 85.4 kB
Tags Source
SHA-256 checksum
How to use checksums
5293f8cc2dbcfc995b3c8255bdaae5ddbd9fd1e1f1949690bd5e26faf925dd46
BLAKE2b-256 checksum
How to use checksums
6b84c3dfa0a5c8675bd825a3c07c895aa8c5494f75434fc7ef4a0dc1e2eec312
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 13, 2026.

Transparency log

Release files / dcc_mcp_openscad-0.4.1-py3-none-any.whl

Download URL dcc_mcp_openscad-0.4.1-py3-none-any.whl
Size 52.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
665d1779b3c454c5715c543dbcc61512053fb05340f4d6ac07c902d2d18db0f5
BLAKE2b-256 checksum
How to use checksums
6691a78f3c7119baf305df04c9259fe8da3b43b748b1c52c846efd7d85461cc3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 13, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page