跳到主要内容
BetaCAD & Parametric

MCP for FreeCAD — Connect AI Agents to FreeCAD

参数化模型只有在约束存活时才有价值。Agent 调用的是特征级工具,让模型树保持有效——而不是推倒重建的脚本。

Read-only by default8 typed toolsCheckpointed writes
Technical specification
宿主软件
FreeCAD 0.21, 1.0 and newer
运行时
Python 3.11+ with the FreeCAD Python module
传输方式
stdio (local) and streamable HTTP (batch servers)
安装方式
Addon Manager package + npx dccmcp-freecad
工作台
Part, Part Design, Sketcher, Spreadsheet, TechDraw, Mesh, FEM (read)
支持平台
Windows, macOS, Linux
Last reviewed
2026-09-20
概述

什么是 MCP for FreeCAD?

MCP for FreeCAD is a local MCP server plus a FreeCAD plugin that connects AI agents to a real FreeCAD session. Agents discover 8 typed tools — including document.inspect, sketch.create, sketch.constrain and partdesign.feature — and call them to inspect, create, modify and validate work inside the live application.

Unlike generated FreeCAD scripts, every call is validated against your current document, classified as read, write or execute, and recorded in an audit log. FreeCAD stays open, the document stays live, and destructive operations are checkpointed so they can be rolled back.

It works with Claude Code, Codex, Cursor, GitHub Copilot, Claude Desktop, Gemini CLI, Trae, Doubao, Qwen Code, CodeBuddy, Custom MCP clients, CI batch runners over stdio or streamable HTTP.

  • 宿主软件: FreeCAD 0.21, 1.0 and newer
  • 运行时: Python 3.11+ with the FreeCAD Python module
  • 传输方式: stdio (local) and streamable HTTP (batch servers)
为什么会失败

没有契约时,让 Agent 驱动 FreeCAD 会出什么问题

01

脚本重建模型,而不是编辑模型

用代码重新生成零件会丢掉设计意图。工程师需要特征树、约束与引用关系原样保留。

02

参数表会悄悄失去同步

当 Agent 把尺寸写死、而不是绑定到参数表时,这个模型就不再是参数化的了。

03

制造变更没有可追溯性

一个没人记录的孔径变更,是真实的生产风险。无法留痕的自动化在车间是不可接受的。

如何工作

MCP for FreeCAD 如何保住设计意图、结构与可追溯性

一个 MCP Server 加一个 FreeCAD 工作台,把参数化建模暴露为类型化工具:草图约束、Part Design 特征、表格参数、工程图与技术图纸、以及制造用导出。

特征级建模

Agent 以真实的 Part Design 特征添加凸台、凹槽、旋转与圆角,模型树在之后仍然可被人类编辑。

默认绑定参数

尺寸工具接受字面值或表格别名。当某个值未被绑定时,服务会报告出来,让 Agent 在交付前修正。

感知约束的草图

Agent 读取草图自由度、添加几何与尺寸约束,并验证求解器收敛。

出图与导出流水线

生成 TechDraw 视图,然后导出 STEP、IGES、STL 或 DXF,带单位校验和精确的版本清单。

工具参考

MCP for FreeCAD 工具清单与风险等级

Agent 在连接时就能发现这份清单。你可以决定哪些自动放行、哪些需要人工确认、哪些在生产文件中直接禁用。

工具名与参数签名保持英文——它们是 Agent 实际调用的接口。

  • document.inspectObject tree, bodies, features, parameters, recompute state and unit system.read
  • sketch.createCreate sketches on datum planes with a scoped target body.write
  • sketch.constrainAdd geometric and dimensional constraints, then report remaining degrees of freedom.write
  • partdesign.featurePad, pocket, revolution, fillet and chamfer as first-class features in the tree.write
  • parameters.setRead and write spreadsheet aliases with type and range validation.write
  • techdraw.exportCreate or update drawing sheets and export to PDF or SVG.execute
  • cad.exportExport STEP, IGES, DXF, STL or 3MF plus a revision manifest.execute
  • recompute.runForce a recompute and return a structured failure report instead of raising blind.execute
安装

四步安装 MCP for FreeCAD

全部本地运行。服务默认只绑定回环地址,且只暴露你在 FreeCAD 中批准的工具。

预发布。 以下命令描述的是我们即将发布的接口,软件包尚未发布。 Get notified when MCP for FreeCAD launches.

STEP 01

安装工作台

通过 FreeCAD 附加组件管理器安装 DCCMCP 工作台,然后重启 FreeCAD。

STEP 02

启动服务

服务可挂接到正在运行的 FreeCAD,也可以为批量转换任务无界面启动一个实例。

npx dccmcp-freecad@latest serve --mode attach
STEP 03

注册客户端

把服务注册到 Claude Code、Codex、Cursor、OpenClaw 或任何其他 MCP 客户端。批处理模式适合夜间参数扫描。

{
  "mcpServers": {
    "freecad": { "command": "npx", "args": ["dccmcp-freecad", "serve"] }
  }
}
STEP 04

保护你的参数

把表格与属性标记为受保护,让 Agent 可以读取但不能覆盖已批准的取值。

dccmcp policy protect --sheet DesignTable --write allow

MCP for FreeCAD works with the agents you already use

  • Claude Code
  • Codex
  • Cursor
  • GitHub Copilot
  • Claude Desktop
  • Gemini CLI
  • Trae
  • Doubao
  • Qwen Code
  • CodeBuddy
  • Custom MCP clients
  • CI batch runners

Any other MCP-compatible client works too — one config entry, stdio by default.

Read the docs
常见问题

团队在安装前最常问的问题

如果没有覆盖到你的问题,直接写信给我们——技术问题我们给技术回答。
  • MCP for FreeCAD 处于 Beta 通道。读取操作、草图、Part Design 特征与导出在我们的测试语料中已经稳定;FEM 与装配工作台目前是只读预览。

  • 会。尺寸工具优先使用表格别名,服务会报告未绑定的值,让 Agent 去绑定。你也可以直接保护特定参数,禁止写入。

  • 支持 STEP、IGES、DXF、STL 与 3MF 导出,每个都带版本清单,记录所用参数与文件哈希。

  • 支持 FreeCAD 0.21 与 1.0+。推荐 1.0 系列,因为它的 Python API 更稳定。

  • 可以。挂接模式与无界面模式都支持,这让参数扫描与夜间导出在 CI 里很容易自动化。

npx dccmcp-blender@latest serve

Put an agent inside your real tools — without putting your pipeline at risk

Install an integration, set a policy, and let your agent inspect, build and validate work in Blender, Maya, Houdini, 3ds Max, Rhino, ZBrush, Photoshop, FreeCAD, QGIS or OpenCV. Free to start, local by default.

macOS · Windows · Linux — no cloud dependency required