
build123d MCP
io.github.pzfreo由 GitHub 帳號 pzfreo 發布v0.3.91更新於 Oct 24, 2026
AI-driven 3D CAD via build123d: execute, render, measure, and export geometry interactively.
概覽
本機 MCP 伺服器,讓 AI 助理用 build123d 建立、算圖、量測、修復並匯出 3D CAD 模型。
- 可以做什麼
- 在持續存在的 CAD 工作階段中執行 build123d 程式碼,逐步迭代零件
- 產生 PNG、SVG、DXF 預覽,包含 2D 工程圖預覽
- 量測體積、面積、邊界框、拓撲與質心
- 找出孔、凸台、沉頭孔與孔陣列,並編輯已辨識的特徵
- 檢查可列印性、配合/對齊與匯出有效性,匯入 STEP/STL 進行比對
- 匯出 STEP、STL、DXF 或 SVG,儲存與還原工作階段快照,並安裝工作流程指引技能
- 適用情境
- 適合讓助理設計或修改參數化 3D 零件,並在過程中隨時檢查幾何結果,而不是一次盲寫整段 CAD 腳本。也適用於編輯匯入的 STEP 零件、產出工程圖,以及修復驗證失敗的實體。
- 執行需求
- 由 AI 應用透過 stdio 啟動的本機程序;README 使用 uv 執行 PyPI 套件,支援 Python 3.11 至 3.14(範例用 3.12)。需要支援 MCP 的應用,例如 Claude Code、Claude Desktop、Cursor、VS Code、Continue、Cline 或 Codex CLI。未宣告帳號、API 金鑰或環境變數。另有可選的自架 HTTP 模式。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 build123d MCP,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
build123d-mcp
[PyPI version] [Downloads] [Python] [CI] [License: Apache 2.0] [MCP Registry] [build123d-mcp MCP server]
[Install in VS Code] [Add to Cursor]
Give your AI CAD eyes.
build123d-mcp is not a standalone chatbot or CAD program. It is a CAD toolbox that an AI/LLM app can use through MCP.
With an LLM app such as Claude, Cursor, VS Code, Continue, Cline, or Codex CLI, build123d-mcp lets the assistant create build123d CAD models, render previews, measure geometry, fix mistakes, and export files such as STEP, STL, SVG, and DXF. Instead of writing a whole CAD script blindly, the assistant can build a part in small steps and check the result as it goes.
On the public CADGenBench leaderboard in June 2026, using build123d-mcp raised the same model's score from 0.360 to 0.457 and CAD validity from 88% to 100%.
Pick Your Setup
Most users should start with the local MCP server setup:
- You use Claude, Cursor, VS Code, Continue, Cline, or Codex CLI on your own machine.
- Your AI app starts
build123d-mcpas a local subprocess. - You do not need to clone this repository.
Use GitHub Codespaces instead if you want a browser-only trial or a ready-made development workspace with Copilot Chat, Python, uv, and the CAD dependencies already installed.
Use HTTP mode only for advanced deployments where you are hosting the MCP server yourself.
Quick Start
You need:
- uv
- An AI/LLM app that supports MCP, such as Claude Code, Claude Desktop, Cursor, VS Code, Continue, Cline, or Codex CLI
No repository clone is needed for normal use. First check that the package can start:
Then add the same command to your AI app's MCP config. The common pieces are:
Python 3.11, 3.12, 3.13, and 3.14 are supported. The examples use 3.12 because it is a conservative default, and uv can download it if you do not already have it installed.
Connect To Your AI App
The pieces are:
- The LLM app is where you chat with the assistant.
- MCP is the connection that lets the assistant call tools.
- build123d-mcp is the CAD tool server the assistant calls.
The server normally runs over stdio. Your AI app starts it as a local subprocess when it needs the CAD tools.
Claude Code
Add this to your project's .mcp.json, or to ~/.claude/mcp.json for global
use:
Restart Claude Code after editing.
Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json on macOS,
or %APPDATA%\Claude\claude_desktop_config.json on Windows:
Restart Claude Desktop after saving.
Cursor
Open Settings -> MCP and add a new server entry, or edit
~/.cursor/mcp.json:
VS Code, Continue, Cline, Codex CLI
Use the same command and arguments in whichever MCP config your AI app or extension reads. The exact filename varies by app, but the server command is the same:
For GitHub Copilot MCP support in VS Code, this repository includes a
.vscode/mcp.json for development checkouts and Codespaces. For another
workspace, the config looks like this:
First Test Prompt
Once your AI app is connected to the server, ask your assistant something concrete:
The useful loop is:
- Build one feature at a time.
- Render or measure after important steps.
- Validate before export.
- Export the final part.
If something goes wrong, ask the assistant to inspect last_error, repair the
script, and try the next smaller step.
Editing an imported part
After importing a STEP and establishing a valid baseline, use
find_candidates(kind="hole", qualifiers='{"axis":"Z","side":"+X"}', stated_value=6) to list every recognised candidate and check both the part's
literal axes and every proper rotation of the request frame (grouped by the
candidates each selects). interface_features() suggests flat
faces carrying holes; choose which hole handles to protect. For a plain through
hole, edit_feature(handle, diameter=8, protected_refs='["@feature[...]"]')
resizes it and reports predicted and measured added or removed volume. It
registers the result only when the hole, other recognised holes, and the outer
envelope pass its checks. Holes with counterbores, spotfaces, countersinks or
multiple constituent faces are refused; edit those in execute() and verify
them with compare(kind="shape") and the STEP export gate.
Good prompts usually ask the assistant to use the MCP tools explicitly and to verify the result before exporting. For example:
Try It In GitHub Codespaces With Copilot
You can also run the project in a browser with GitHub Codespaces:
For a beginner, this is the closest path to "GitHub-hosted LLM + MCP":
- GitHub Codespaces gives you VS Code in the browser.
- GitHub Copilot Chat gives you the LLM assistant.
- build123d-mcp runs inside the codespace as the MCP CAD tool server.
You need GitHub Copilot access for the LLM part. The codespace itself gives you a throwaway workspace with the project already checked out and the right Python/CAD dependencies installed. It is useful when you want to:
- Try the project without changing your laptop setup
- Run the tests before making a contribution
- Use Copilot Chat and build123d-mcp together in the same browser workspace
GitHub's docs cover:
This repository includes a dev container that installs Python 3.12, uv, and the
Linux display packages needed for headless rendering. It also installs the
GitHub Copilot VS Code extensions and includes a workspace MCP config at
.vscode/mcp.json.
When the codespace opens, it runs:
To check the development install:
To use Copilot with the local CAD server:
- Open the codespace.
- Wait for setup to finish.
- Open Copilot Chat and choose Agent mode.
- Open
.vscode/mcp.jsonand start thebuild123d-mcpserver if VS Code has not started it already. - Ask the first test prompt from the previous section.
The Codespaces MCP config points at the local checkout rather than the PyPI package:
Codespaces is a good fit for trying the project, contributing, or using GitHub
Copilot and build123d-mcp in one remote environment. For desktop AI apps on your
own machine, the normal uv tool run ... build123d-mcp@latest setup is simpler
because those apps expect to start the MCP server locally.
What It Can Do
build123d-mcp gives an assistant tools to:
- Execute build123d code in a persistent CAD session
- Render PNG, SVG, and DXF previews
- Measure volume, area, bounding boxes, topology, and centers of mass
- Find holes, bosses, countersinks, and hole patterns
- Check printability, fit/alignment comparisons, and export validity
- Import STEP/STL files for comparison
- Export STEP, STL, DXF, SVG, or multiple formats at once
- Save and restore session snapshots
- Produce 2D engineering drawing previews
For the complete tool and resource reference, see llms.md.
Guidance For Assistants
The server includes workflow guidance that helps assistants use the CAD loop properly. This is especially useful in coding agents that read project guidance files.
After connecting the server, ask your assistant to call install_skill for the
workflow you need:
install_skill also supports target="claude", "cursor", and "windsurf".
Use skill="modeling" for 3D parts, skill="drawing" for engineering drawings,
and skill="repair" when a solid fails validation.
You can also paste default_prompt.md into your AI app as a system prompt.
Developer Setup
For local development:
To run the server from this checkout in an AI app, use:
See CONTRIBUTING.md for contribution guidelines.
Advanced Use
The default stdio transport gives each app process its own isolated session. HTTP mode is available for web, container, or remote deployments:
HTTP-capable apps then connect to:
HTTP mode has no built-in authentication and uses one shared CAD session unless the host provides per-request session middleware. Do not expose it to multiple users directly.
Other advanced topics:
- Security model and sandboxing: security.md
- Complete tool reference: llms.md
- Live session viewer: docs/live-viewer.md
- Changelog: CHANGELOG.md
Status
Active development.
來源:README.md,提交 eb76d29
工具
0版本歷史
6- v0.3.91最新Oct 16, 2026
- v0.3.90Sep 25, 2026
- v0.3.88Sep 25, 2026
- v0.3.87Sep 24, 2026
- v0.3.86Sep 24, 2026
- v0.3.84Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分