mcp-openscad-render-loop

mcp-openscad-render-loop

OpenSCAD wrapped as an MCP server. Render .scad with parameter overrides, run parametric sweeps, validate syntax, compute STL metrics. Curated by Archimedes Market with a verified Trust Report.

Category
Visit Server

README

Archimedes Trust Report — VERIFIED 92/100

Verified asset on Archimedes Market. View the full 4-dimension Trust Report (security · quality · license · complexity) and the curated catalog on the asset page.


MCP OpenSCAD Render Loop

OpenSCAD wrapped as an MCP server so an agent can iterate on parametric CAD designs without bouncing in and out of the GUI. Render .scad source with parameter overrides, run parameter sweeps, validate syntax, extract module signatures, and compute STL geometry metrics.

Tools

  • render_stl — render a .scad file or inline source to STL with -D parameter overrides
  • render_png — preview render to PNG with camera + image-size control
  • parametric_sweep — Cartesian sweep over one or more parameter ranges, returns a manifest of outputs
  • validate_scad — syntax check via openscad --check (no render)
  • list_modules — extract top-level module foo(...) and function bar(...) signatures with defaults
  • compute_metrics — bounding box, volume, surface area, triangle count from an STL

Why this server exists

OpenSCAD's CLI is well-designed but verbose. Most agent CAD workflows do the same loop: edit parameters → render → measure → adjust. This server collapses that to one tool call per iteration and returns geometry metrics directly so the agent doesn't have to parse STL bytes itself.

Quick start

# 1. Install OpenSCAD (must be on PATH)
brew install openscad      # macOS
apt-get install openscad   # Debian/Ubuntu

# 2. Install the MCP server
pip install mcp-openscad-render-loop

# 3. Set output directory and run
export MCP_OPENSCAD_OUTPUT_DIR="/tmp/scad-renders"
mcp-openscad-render-loop serve

Claude Desktop config:

{
  "mcpServers": {
    "openscad": {
      "command": "mcp-openscad-render-loop",
      "args": ["serve"],
      "env": {
        "MCP_OPENSCAD_OUTPUT_DIR": "/tmp/scad-renders",
        "MCP_OPENSCAD_BINARY": "/usr/local/bin/openscad"
      }
    }
  }
}

Typical agent workflow

Agent: "Design an enclosure for a 60x40x15mm PCB with 2mm walls and M3 mounting posts."
↓
1. list_modules on enclosure.scad → finds module enclosure(pcb_l, pcb_w, pcb_h, wall, post_dia)
2. render_stl with pcb_l=60, pcb_w=40, pcb_h=15, wall=2, post_dia=3 → enclosure_v1.stl
3. compute_metrics on enclosure_v1.stl → bbox 66x46x21, volume 18.4cm³, 1,240 triangles
4. parametric_sweep on wall ∈ [1.5, 2.0, 2.5] → 3 STLs + metrics → wall=2 is the strength/weight knee
5. render_png at iso camera → preview image attached to agent's reply

Safety

  • MCP_OPENSCAD_OUTPUT_DIR is the only writable path. Any output path outside this dir is rejected.
  • Each render is hard-capped at 60 seconds (configurable). Long sweeps run renders sequentially, not in parallel — keeps memory bounded.
  • Inline .scad source is written to a temp file inside the output dir; nothing executes outside openscad.
  • No import("/some/path.dxf") traversal — relative paths in .scad are resolved against the output dir or the source file's dir, never against /.

License

MIT.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured