The OpenSCAD MCP Server enables AI assistants to render, export, analyze, and manage 3D models using OpenSCAD through a standardized protocol interface.
Rendering
Render single views with extensive camera control (position, target, up vector), image size, color schemes, view presets, and output format options
Render multiple standard perspectives (front, back, top, isometric, etc.) concurrently
Generate side-by-side before/after renders for visual comparison
Export & Model Management
Export models to STL, 3MF, AMF, OFF, DXF, or SVG
Create, read, update, list, and delete
.scadfiles in the workspace
Analysis & Validation
Validate OpenSCAD syntax without a full render, returning errors, warnings, and echo output
Analyze models to compute bounding box, dimensions, and triangle count
Discover installed OpenSCAD libraries
Verify OpenSCAD installation and retrieve version information
Project & Server Management
List project files with their
include/usedependency graphsClear the render cache
Security features include path validation, file size limits, variable name validation, and subprocess timeouts to prevent injection and abuse.
Provides 3D rendering capabilities for OpenSCAD models, including single view rendering with camera control, multiple perspective generation (orthographic and isometric views), and animation support for 360° model visualization.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@OpenSCAD MCP Serverrender a cube with dimensions 50x50x50 from a 45-degree angle"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
OpenSCAD MCP Server
A Model Context Protocol (MCP) server that gives AI assistants the ability to render, export, and analyze 3D models using OpenSCAD. Built with FastMCP for Python.
Prerequisites
Related MCP server: OpenSCAD MCP Server
Installation
Claude Code
Add the server with a single command:
claude mcp add openscad --transport stdio -- \
uv run --with git+https://github.com/quellant/openscad-mcp.git openscad-mcpOr, if OpenSCAD is not on your PATH:
claude mcp add openscad --transport stdio \
--env OPENSCAD_PATH=/path/to/openscad -- \
uv run --with git+https://github.com/quellant/openscad-mcp.git openscad-mcpUse the --scope flag to control where the configuration is saved:
Scope | Flag | Effect |
Local (default) |
| Available only to you in the current project |
Project |
| Shared with the team via |
User |
| Available to you across all projects |
Claude Desktop
Add to your configuration file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"openscad": {
"command": "uv",
"args": [
"run",
"--with", "git+https://github.com/quellant/openscad-mcp.git",
"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": "uv",
"args": [
"run",
"--with", "git+https://github.com/quellant/openscad-mcp.git",
"openscad-mcp"
]
}
}
}Manual / Standalone
# Run directly from GitHub (no install required)
uv run --with git+https://github.com/quellant/openscad-mcp.git openscad-mcp
# Or clone and run locally
git clone https://github.com/quellant/openscad-mcp.git
cd openscad-mcp
uv run openscad-mcpAvailable Tools
Rendering
Tool | Description |
| Render a single view with camera control, quality presets, and view presets |
| Render multiple standard views (front, back, left, right, top, bottom, isometric) in parallel |
| Side-by-side before/after renders for visual comparison |
Export & Model Management
Tool | Description |
| Export to STL, 3MF, AMF, OFF, DXF, or SVG |
| Create a new |
| Read a model file and its metadata |
| Update an existing model's content |
| List all models in the workspace |
| Delete a model file |
Analysis & Validation
Tool | Description |
| Syntax-check code without a full render (errors, warnings, echo output) |
| Compute bounding box, dimensions, and triangle count via STL export |
| Discover installed OpenSCAD libraries |
| Verify OpenSCAD installation and version |
Project Support
Tool | Description |
| List |
| Clear the render cache |
Usage Examples
Once connected, ask your AI assistant:
"Render a cube with rounded edges"
"Show me this model from all angles"
"Export my gear model to STL"
"Compare the model before and after changing the radius to 15"
"Validate this OpenSCAD code for errors"
"What are the dimensions of this model?"
Tool Parameters
render_single
Parameter | Type | Default | Description |
| string | — | OpenSCAD code to render* |
| string | — | Path to |
| string | — | Preset view: |
| list/string |
| Camera eye position |
| list/string |
| Camera look-at point |
| list/string |
| Output dimensions |
| string |
| OpenSCAD color scheme |
| dict |
| OpenSCAD |
| string | — |
|
| list | — | Extra |
| string |
|
|
*Exactly one of scad_content or scad_file must be provided.
All parameter parsers accept multiple input formats (JSON strings, lists, dicts, CSV) for AI assistant compatibility.
Configuration
Environment Variables
Variable | Description | Default |
| Path to OpenSCAD executable | Auto-detected |
| Temporary file directory |
|
| Transport type: |
|
| Host for HTTP/SSE transport |
|
| Port for HTTP/SSE transport |
|
| Max parallel renders |
|
| Render timeout in seconds |
|
| Enable render caching |
|
| Max cache size in MB |
|
| Cache TTL in hours |
|
| Logging level |
|
| Max SCAD file size |
|
YAML Configuration
Create a config.yaml for advanced configuration:
server:
name: "OpenSCAD MCP Server"
version: "0.1.0"
transport: stdio
rendering:
max_concurrent: 5
timeout_seconds: 300
default_color_scheme: Cornfield
cache:
enabled: true
max_size_mb: 500
ttl_hours: 24
security:
rate_limit: 60
max_file_size_mb: 10
allowed_paths: null # null = no restrictionsSecurity
Path validation:
scad_fileandinclude_pathsvalidated against configurableallowed_pathsFile size limits: Content checked against
max_file_size_mbVariable name validation: Only
^[a-zA-Z_][a-zA-Z0-9_]*$allowed (prevents injection)Subprocess timeout: Configurable, default 300s
Model name validation: Alphanumeric, hyphens, and underscores only; no path traversal
Development
# Clone the repo
git clone https://github.com/quellant/openscad-mcp.git
cd openscad-mcp
# Install dependencies
uv sync --dev
# Run the server
uv run openscad-mcp
# Run tests
uv run pytest
# Lint & format
uv run ruff check src/ tests/
uv run black --check src/ tests/
# Type check
uv run mypy src/Project Structure
openscad-mcp/
├── src/openscad_mcp/
│ ├── __init__.py # Package exports
│ ├── server.py # FastMCP server, all MCP tools and helpers
│ ├── types.py # Pydantic models and enums
│ └── utils/
│ └── config.py # Configuration with env/YAML/dotenv support
├── tests/ # 300 tests, 80%+ coverage
├── pyproject.toml
└── README.mdTesting
# Run all tests with coverage
uv run pytest
# Run specific markers
uv run pytest -m unit
uv run pytest -m performance
# Run a single file
uv run pytest tests/test_helpers.py -vTests mock the OpenSCAD subprocess — no OpenSCAD installation required to run them. Coverage target: 80% minimum.
Troubleshooting
OpenSCAD Not Found
# Check if OpenSCAD is installed
which openscad # Linux/macOS
where openscad.exe # Windows
# Set the path explicitly
export OPENSCAD_PATH=/path/to/openscadServer Not Connecting
# Verify the server starts correctly
uv run --with git+https://github.com/quellant/openscad-mcp.git openscad-mcp
# In Claude Code, check MCP status
/mcpRender Timeout
Increase the timeout:
export MCP_RENDER_TIMEOUT=600Contributing
Fork the repository
Create a feature branch (
git checkout -b feature/my-feature)Make your changes with tests
Ensure tests pass (
uv run pytest)Open a Pull Request
Commit style: feat:, fix:, docs:, refactor:, chore:
License
MIT — see LICENSE
Acknowledgments
FastMCP — Python MCP framework
OpenSCAD — Programmable CAD software
Model Context Protocol — The MCP specification