Skip to main content
Glama
openscad-mcp-server

openscad-mcp-server

by fboldo

OpenSCAD MCP Server

npm version npm downloads CI

An MCP (Model Context Protocol) server that renders PNG previews and STL geometry from OpenSCAD (SCAD) source code. It is designed to support iterative, agent-driven CAD workflows, where models can be previewed visually and exported for downstream use (e.g. fabrication, simulation, or inspection).

⚠️ Beta
This MCP server is currently in beta. Performance, APIs, and capabilities may change. Issues and contributions are welcome.

Use cases

  • Iterative agent-driven modeling
    Agents generate or modify OpenSCAD source, render PNG previews to evaluate shape and proportions, and refine the model across multiple turns.

  • Geometry artifact generation within MCP contexts
    Agents export STL files as concrete geometry artifacts that can be passed to downstream tools, stored, inspected, or handed off to other MCP-enabled systems.

  • Visual grounding for parametric design
    PNG previews provide visual grounding for parametric or programmatic SCAD code, reducing hallucination and enabling agents to reason about spatial changes.

  • Design validation and comparison
    Agents can render multiple variants of a model (e.g. parameter sweeps) and visually compare results before deciding which geometry to persist or export.

Related MCP server: OpenSCAD MCP Server

Available Tools

  • render_scad_png: Renders a PNG preview image from SCAD source.

    • Input: scadCode (string), optional width/height (numbers), optional cameraPreset and optional cameraPosition

      • cameraPreset: one of isometric, front, back, left, right, top, bottom

      • cameraPosition: { x, y, z }

    • Output: MCP ImageContent

  • export_scad_stl: Exports an STL generated from SCAD source.

    • Input: scadCode (string), optional filename (string)

    • Output: MCP embedded resource (STL)

Skill

This repository also includes an OpenSCAD iterative modeling skill that demonstrates how to use this MCP server to support an iterative SCAD → PNG → critique → refine loop.

Limitations

  • Performance: Rendering complex SCAD models can be slow, especially in a WASM environment.

  • Feature support: Not all OpenSCAD features may be fully supported or may have limitations in the WASM version.

  • Fonts: Text rendering is not currently supported. Support is planned for a future release.

Installation

The published package is intended to run over stdio. Configure it in your MCP client using npx:

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

To run it over HTTP instead (e.g. in Docker), pass --http:

MCP_PORT=3000 npx -y openscad-mcp-server --http

The server exposes GET /health and a stateless streamable HTTP MCP endpoint at POST /mcp.

Using the Skill

Agents skills are a simple, open format for giving agents new capabilities and expertise.

The most straightforward to use the OpenSCAD iterative modeling skill is to install it using the skills CLI:

npx skills add fboldo/openscad-mcp-server --skill openscad-iterative-modeling

Local development

  • Install deps: bun install

  • Stdio (matches how clients run it): bun index.ts --stdio

  • HTTP (useful for manual testing): bun index.ts (or --http)

    • Port: MCP_PORT (default 3000)

    • Endpoints: GET /health, MCP at POST /mcp

  • MCP Inspector: bun run dev

Similar Projects

  • jhacksman/OpenSCAD-MCP-Server This project provides a different approach relying on generating images from user prompts, followed by 3D reconstruction and even 3D printer discovery. It's a very interesting project, and I recommend checking it out if you are interested in OpenSCAD and MCP servers.

  • petrijr/openscad-mcp Similar to this project, but it uses a Python-based server and relies on the OpenSCAD CLI for rendering.

License

MIT — see LICENSE.

Available Tools

2 tools
export_scad_stlExport OpenSCAD source to an STLB

Export OpenSCAD (SCAD) source code into an STL and return it as an embedded resource blob.

Inputs: scadCode (required), filename. Returns: type, _meta, resource, annotations

render_scad_pngRender OpenSCAD source to a PNG imageA

Render OpenSCAD (SCAD) source code into a PNG preview image. Provide the SCAD text in scadCode and optionally set width/height (pixels). Optional camera control is available via cameraPreset (named preset) or cameraPosition ({x,y,z}).

Inputs: scadCode (required), width, height, cameraPreset, +1 more. Returns: data, type, _meta, mimeType, +1 more

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 2 tools

    Disambiguation5/5

    The two tools target clearly different outputs: render_scad_png produces a raster preview image, while export_scad_stl produces a mesh file blob. An agent can trivially tell which to call based on whether it wants a preview or a downloadable geometry file.

    Naming Consistency5/5

    Both names follow a strict verb_noun_object pattern (render_scad_png, export_scad_stl), using snake_case with the source format and target artifact made explicit. The convention is predictable and self-documenting.

    Tool Count3/5

    At two tools the surface is on the thin side, though the server's scope (turning SCAD source into viewable/exportable artifacts) is narrow enough that this is defensible. Each tool clearly earns its place, but there's little room for variation in workflow.

    Completeness4/5

    The core lifecycle—preview and export—is fully covered, and the render tool even exposes camera controls. Minor gaps remain: no alternative export formats (3MF, SVG, DXF, OFF) and no way to validate or inspect SCAD code without producing an artifact.

    Maintenance

    ActivitySlowing
    ResponsivenessLimited 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
      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
      Exposes OpenSCAD CLI as MCP tools for validating, rendering, and exporting parametric 3D models. Enables LLM clients to interactively create and manipulate OpenSCAD designs.
      4
      MIT