Skip to main content
Glama
OpenSCAD MCP Server

OpenSCAD MCP Server

by dkpoulsen

OpenSCAD MCP Server

A Model Context Protocol (MCP) server for OpenSCAD - enables AI assistants to create and manipulate 3D CAD models.

Features

  • Render: Compile OpenSCAD code to 3D mesh formats (STL, OFF, AMF, 3MF, CSG)

  • Preview: Generate 2D previews (PNG, SVG, DXF, PDF) with camera controls

  • Validate: Check OpenSCAD syntax without generating output

  • Info: Get OpenSCAD installation information

Related MCP server: 3D MCP Server

Prerequisites

  • Node.js 18 or higher

  • OpenSCAD installed on your system

Installation

npm install -g openscad-mcp

From Source

# Clone the repository
git clone https://github.com/dkpoulsen/openscad-mcp.git
cd openscad-mcp

# Install dependencies and build
npm install
npm run build

Usage with Claude Desktop

Add to your Claude Desktop configuration:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Windows: %APPDATA%\Claude\claude_desktop_config.json

Linux: ~/.config/Claude/claude_desktop_config.json

Using npx (after npm install)

{
  "mcpServers": {
    "openscad": {
      "command": "npx",
      "args": ["-y", "openscad-mcp"]
    }
  }
}

Using local build

{
  "mcpServers": {
    "openscad": {
      "command": "node",
      "args": ["/path/to/openscad-mcp/dist/index.js"]
    }
  }
}

Tools

render

Compile OpenSCAD code to a 3D mesh format.

Parameters:

  • scad (string, required): OpenSCAD code to compile

  • format (string, default: "stl"): Output format - stl, off, amf, 3mf, or csg

  • parameters (object, optional): Variables to pass via -D flags

  • exportFormat (string, optional): For STL - asciistl or binstl

  • hardwarnings (boolean, default: true): Treat warnings as errors

preview

Generate a 2D preview or vector export.

Parameters:

  • scad (string, required): OpenSCAD code to preview

  • format (string, default: "png"): Output format - png, svg, dxf, or pdf

  • width (number, default: 800): Image width in pixels

  • height (number, default: 600): Image height in pixels

  • camera (string, optional): Camera position

  • colorscheme (string, default: "Cornfield"): Color scheme

  • projection (string, default: "perspective"): ortho or perspective

  • autocenter (boolean, default: true): Center the design

  • viewall (boolean, default: true): Fit entire design in view

  • render (boolean, default: false): Use full CGAL render

validate

Validate OpenSCAD syntax.

Parameters:

  • scad (string, required): OpenSCAD code to validate

  • parameters (object, optional): Variables to define

info

Get OpenSCAD installation information.

Example Usage with AI Assistant

User: Create a simple 10x10x10 cube in OpenSCAD and render it to STL

AI: I'll create a cube and render it for you.

[Uses render tool with:]
scad: cube([10, 10, 10]);
format: stl

Color Schemes

Available color schemes for PNG export:

  • Cornfield (default)

  • Metallic

  • Sunset

  • Starnight

  • BeforeDawn

  • Nature

  • Daylight Gem

  • Nocturnal Gem

  • DeepOcean

  • Solarized

  • Tomorrow

  • Tomorrow Night

  • ClearSky

  • Monotone

License

MIT

Available Tools

4 tools
infoA

Get information about the OpenSCAD installation (version, features, library versions).

Inputs: no named parameters.

previewB

Generate a 2D preview of OpenSCAD code. Export as PNG image or vector formats (SVG, DXF, PDF). Use camera settings to control the view.

Inputs: scad (required), width, camera, format, +7 more.

renderA

Compile OpenSCAD code to a 3D mesh format (STL, OFF, AMF, 3MF, or CSG). Use this to generate 3D-printable files.

Inputs: scad (required), format, parameters, exportFormat, +1 more.

validateA

Validate OpenSCAD code syntax without generating output. Returns errors and warnings if any.

Inputs: scad (required), parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool targets a distinct concern: render produces 3D meshes, preview produces 2D images/vectors, validate checks syntax, and info reports environment details. There is no meaningful overlap or ambiguity between tool purposes.

    Naming Consistency5/5

    All tool names are single lowercase verbs in a consistent imperative style: render, preview, validate, info. The pattern is uniform and easy to predict.

    Tool Count5/5

    Four tools is a well-scoped size for a specialized OpenSCAD server. Each tool serves a clear, necessary function without redundancy or bloat.

    Completeness5/5

    The tool surface covers the core OpenSCAD workflow: validate code, preview it in 2D, render it to 3D formats, and check the installation. There are no obvious dead ends or missing lifecycle operations for this domain.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      A
      maintenance
      Enables AI assistants to render 3D models from OpenSCAD code, generating single views or multiple perspectives with full camera control. Supports animations, custom parameters, and returns base64-encoded PNG images for seamless integration.
      12
      449 PyPI
      170
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI-driven 3D model generation and manipulation using OpenSCAD through natural language commands. Users can create primitives, apply transformations, perform boolean operations, and export models to various formats like STL and OBJ.
      6 npm
      MIT
    • A
      license
      Not graded
      quality
      Not graded
      maintenance
      Enables AI assistants to render 3D models by providing tools to execute OpenSCAD code and generate single or multi-perspective views. It returns high-quality PNG renderings directly to LLM applications for visual feedback and 3D model visualization.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables LLMs to create and manipulate 3D models using OpenSCAD through MCP tools for code-based modeling, preview, and export.
      1
      MIT