# Mcp Openscad Render Loop

> OpenSCAD wrapped as an MCP server. Render .scad source with parameter overrides, run parametric sweeps, validate syntax, extract module signatures, and compute STL metrics (bounding box, volume, surface area). Designed so an agent can iterate on para

- **Type:** MCP server
- **Install:** `agentstack add mcp-archimedes-market-mcp-openscad-render-loop`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [archimedes-market](https://agentstack.voostack.com/s/archimedes-market)
- **Installs:** 0
- **Category:** [Data & Analytics](https://agentstack.voostack.com/c/data-and-analytics)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [archimedes-market](https://github.com/archimedes-market)
- **Source:** https://github.com/archimedes-market/mcp-openscad-render-loop

## Install

```sh
agentstack add mcp-archimedes-market-mcp-openscad-render-loop
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

[](https://archimedes.market/assets/46d1682f-6ceb-4288-97ae-8a05a4ab9c86)

> Verified asset on [**Archimedes Market**](https://archimedes.market). View the full 4-dimension Trust Report (security · quality · license · complexity) and the curated catalog on the [asset page](https://archimedes.market/assets/46d1682f-6ceb-4288-97ae-8a05a4ab9c86).

---

# 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

```bash
# 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:

```json
{
  "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.

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [archimedes-market](https://github.com/archimedes-market)
- **Source:** [archimedes-market/mcp-openscad-render-loop](https://github.com/archimedes-market/mcp-openscad-render-loop)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-archimedes-market-mcp-openscad-render-loop
- Seller: https://agentstack.voostack.com/s/archimedes-market
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
