build123d-mcp
MCP server for build123d to improve AI cognition when creating 3D CAD models
Safety scan
A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.
Check it deeper on your machine
It has changed since its scan on 11 Nov 2026.
As a Claude Code plugin, install it and then ask Claude Code:
/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/pzfreo/build123d-mcp with scanskillsafety
Or from a terminal, clone it and run it:
git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/pzfreo/build123d-mcp'
It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.
Badge for your README
Markdown
[](/listings/pzfreo--build123d-mcp)HTML
<a href="/listings/pzfreo--build123d-mcp"><img src="/api/listings/pzfreo--build123d-mcp/badge.svg" alt="findsafeskills safety rating" /></a>Install
Install instructions from the README
As written by the repo's author. findsafeskills has not verified these steps.
You need:
- [uv](https://github.com/astral-sh/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:
uv tool run --python 3.12 build123d-mcp@latest --version
Then add the same command to your AI app's MCP config. The common pieces are:
command: uv args: ["tool", "run", "--python", "3.12", "build123d-mcp@latest"]
> 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.
What was scanned
The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.
README.md · README · 413 lines
View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)
This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.
- # build123d-mcp
- [](https://pypi.org/project/build123d-mcp/)
- [](https://pepy.tech/project/build123d-mcp)
- [](https://pypi.org/project/build123d-mcp/)
- [](https://github.com/pzfreo/build123d-mcp/actions/workflows/ci.yml)
- [](LICENSE)
- [](https://registry.modelcontextprotocol.io/v0/servers?search=build123d)
- [](https://glama.ai/mcp/servers/pzfreo/build123d-mcp)
- [](https://insiders.vscode.dev/redirect/mcp/install?name=build123d-mcp&config=%7B%22command%22%3A%22uv%22%2C%22args%22%3A%5B%22tool%22%2C%22run%22%2C%22--python%22%2C%223.12%22%2C%22build123d-mcp%40latest%22%5D%7D)
- [](https://cursor.com/en/install-mcp?name=build123d-mcp&config=eyJjb21tYW5kIjoidXYiLCJhcmdzIjpbInRvb2wiLCJydW4iLCItLXB5dGhvbiIsIjMuMTIiLCJidWlsZDEyM2QtbWNwQGxhdGVzdCJdfQ==)
- 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](https://huggingface.co/spaces/HuggingAI4Engineering/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-mcp` as 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](https://github.com/astral-sh/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:
- ```bash
- uv tool run --python 3.12 build123d-mcp@latest --version
- ```
- Then add the same command to your AI app's MCP config. The common pieces are:
- ```text
- command: uv
- args: ["tool", "run", "--python", "3.12", "build123d-mcp@latest"]
- ```
- > 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:
- ```json
- {
- "mcpServers": {
- "build123d-mcp": {
- "command": "uv",
- "args": ["tool", "run", "--python", "3.12", "build123d-mcp@latest"]
- }
- }
- }
- ```
- 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:
- ```json
- {
- "mcpServers": {
- "build123d-mcp": {
- "command": "uv",
- "args": ["tool", "run", "--python", "3.12", "build123d-mcp@latest"]
- }
- }
- }
- ```
- Restart Claude Desktop after saving.
- ### Cursor
- Open **Settings -> MCP** and add a new server entry, or edit
- `~/.cursor/mcp.json`:
- ```json
- {
- "mcpServers": {
- "build123d-mcp": {
- "command": "uv",
- "args": ["tool", "run", "--python", "3.12", "build123d-mcp@latest"]
- }
- }
- }
- ```
- ### 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:
- ```text
- command: uv
- args: ["tool", "run", "--python", "3.12", "build123d-mcp@latest"]
- ```
- 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:
- ```json
- {
- "servers": {
- "build123d-mcp": {
- "type": "stdio",
- "command": "uv",
- "args": ["tool", "run", "--python", "3.12", "build123d-mcp@latest"]
- }
- }
- }
- ```
- ## First Test Prompt
- Once your AI app is connected to the server, ask your assistant something
- concrete:
- ```text
- Use build123d-mcp to make a 60 mm x 40 mm x 6 mm mounting plate with two
- 5 mm through holes 40 mm apart. Render it, measure it, then export STEP and STL.
- ```
- The useful loop is:
- 1. Build one feature at a time.
- 2. Render or measure after important steps.
- 3. Validate before export.
- 4. 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
- `import_cad_file("input.step", "part")` binds the exact imported object as `part`
- inside `execute()`. Named registrations and replacements through `show`,
- `edit_feature`, library loading and drawing helpers also bind safe identifiers.
- Responses provide `execute_name`; names colliding with builtins, helpers, imports
- or unrelated user variables remain accessible with `get_object("name")`.
- Snapshot restore rebinds registered objects; reset clears them.
- After importing a STEP and establishing a valid baseline, call
- `inspect_features(target="part")` for measures and a compact feature inventory.
- Expand `families="holes,bosses,fillets"`, or request analytic face descriptors
- with `feature_ids="holes:12@<digest>"`. Coordinates match the input model.
- Paste the returned face descriptors into `select_faces(part, faces=...)` inside
- `execute()` to get live build123d faces; each descriptor must match exactly one
- face. Keyword filters such as `select_faces(part, kind="cylinder", radius=4)`
- return all matches. Descriptor mode rejects empty/duplicate selections and
- keyword filters combined with `faces=`. No helper import is needed. Reassigning
- a bound variable warns that the registry is unchanged. Register edits with
- `show(edited, "part")` to replace the object and its binding. For a plain
- through hole, `edit_feature(feature_id="holes:12@<digest>", diameter=8, object_name="part",
- protected_refs='["holes:13@<digest>"]')` verifies predicted material change, other holes
- and the envelope before registering the result. Complex hole stacks are refused.
- Inspect again after edits. Verify revisions with
- `diff_step(old="input.step", new="part", render=True)` and the STEP export gate.
- The diff reports feature changes and bare analytic face changes; its descriptors
- do not prove trim-contour equality. Python 3.11 or later is supported.
- Good prompts usually ask the assistant to use the MCP tools explicitly and to
- verify the result before exporting. For example:
- ```text
- Use build123d-mcp. Build this incrementally, render after the main features,
- measure the final dimensions, run validate(), and export STEP if it passes.
- ```
- ## Try It In GitHub Codespaces With Copilot
- You can also run the project in a browser with GitHub Codespaces:
- [Open in GitHub Codespaces](https://codespaces.new/pzfreo/build123d-mcp)
- 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:
- - [Using Copilot in Codespaces](https://docs.github.com/en/codespaces/reference/using-github-copilot-in-github-codespaces)
- - [Extending Copilot Chat with MCP](https://docs.github.com/copilot/customizing-copilot/using-model-context-protocol/extending-copilot-chat-with-mcp)
- 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:
- ```bash
- uv sync --all-groups
- ```
- To check the development install:
- ```bash
- uv run build123d-mcp --version
- uv run pytest
- ```
- To use Copilot with the local CAD server:
- 1. Open the codespace.
- 2. Wait for setup to finish.
- 3. Open Copilot Chat and choose Agent mode.
- 4. Open `.vscode/mcp.json` and start the `build123d-mcp` server if VS Code has
- not started it already.
- 5. Ask the first test prompt from the previous section.
- The Codespaces MCP config points at the local checkout rather than the PyPI
- package:
- ```json
- {
- "servers": {
- "build123d-mcp": {
- "type": "stdio",
- "command": "uv",
- "args": ["run", "build123d-mcp"]
- }
- }
- }
- ```
- 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](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:
- ```text
- install_skill(target="agents-md", skill="modeling")
- install_skill(target="agents-md", skill="drawing")
- install_skill(target="agents-md", skill="repair")
- ```
- `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](default_prompt.md) into your AI app as a
- system prompt.
- ## Developer Setup
- For local development:
- ```bash
- git clone https://github.com/pzfreo/build123d-mcp.git
- cd build123d-mcp
- uv sync --all-groups
- uv run build123d-mcp --version
- uv run pytest
- ```
- To run the server from this checkout in an AI app, use:
- ```text
- command: uv
- args: ["run", "build123d-mcp"]
- ```
- See [CONTRIBUTING.md](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:
- ```bash
- uv tool run --python 3.12 "build123d-mcp[http]@latest" \
- --transport http --host 127.0.0.1 --port 8000
- ```
- HTTP-capable apps then connect to:
- ```text
- http://localhost:8000/mcp
- ```
- 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.
- HTTP mode enforces the MCP SDK's DNS-rebinding protection (Host/Origin
- header validation). With no extra flags only localhost Host headers
- (`127.0.0.1`, `localhost`, `::1`, any port) are accepted, regardless of
- `--host`. When the server is reached under a real hostname (reverse proxy,
- gateway, LAN or container bind), add the names. They are added to the
- localhost defaults, not substituted for them:
- ```bash
- uv tool run --python 3.12 "build123d-mcp[http]@latest" \
- --transport http --host 0.0.0.0 --port 8000 \
- --allowed-hosts 'cad.example.com,cad.example.com:*' \
- --allowed-origins 'http://cad.example.com,https://cad.example.com'
- ```
- `--allowed-origins` only matters for browser-based clients. A `:*` suffix
- wildcards the port but does not match the default port, so list the bare
- origin (and the `https://` form behind a TLS proxy) as well. Or, when a
- proxy/gateway terminates the real host and you trust the network layer,
- turn the check off. This removes the only browser-origin protection on a server
- with no authentication and a code-execution tool, so use it only behind a gateway
- you trust (the SDK check is all-or-nothing):
- ```bash
- uv tool run --python 3.12 "build123d-mcp[http]@latest" \
- --transport http --host 0.0.0.0 --port 8000 --allow-all
- ```
- `--disable-dns-rebinding-protection` is an alias of `--allow-all`;
- `--no-allow-all` overrides `BUILD123D_ALLOW_ALL=1` from the environment, and
- `--allowed-hosts ''` clears an allowlist set in the environment. Entries must be
- exact (no `*.example.com`), IPv6 hosts bracketed, and origins carry a scheme.
- Env vars: `BUILD123D_ALLOWED_HOSTS`, `BUILD123D_ALLOWED_ORIGINS`,
- `BUILD123D_ALLOW_ALL`. These flags apply to `--transport http` only.
- Other advanced topics:
- - Security model and sandboxing: [security.md](security.md)
- - Complete tool reference: [llms.md](llms.md)
- - Live session viewer: [docs/live-viewer.md](docs/live-viewer.md)
- - Changelog: [CHANGELOG.md](CHANGELOG.md)
- ## Status
- Active development.
- <!-- mcp-name: io.github.pzfreo/build123d-mcp -->
Ratings and comments
Sign in to rate this skill.
Sign inFree to use. If it’s helped, pass it on.