MCP CAD Studio

io.github.mario-andreschak由 GitHub 账号 mario-andreschak 发布v0.2.2更新于 Oct 25, 2026

A self-contained parametric CAD studio MCP server with an interactive MCP App.

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

概览

AI 生成的概览

一个本地参数化 CAD 服务器,让助手创建、编辑、校验并导出 3D 模型,并可在兼容宿主中打开交互式 3D 工作室

可以做什么
用形状树创建和编辑参数化模型,包括基本体、变换和嵌套布尔树,以及支架、齿轮、外壳等模板。管理已保存模型:列出、加载、复制、删除,并通过修订检查就地修补或重新生成。在保存前校验草稿和导入网格,给出拓扑诊断。导入 STL/OBJ 数据并导出 ASCII STL/OBJ。在支持 MCP Apps 的宿主中打开交互式 3D 工作室;数据工具无需该界面也能使用。
适用场景
适合让助手构建或调整参数化 3D 零件并导出为 STL/OBJ,或让人和智能体在同一实时编辑器中处理同一批模型。适用于无需安装原生 CAD 软件的设计与原型制作。
运行要求
需要 Node.js 20 或更高版本;CAD 引擎和依赖随 npm 包一起安装,无需 OpenSCAD、Python、编译器、Docker 或原生 CAD。默认通过 stdio 运行,也支持 Streamable HTTP/HTTPS。模型默认持久化到本地 JSON 文件,可用数据文件选项更改,或关闭以使用内存会话。未声明身份验证或环境变量。
安装前请注意
修改类工具会写入持久化模型存储,delete_model 会永久删除模型;修订检查可防止过期覆盖,但不能防止有意的删除。导入的 STL/OBJ 数据和模型文件保存在本地。若通过 HTTP/HTTPS 对外提供,身份验证取决于部署方式:远程多用户实例应置于带身份验证的网关之后,并按用户授权。自动生成的自签名证书仅用于本地开发。

安装

在 SourceWeft 中

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

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

其他 MCP 客户端

参照 仓库 中的启动说明。

README

MCP CAD Studio

A self-contained parametric CAD workspace delivered as an MCP server and an interactive MCP App. Agents can create and edit models through tools; people can work on the same models in a live 3D studio rendered inside any compatible host.

What it does

  • Renders a full 3D editor through the studio_ui tool.
  • Creates boxes, spheres, cylinders, cones, polygon extrusions, imported meshes, transforms, and nested union/difference/intersection trees.
  • Generates editable brackets, pipes, gears, enclosures, and bolts.
  • Loads, patches, regenerates, and deletes persistent model documents with optimistic revision checks.
  • Preflights extrusion outlines and raw meshes with actionable topology diagnostics before they reach the CAD kernel.
  • Imports ASCII/binary STL and OBJ; exports ASCII STL and OBJ.
  • Keeps an open app synchronized with model-initiated MCP tool calls.
  • Runs over stdio or Streamable HTTP, with direct HTTPS support.
  • Uses a bundled WebAssembly CAD kernel—no OpenSCAD, Python, compiler, Docker, or native CAD installation is needed.

The server's data tools are UI-independent. A client that cannot render MCP Apps can still perform every CAD operation and receive structured model/mesh data.

Install

Node.js 20 or later is the only runtime requirement. The CAD engine and all JavaScript dependencies install with the package.

Run the published npm package:

bash
npx -y mcp-cad-studio --stdio

Or clone and build:

bash
git clone https://github.com/flujo-app/mcp-cad-studio.gitcd mcp-cad-studionpm installnpm run buildnpm start -- --stdio

MCP client configuration (stdio)

json
{  "mcpServers": {    "cad-studio": {      "command": "npx",      "args": ["-y", "mcp-cad-studio", "--stdio"]    }  }}

Models persist by default to ~/.mcp-cad-studio/models.json. Use --data-file <path> to choose another file or --no-persist for an in-memory session.

HTTPS / Streamable HTTP

Run a local HTTPS endpoint with a generated self-signed certificate:

bash
mcp-cad-studio --transport https --host 127.0.0.1 --port 8787

For a remotely reachable production server, use a trusted certificate:

bash
mcp-cad-studio --transport https \  --host 0.0.0.0 \  --port 8787 \  --tls-cert /run/secrets/fullchain.pem \  --tls-key /run/secrets/privkey.pem

The MCP endpoint is /mcp; a read-only health endpoint is available at /health. TLS termination at a reverse proxy is also supported—run with --transport http behind the proxy.

MCP tools

ToolPurpose
studio_uiOpen the interactive MCP App and optionally select a model
list_modelsList saved models and revisions
load_modelLoad the parametric document and its render mesh
create_modelCreate a model from a declarative shape tree
generate_modelCreate a template model, or regenerate one in place by modelId
update_modelPatch or replace a model's definition, name, or color in place
validate_shapePreflight a shape without saving it
transform_modelApply an incremental translation, rotation, or scale
boolean_modelsUnion, subtract, or intersect saved models into a new model
duplicate_modelMake an editable copy
delete_modelPermanently delete a model
import_modelImport STL/OBJ text or base64 data
export_modelExport ASCII STL/OBJ data

All mutating results include models, activeModel, and mesh in structuredContent, so the UI and model see the same canonical state. Model creation is reserved for genuinely separate models. For revisions, first call load_model, then pass its modelId and revision back as expectedRevision to update_model, generate_model, or delete_model.

Updating without creating copies

update_model preserves the model ID and supports either a complete replacement shape or small RFC 6901 JSON-Pointer-style patches. This changes the X size of a saved box without resending its whole definition:

json
{  "modelId": "5e44fd24-b7df-450a-a7bb-31c95496832f",  "expectedRevision": 3,  "patches": [    { "op": "replace", "path": "/shape/size/0", "value": 80 }  ]}

Patches can target /shape, /name, or /color and are applied in order. add, replace, and remove are supported. The completed definition is schema-checked and geometry-checked before the saved model is changed.

For template-level edits, such as changing a gear's tooth count, call generate_model with the existing modelId and expectedRevision. The template is regenerated into the same document instead of creating another model.

Parametric model format

create_model and update_model accept a recursive shape tree. For example, a plate with a cylindrical hole:

json
{  "name": "Mounting plate",  "color": "#60a5fa",  "shape": {    "kind": "difference",    "children": [      { "kind": "box", "size": [80, 50, 6], "center": true },      {        "kind": "cylinder",        "height": 8,        "radius": 5,        "segments": 48,        "center": true      }    ]  }}

Every node can include a transform:

json
{  "transform": {    "translation": [10, 0, 4],    "rotation": [0, 0, 45],    "scale": [1, 1, 1]  }}

Rotations use degrees. Dimensions are unit-agnostic in the kernel; the studio labels them as millimeters.

Shape objects are strict: misspelled or unsupported fields produce an error instead of being silently ignored. validate_shape checks a draft without saving and reports JSON paths, error codes, and suggested repairs. Checks include:

  • repeated, zero-length, zero-area, and self-intersecting extrusion outlines;
  • incomplete or out-of-range mesh arrays and degenerate triangles;
  • open boundaries, edges shared by too many faces, inconsistent winding, and disconnected surface fans at a vertex;
  • shape-tree and twisted-extrusion complexity limits;
  • final verification by the Manifold CAD kernel.

If the kernel still rejects a shape, its status is translated into guidance for non-finite vertices, non-manifold geometry, invalid construction, oversized results, and the other kernel status classes.

Architecture

mermaid
flowchart LR  A[Agent or person] --> H[MCP host]  H <-->|stdio or Streamable HTTP/S| S[MCP CAD Studio server]  H <-->|MCP Apps JSON-RPC bridge| U[Interactive CAD app]  U -->|tools/call| H  S --> P[Persistent parametric documents]  S --> K[Bundled Manifold WebAssembly kernel]  K --> M[Render mesh and STL/OBJ]  M --> S

The studio_ui tool links to ui://cad-studio/studio.html with _meta.ui.resourceUri. The component uses the stable MCP Apps bridge (ui/initialize, ui/notifications/*, and tools/call) rather than requiring host-specific globals. Model polling is revision-aware, making external tool edits visible in an already-open editor.

Development

bash
npm installnpm run check

npm run check performs strict TypeScript checking, 16 kernel/store/protocol/ transport tests, and a production build. The test suite uses the real WebAssembly geometry engine and both in-memory and Streamable HTTP MCP clients.

Useful commands:

bash
npm run dev       # HTTP development server on port 8787npm test          # Vitest suitenpm run typecheck # TypeScript onlynpm run build     # bundle the MCP App and servernpm pack          # verify the single-package artifact

To publish the current version to npm:

bash
npm run release

The release command signs in through npm when necessary, runs the complete check suite, publishes the package publicly, and confirms that npm serves the version. It is safe to rerun: if that exact version is already published, it verifies the project and skips the duplicate publish.

Run npm run release:check to validate the release helper without publishing.

Security notes

  • Tool schemas cap shape depth, node count, mesh size, and imported file size.
  • Mutation tools accurately declare read-only/destructive/open-world hints.
  • expectedRevision prevents accidental overwrites and stale deletion during concurrent editing.
  • Patch paths are restricted to editable model fields and reject prototype traversal.
  • The app resource declares an empty external-resource/connect CSP.
  • A generated self-signed certificate is intended for local development only.
  • Authentication is deployment-specific. Put remote multi-user instances behind an authenticated gateway and enforce per-user authorization there.

License

MIT

来源:README.md,提交 a99589d

工具

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

版本历史

1
  1. v0.2.2最新Sep 16, 2026

评分

已满足适用检查项的 50%

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

  • 近 30 天内可连通25 分

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

  • 已声明认证方式10 分

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

  • 已列出工具15 分

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

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