OpenSCAD

السجل الرسمي أدوات المطورين

Render STL and PNG from OpenSCAD code.

ماذا يمكنك أن تفعل مع OpenSCAD؟

  • Iterative agent-driven modeling
  • Geometry artifact generation within MCP contexts
  • Visual grounding for parametric design
  • Design validation and comparison

التثبيت

أضف هذا إلى إعدادات MCP في عميلك (Claude Desktop: claude_desktop_config.json، وCursor: ‏.cursor/mcp.json، ويستخدم VS Code وغيره الصيغة نفسها «mcpServers»).

NPM package openscad-mcp-server
Claude Code
claude mcp add openscad -- npx -y openscad-mcp-server@1.0.6
إعداد JSON (Claude Desktop وCursor وVS Code)
{
    "mcpServers": {
        "openscad": {
            "command": "npx",
            "args": [
                "-y",
                "openscad-mcp-server@1.0.6"
            ]
        }
    }
}

التوثيق

مأخوذ من ملف README للمشروع على GitHub ويُحدَّث أسبوعيًا. تفتح الروابط على GitHub.

المحتويات
  1. OpenSCAD MCP Server
  2. Use cases
  3. Available Tools
  4. Skill
  5. Limitations
  6. Installation
  7. Local development
  8. Similar Projects
  9. Relevant Links
  10. License

OpenSCAD MCP Server

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.

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.

الأسئلة الشائعة

ما هو OpenSCAD؟

Render STL and PNG from OpenSCAD code.

كيف أثبّت OpenSCAD؟

يعمل على جهازك. في Claude Code: claude mcp add openscad -- npx -y openscad-mcp-server@1.0.6. وفي العملاء الآخرين، الصق إعداد JSON من هذه الصفحة في إعدادات MCP الخاصة بهم.

هل يحتاج OpenSCAD إلى مفتاح API؟

لا يذكر إدراجه في السجل أي مفتاح أو سر إلزامي. قد تتطلب بعض الميزات حسابًا لدى الخدمة التي يتصل بها.

هل OpenSCAD مفتوح المصدر؟

نعم. شيفرته متاحة على GitHub بترخيص MIT.

من يصون OpenSCAD؟

ينشره fboldo. يدرجه AI.tn لكنه لا يصونه ولا يوصي به.

من سجل MCP الرسمي. الإدراج ليس توصية: راجع شيفرة الخادم وصلاحياته قبل منحه الوصول إلى بياناتك.