OpenSCAD

io.github.fboldo由 GitHub 账号 fboldo 发布v1.0.6更新于 Oct 24, 2026

Render STL and PNG from OpenSCAD code.

已验证STDIO仅桌面开发者工具媒体与设计

概览

AI 生成的概览

把 OpenSCAD 源代码渲染成 PNG 预览图和 STL 几何文件,让助手可以反复迭代 CAD 模型。

可以做什么
  • 从 SCAD 源码渲染 PNG 预览图,可指定宽高、相机预设或相机坐标
  • 从 SCAD 源码导出 STL 文件,可指定输出文件名
  • 以 MCP 图像内容和内嵌资源的形式返回结果,供后续工具使用
适用场景
适合助手编写或修改 OpenSCAD 代码后需要查看效果、比较不同参数版本,或输出可交付的几何模型的场景。也适用于“生成—预览—点评—改进”的迭代式 CAD 工作流。
运行要求
以 stdio 方式在本地运行,通常通过 npx 从 npm 包启动,需要 Node.js。另提供可选 HTTP 模式,端口可配置。未声明需要账号、API 密钥或环境变量。
安装前请注意
标注为 beta,性能和接口可能变化。渲染在 WASM 环境中进行,复杂模型可能较慢,部分 OpenSCAD 特性支持有限,且暂不支持文字渲染。导出的 STL 会作为文件产物写出。

安装

在 SourceWeft 中

  1. 打开 控制台中的 OpenSCAD,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

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.

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:

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

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

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

bash
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.

Relevant Links

License

MIT — see LICENSE.

来源:README.md,提交 66f7589

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

2
  1. v1.0.6最新Sep 25, 2026
  2. v1.0.5Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分