FreeCAD MCP

io.github.blwfish由 GitHub 帳號 blwfish 發布v8.6.0更新於 Oct 29, 2026

Control FreeCAD from Claude — 3D modeling, PartDesign, CAM toolpaths, and more via 30+ tools.

已驗證STDIO僅桌面開發者工具媒體與設計

概覽

AI 產生的概覽

把 AI 助理連上正在執行的 FreeCAD,用來做參數化 3D 建模、檢查草圖、規劃 CAM 刀路並匯出零件。

可以做什麼
  • 建立並反覆調整參數化模型:草圖、PartDesign 特徵、布林運算、變換與量測
  • 檢查與診斷模型:讀取報告檢視、查看草圖約束、找出幾何錯誤與零件碰撞
  • 規劃並產生 CAM 刀路,把零件匯出成 STEP 或 G-code
  • 處理匯入的網格(例如 STL 檔)並在其上加入特徵
  • 管理 FreeCAD 實例:列出、切換,以及啟動圖形介面或無介面工作階段
  • 撰寫可重複使用的巨集,並使用內建診斷與操作記錄
適用情境
適合在 FreeCAD 設計零件、希望助理代勞建模操作、解釋難懂的錯誤訊息、在既有零件上反覆調整,或一起準備 CNC 刀路與製造匯出時使用。
執行需求
本機需安裝 FreeCAD 並載入 AICopilot 工作台外掛,橋接程式以本機程序執行;主要在 macOS 與 Claude Code 上開發,Windows 與 Linux 可用但測試較少。CAM 工具需要較新的 FreeCAD 每週開發版,而非 1.1.x。選用環境變數 FREECAD_MCP_LABEL 與 FREECAD_MCP_SOCKET 可為實例命名或變更 socket 路徑。網路用於每日檢查 GitHub 新版本。
安裝前請注意
此伺服器讓助理取得 FreeCAD Python 環境的完整存取權,包括檔案系統與作業系統,並會把文件內容(物件標籤、巨集原始碼、試算表數值)讀進模型上下文,因此來自不可信來源的 FreeCAD 檔案應視同不可信程式碼。它能建立、修改與匯出文件,並啟動 FreeCAD 程序。此外它每天會連上 GitHub 檢查新版本。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 FreeCAD MCP,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

freecad-mcp

[Unit Tests] [Integration Tests] [License: LGPL v2.1]

What This Does

This is a bridge between your AI agent and FreeCAD — a thinking partner for parametric design, CNC toolpath generation, and mesh work. You bring the design intent and the domain judgment; the agent handles the FreeCAD mechanics. Together: moving faster, co-designing things that would take hours to build by hand, untangling the cryptic error messages that FreeCAD is so good at generating, and hunting down the subtle, knotty modeling problems that are nearly impossible to find alone. Built for personal daily use — designing parts, generating toolpaths, printing and cutting them — not a demo. See TOOLS.md for the full tool reference.

What You Can Work On Together

  • Work through a design — "I need a mounting plate — 100x60mm, four M3 holes, rounded corners. What's the right approach?" You bring the requirements and constraints; the agent builds, flags underspecified decisions, and iterates with you.
  • Diagnose what went wrong — "I just tried to pad this sketch and got a weird result — what is FreeCAD actually telling me?" The agent can read the Report View, inspect sketch constraints, and explain what's happening in terms you can act on.
  • Iterate on an existing part — "This wall feels too thin and the fillet might not survive printing — let's look at it together"
  • Plan CNC toolpaths — "I want to mill this pocket — let's work out the right tool and parameters for the material"
  • Build something reusable — "I keep doing this same workflow for every bracket — let's write a macro that generates them from a spreadsheet of dimensions"
  • Check your work before committing — "Does this model have geometry errors?", "Will these walls survive printing?", "Are any of these parts going to collide?"
  • Work with meshes — "I have an STL from the manufacturer — let's get it into FreeCAD and add mounting features"
  • Export for manufacturing — "Export this as STEP and generate G-code for my CNC router"

See It In Action

These are a couple of examples of how I've used the MCP.

Debugging a broken external reference — a link FreeCAD can't restore, an error message that seems to contradict what you know about your own model, and a one-line fix found by reading the file directly.

[Report View showing broken link error]

Full story →


Designing a shingles generator — several sessions of back-and-forth to design a parametric generator that tiles any roof surface from a spreadsheet of parameters.

[Shingles generated across a multi-plane roof]

Full story →


Getting Started

FreeCAD version support: All tools except CAM are supported on FreeCAD 1.1.x (current stable). CAM toolpath generation requires a current FreeCAD weekly development build (what used to be called "1.2-dev" before upstream moved to calendar-based versioning, e.g. 26.3.x) — the Path workbench API changed incompatibly between 1.1 and the dev series. This project tracks the latest weekly.

Developed on macOS with Claude Code. The code handles macOS, Windows, and Linux — other platforms should work but are less tested. PRs for other agents and platforms will be considered. It's also been manually smoke-tested against LM Studio's native MCP client (qwen/qwen2.5-coder-14b, qwen/qwen3-32b, google/gemma-4-e4b) to confirm the protocol round-trips cleanly outside of Claude — see AGENT-INSTALL.md for details and caveats.

Tell your AI agent:

Go to https://github.com/blwfish/freecad-mcp and read the AGENT-INSTALL.md file. Follow the instructions to install and configure the FreeCAD MCP server on this machine.

Your agent will handle the rest — installing prerequisites, cloning the repo, setting up the FreeCAD addon, and registering itself. Once setup is complete, you can ask your agent to design parts.

Verifying your installation

Once FreeCAD is running with the AICopilot workbench loaded, open the Report View (menu: View → Panels → Report View). You should see something like this:

[Report View on startup]

A few things worth knowing about this output:

  • AI Copilot Service starting — confirms the AICopilot workbench loaded correctly. If you don't see this, the addon isn't installed or FreeCAD isn't finding it.
  • Debug/crash infrastructure loaded — active instrumentation is running. If something goes wrong mid-operation, logs and crash reports are captured automatically.
  • Socket server started / Claude ready — the bridge is listening. This is the line that means your AI agent can connect.
  • Font alias warning (in orange) — harmless Qt noise that appears on most macOS systems regardless of what you're doing. Not a problem.

Running multiple FreeCAD instances

The MCP can talk to more than one FreeCAD at a time — useful for comparing a local debug build against a stock release, running a regression in a side window while keeping your main work open, or driving headless workers from the same Claude session.

Each FreeCAD process (GUI or headless) generates a UUID at startup, binds its own socket at /tmp/freecad_mcp_<uuid>.sock, and writes a discovery file to ~/.cache/freecad-mcp/instances/<uuid>.json. The bridge scans that directory to find live instances regardless of who launched them.

Optional env vars on launch:

  • FREECAD_MCP_LABEL=<name> — give the instance a human-readable name (defaults to the UUID otherwise)
  • FREECAD_MCP_SOCKET=<path> — override the socket path entirely (escape hatch for CI / tightly-scripted launches)

Listing and switching from the agent:

list_freecad_instances          # all live instances + active doc infoselect_freecad_instance uuid=<id>           # by uuidselect_freecad_instance label="weekly"      # or by label

Spawning from the agent:

spawn_freecad_instance gui=true label="private" \    freecad_binary=/path/to/your/private/build/bin/FreeCADspawn_freecad_instance gui=true label="weekly" \    freecad_binary=/Applications/FreeCAD.app/Contents/MacOS/FreeCAD

Resolution rules when no instance is explicitly selected: 0 live → error, 1 live → auto-select, 2+ live → error listing them (call select_freecad_instance).

For Developers

bash
# Unit tests (1430 tests, no FreeCAD required)python3 -m pytest tests/unit/
# Integration tests (147 tests, requires running FreeCAD with AICopilot loaded)python3 -m pytest tests/integration/
# All tests with coveragepython3 -m pytest --cov=AICopilot
Prompt Caching and Direct Claude API Calls

For Claude users: the easiest and cheapest approach is to use Claude Code, the web interface, or the CLI tool directly. These platforms automatically handle prompt caching and cost optimization — you don't need to think about it. If you're just using this MCP to design parts in FreeCAD, use Claude Code. Stop reading this section.

If you're building applications or integrations that make direct calls to the Claude API (using the Anthropic SDK), you must understand prompt caching. The Claude desktop app, web interface, and CLI tools automatically handle caching of file context and tool references — you don't see this optimization, but it reduces latency and cost for repeated queries over the same context.

When you make direct API calls, caching must be managed explicitly. The MCP server itself doesn't make API calls, but if you build integrations or extensions that do:

  • Read the Anthropic SDK documentation on prompt caching before deploying
  • Understand cache TTL (typically 5 minutes) and cost implications (20% of input tokens)
  • Be aware that cache keys include model, system prompt, and exact token boundaries — small variations bust the cache
  • Consider cache-busting risks if your context is frequently updated (like document state snapshots)

Similarly, if you integrate other MCP servers or agents into your workflow, they may have analogous considerations that are not documented in their README. Check their documentation or source for caching behavior, async job handling, and token limits — don't assume they work like Claude Code.

The test suite covers the handler dispatch layer, base infrastructure, and document operations via unit tests, plus end-to-end coverage of Part, PartDesign, Sketch, Draft, Boolean, Transform, Measurement, and CAM workflows via integration tests against a live FreeCAD instance. CI runs both suites on every push.

Built-in Diagnostics

The MCP includes operation logging, crash capture, and report view access. FreeCAD's own error reporting is often cryptic — OCCT kernel crashes leave no trace, and the messages that do appear require context to interpret. These tools provide that context.

Most users and developers won't know this infrastructure exists until they need it. See docs/diagnostics.md for a full guide with real examples, and AGENT-DEBUGGING.md for the step-by-step investigation runbook agents should follow when something goes wrong.

See AGENT-INSTALL.md for full technical details, architecture, contributing guidelines, and how to add new tools.

Security

This tool grants your AI agent full access to FreeCAD's Python environment, including the filesystem and OS — this is by design. It also means the agent reads document content (object labels, macro source, spreadsheet values) directly into its reasoning context, so treat FreeCAD files from untrusted sources the same way you'd treat untrusted code. See SECURITY.md for the full security model, practical mitigations, and how to report vulnerabilities.

The MCP also checks GitHub once a day for a newer release — a plain pull against GitHub's public API, cached, and logged locally to ~/.cache/freecad-mcp/version_check.log so it's auditable. See SECURITY.md for details.

Issues

If you hit a bug, open an issue — silent failures don't help anyone. Agents won't tell you when something's wrong; they'll just fail the task. See CONTRIBUTING.md for what makes a useful report.

License

LGPL-2.1-or-later

來源:README.md,提交 dbca328

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

10
  1. v8.6.0最新Oct 29, 2026
  2. v8.4.0Oct 23, 2026
  3. v8.3.0Oct 12, 2026
  4. v8.2.3Oct 4, 2026
  5. v8.2.2Sep 28, 2026
  6. v8.2.1Sep 28, 2026
  7. v8.2.0Sep 24, 2026
  8. v8.1.0Sep 22, 2026
  9. v8.0.0Sep 19, 2026
  10. v7.6.0Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分