Purpose
build123d-mcp is an MCP server that provides support for build123d parametric CAD, used to enhance AI's cognitive capabilities when creating 3D CAD models. It is not itself a standalone chatbot or CAD program, but rather a CAD toolbox for AI/LLM applications to call via MCP. With the help of LLM applications such as Claude, Cursor, VS Code, Continue, Cline, and Codex CLI, assistants can create build123d CAD models, render previews, measure geometry, fix errors, and export files such as STEP, STL, SVG, and DXF. Instead of blindly writing a complete CAD script, assistants can build parts in small steps and check the results at any time.
Main Capabilities
The tools available to the assistant include:
- Executing build123d code in a persistent CAD session
- Rendering PNG, SVG, and DXF previews
- Measuring volume, area, bounding box, topology, and centroid
- Finding holes, bosses, counterbores, and hole arrays
- Checking printability, fit/alignment comparisons, and export validity
- Importing STEP/STL files for comparison
- Exporting STEP, STL, DXF, SVG, or multiple formats at once
- Saving and restoring session snapshots
- Generating 2D engineering drawing previews See llms.md for the complete tool and resource reference.
Usage
Most users should start with local MCP server setup: use Claude, Cursor, VS Code, Continue, Cline, or Codex CLI on their local machine; the AI application launches build123d-mcp as a local subprocess; there is no need to clone this repository. If you need a browser-only trial, or need a ready-made development workspace with Copilot Chat, Python, uv, and CAD dependencies preinstalled, you can use GitHub Codespaces. HTTP mode is only for advanced deployments where you host the MCP server yourself.
Ordinary use requires no cloning of the repository. You can first check whether the package can start, then add the same command to your AI application's MCP configuration. Python 3.11, 3.12, 3.13, and 3.14 are supported; the examples use 3.12, and uv can automatically download it if it is not installed.
Connecting involves three parts: the LLM application is where you talk with the assistant; MCP is the connection that lets the assistant call tools; build123d-mcp is the CAD tool server that the assistant calls. The server usually runs via stdio, and the AI application launches it as a local subprocess when CAD tools are needed. You can add the configuration in the project's .mcp.json or the global ~/.claude/mcp.json, and restart Claude Code after editing; for Claude Desktop, edit ~/Library/Application Support/Claude/claude_desktop_config.json on macOS or %APPDATA%\Claude\claude_desktop_config.json on Windows, and restart after saving; for Cursor, you can add a server entry in Settings -> MCP, or edit ~/.cursor/mcp.json. VS Code, Continue, Cline, and Codex CLI use the same command and arguments, and the specific configuration file names vary by application. MCP support for GitHub Copilot in VS Code: the repository includes a .vscode/mcp.json for development checkouts and Codespaces, and other workspace configurations are similar.
First test prompt: after connecting, make a specific request to the assistant. The effective loop is: build one feature at a time; render or measure after important steps; validate before exporting; export the final part. If something goes wrong, have the assistant check last_error, fix the script, and try a smaller next step.
Editing imported parts: after importing a STEP and establishing a valid baseline, you can use find_candidates(kind="hole", qualifiers='{"axis":"Z","side":"+X"}', stated_value=6) to list all identified candidates, and check every correct rotation of the part's literal axis with the requested frame (grouped by their respective selected candidates). interface_features() will suggest the planes that carry holes; select the hole handles you want to protect. For ordinary through holes, edit_feature(handle, diameter=8, protected_refs='["@feature[...]"]') will adjust their dimensions and report the predicted and measured volume increase or decrease. Only when that hole,Results are registered only when all other recognized holes and the outer envelope pass the checks. Holes with counterbores, spotfaces, countersinks, or multiple constituent faces are rejected; these should be edited in execute() and verified with compare(kind="shape") and the STEP export gate.
Good prompts usually ask the assistant to explicitly use MCP tools and to verify results before exporting.
Try it with Copilot in GitHub Codespaces: this project can run in a browser via GitHub Codespaces. For beginners, this is the closest path to "GitHub-hosted LLM + MCP": GitHub Codespaces provides VS Code in the browser; GitHub Copilot Chat provides the LLM assistant; build123d-mcp runs inside the codespace as the MCP CAD tool server. The LLM part requires GitHub Copilot access. The codespace itself provides a one-time workspace with the project checked out and the correct Python/CAD dependencies installed, suitable for trying the project without changing local settings, running tests before contributing, and using Copilot Chat and build123d-mcp together in the same browser workspace. The repository includes a dev container that installs Python 3.12, uv, and the Linux display packages needed for headless rendering, also installs the GitHub Copilot VS Code extension, and includes the workspace MCP configuration in .vscode/mcp.json. After the codespace opens, the relevant commands run. To check the development installation, use the corresponding command. Using Copilot with a local CAD server: open the codespace; wait for setup to finish; open Copilot Chat and select Agent mode; if VS Code has not started yet, open .vscode/mcp.json to start the build123d-mcp server; submit the first test prompt from earlier. The Codespaces MCP configuration points to the local checkout rather than the PyPI package. For local desktop AI applications, the usual uv tool run ... build123d-mcp@latest setup is morestraightforward, because these applications expect to start the MCP server locally.
Assistant guidance
The server includes workflow guidance to help the assistant use the CAD loop correctly, which is especially useful in coding agents that read the project guidance file. After connecting the server, you can have the assistant call install_skill to get the required workflow. install_skill also supports target="claude", "cursor", and "windsurf". skill="modeling" is for 3D parts, skill="drawing" is for engineering drawings, and skill="repair" is for when solid validation fails. You can also paste default_prompt.md into the AI application as a system prompt.
Developer setup
See the repository documentation for commands related to local development. To run the server in an AI application from this checkout, use the corresponding command. See CONTRIBUTING.md for contribution guidelines.
When to use it and limitations
The default stdio transport provides an independent isolated session for each application process. HTTP mode can be used for web, container, or remote deployments, and HTTP-capable applications connect to the corresponding address. HTTP mode has no built-in authentication, and unless the host provides per-request session middleware, it uses one shared CAD session, so do not expose it directly to multiple users. Other advanced topics: see security.md for the security model and sandboxing, llms.md for the complete tool reference, docs/live-viewer.md for the live session viewer, and CHANGELOG.md for the changelog. The project is under active development.