OpenSCAD MCP Server logo

OpenSCAD MCP Server

Community
jhacksman

Devin's attempt at creating an OpenSCAD MCP Server that takes a user prompt and generates a preview image and 3d file.

Publisherjhacksman
RepositoryOpenSCAD-MCP-Server
LanguagePython
Forks
31
Stars
194
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    OpenSCAD MCP Server exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    194 stars and 31 forks from the linked repository.

OpenSCAD MCP Server

A local MCP server that turns OpenSCAD source or explicit primitive dimensions into editable SCAD, STL geometry, and four PNG previews. The connected assistant can write SCAD for complex designs; this server compiles and renders it with the installed OpenSCAD executable.

Status: the supported implementation is in src/openscad_mcp. The previous image generation, CUDA reconstruction, remote processing, and printer code is archived in legacy/. It is unfinished and is not part of the installed server. See the audit and machine test results.

Install

Requires Python 3.11+ and OpenSCAD. No API keys, CUDA, Open3D, or separate image renderer are required.

Install OpenSCAD using the official downloads. On macOS, the current native Apple Silicon/Intel build is available with:

sh
brew install --cask openscad@snapshot
openscad --version

On Debian/Ubuntu, sudo apt-get install openscad installs the distribution package. Linux PNG rendering may need an X display; use xvfb-run -a around the server or tests on a headless machine. Windows users can set OPENSCAD_EXECUTABLE to the full path of openscad.exe.

sh
git clone https://github.com/jhacksman/OpenSCAD-MCP-Server.git
cd OpenSCAD-MCP-Server
uv sync --locked
uv run openscad-mcp --help

Alternatively, install into a virtual environment with python -m pip install . and run openscad-mcp. requirements.txt installs this same package. uv.lock pins the tested dependency resolution; the project metadata permits compatible updates.

On an external filesystem that cannot create symlinks, put the environment on the internal disk:

sh
export UV_PROJECT_ENVIRONMENT="$HOME/.cache/openscad-mcp-venv"
uv sync --locked

Docker and Jetson

A headless stdio image is available through the root Dockerfile. See Docker setup and verification for build commands, MCP client configuration, persistent model storage, and Glama listing requirements. The image needs no GPU.

For the hardware question in issue #19, see Jetson Orin Nano and CUDA. The supported server does not use CUDA; the archived reconstruction prototype is not restored by this Docker support.

Connect an MCP client

Stdio is the default. Configure the client to launch the server process, using absolute paths:

json
{
  "mcpServers": {
    "openscad": {
      "command": "/absolute/path/to/venv/bin/openscad-mcp",
      "args": ["--output-dir", "/absolute/path/to/models"]
    }
  }
}

For clients supporting Streamable HTTP:

sh
uv run openscad-mcp --transport http --port 8000

The MCP endpoint is http://127.0.0.1:8000/mcp. / is server information; /health reports the OpenSCAD version and primitive defaults. HTTP also serves preview pages and downloads. In stdio mode, use returned absolute file paths or get_model_preview; there is no HTTP listener.

Tools

ToolPurpose
get_capabilitiesOpenSCAD version and supported primitives with default parameters
create_3d_modelCreate a primitive using model_type and parameters, or a limited description
create_model_from_scadCompile trusted scad_code for a custom 3D model
modify_3d_modelChange primitive parameters or replace a model's scad_code
get_modelRead a saved model and its artifact paths
get_model_sourceRead saved SCAD source and its revision, including inside Docker
get_model_previewReturn a PNG image as MCP image content
export_modelExport scad, stl, csg, or 3mf

Example arguments to create_3d_model:

json
{
  "model_type": "box",
  "parameters": {"width": 40, "depth": 30, "height": 20, "thickness": 2}
}

Dimensions are in millimeters. Supported types: cube (also rectangular blocks), sphere, cylinder, box (open hollow box), rounded_box (solid), tube, cone, torus, prism (right triangular cross-section), hexagonal_prism, and text. Call get_capabilities for each type's exact parameter names. A torus uses the radius to the tube center (major_radius) and the tube radius (minor_radius).

The optional description parser recognizes named dimensions such as hollow box width 40 mm depth 30 mm height 20 mm thickness 2 mm or cube 2 cm wide 1 inch high. It supports mm, cm, m, and inches; omitted units mean mm. It is a small parser, not a general natural-language model. Unspecified dimensions use the returned defaults. Prefer explicit parameters for precision. For arbitrary objects, have the assistant write self-contained SCAD and call create_model_from_scad.

json
{
  "scad_code": "difference() { cube([40,30,8]); translate([20,15,-1]) cylinder(h=10,r=5,$fn=48); }",
  "description": "Mounting plate with a through hole"
}

To modify a primitive:

json
{"model_id": "ID_FROM_CREATION", "parameters": {"height": 25}}

For custom models, call get_model_source with the model ID to retrieve scad_code and revision directly through MCP. Edit the returned source, then call modify_3d_model with the new scad_code and expected_revision set to the revision you read. No access to the server's filesystem is needed to read the source.

The same optional revision check works for primitive parameter edits:

json
{
  "model_id": "ID_FROM_CREATION",
  "parameters": {"height": 25},
  "expected_revision": "REVISION_FROM_GET_MODEL"
}

If another edit has already committed, the operation fails before rendering or changing files. MCP reports a tool error; the HTTP /tool_call API returns 409 with current_revision. Read the latest source/parameters and incorporate the intervening changes before retrying. Omitting expected_revision preserves the original unconditional edit behavior.

Only SCAD retains editable source parameters. CSG is an evaluated geometry tree. STL and 3MF are meshes; they do not preserve the design's parametric relationships. AMF (removed in current OpenSCAD builds), STEP, OBJ, 2D exports, image reconstruction, and printing are not offered.

HTTP smoke test

With the HTTP server running:

sh
curl --fail http://127.0.0.1:8000/tool_call \
  -H 'Content-Type: application/json' \
  -d '{"tool_name":"create_3d_model","tool_params":{"model_type":"box","parameters":{"width":40,"depth":30,"height":20,"thickness":2}}}'

Open the returned preview_url on the same server. Download /download/MODEL_ID?format=stl or ?format=scad. /tool_call is a convenience JSON API, separate from the actual MCP protocol at /mcp. Image retrieval over this API uses /preview/VIEW/MODEL_ID.

Behavior and limits

  • Creation succeeds only after a real STL and all four PNGs have been generated. Renderer failures, empty output, and OpenSCAD warnings/errors are reported as failures; no placeholder geometry or preview is substituted.
  • Edits create a new revision and update the manifest only after successful rendering. Earlier revisions remain on disk. Models survive server restarts.
  • Default storage is ~/.local/share/openscad-mcp/models. Override with --output-dir or OPENSCAD_OUTPUT_DIR. Each render subprocess has a 120-second timeout, configurable with --timeout. A model requires five subprocesses, so the total request can take longer.
  • Run one server process per output directory. Renders and edits are serialized. There is no automatic disk cleanup, distributed job queue, or multi-process store coordination.
  • This is a trusted local tool. Custom SCAD executes with the current user's file access, including OpenSCAD import, include, and use; it is not sandboxed. HTTP binds to loopback and rejects non-local Host/Origin headers. There is no authentication or supported public/LAN deployment.
  • Tested locally on macOS arm64 and in Ubuntu 24.04 CI under Xvfb. Windows and other platform/display combinations are unverified. No hardware printer or remote GPU was exercised.

Development and verification

sh
uv sync --locked --group dev
uv run ruff check src/openscad_mcp tests scripts
uv run ruff format --check src/openscad_mcp tests scripts
uv run pytest -q

The full suite requires OpenSCAD and fails if it is unavailable. Tests launch real stdio and HTTP server processes, use the official MCP client, download exports, decode PNGs, inspect mesh topology/dimensions/volume, test persistence and failed edits, and exercise invalid requests. uv run pytest -m 'not integration' runs the unit checks only and does not establish end-to-end correctness.

License

MIT, copyright 2026 Jack Hacksman.

Installation

TypingMind
{
  "mcpServers": {
    "openscad-mcp-server": {
      "command": "openscad-mcp",
      "args": [
        "--output-dir",
        "/absolute/path/to/models"
      ]
    }
  }
}

Use OpenSCAD MCP Server MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once OpenSCAD MCP Server is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add OpenSCAD MCP Server as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the OpenSCAD MCP Server MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "openscad-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the OpenSCAD MCP Server MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the OpenSCAD MCP Server MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use OpenSCAD MCP Server to help me with this task?
OpenSCAD MCP Server
Sure. I read it.
Here is what I found using OpenSCAD MCP Server.

Frequently asked questions

What is the OpenSCAD MCP Server MCP server used for?

OpenSCAD MCP Server is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use OpenSCAD MCP Server MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use OpenSCAD MCP Server with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use OpenSCAD MCP Server MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With OpenSCAD MCP Server connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect OpenSCAD MCP Server MCP to TypingMind?

OpenSCAD MCP Server runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does OpenSCAD MCP Server MCP provide in TypingMind?

OpenSCAD MCP Server exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use OpenSCAD MCP Server MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If OpenSCAD MCP Server requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇