MCP server for build123d to improve AI cognition when creating 3D CAD models
README
An MCP (Model Context Protocol) server that exposes build123d CAD operations as tools, enabling AI assistants to build, inspect, and iterate on 3D geometry interactively.
When using an AI to write build123d scripts, the AI writes blind — it cannot see the geometry it produces. This server closes the feedback loop: the AI can create geometry, render views, query dimensions, and catch errors incrementally rather than writing complete scripts and hoping they are correct.
Core
execute — run build123d Python code in a persistent session; use show(shape, name) to register named partsreset — clear session back to empty state (namespace, shapes, snapshots)Geometry inspection
measure — full geometric summary: volume, area, topology, bounding box, centre of mass, inertia tensor, face-type inventoryclearance — minimum distance (mm) between two named shapescross_sections — cross-sectional areas at evenly spaced planes along X/Y/Z; useful for detecting voids and wall-thickness variationsession_state — full JSON snapshot of active shapes, named objects, snapshot names, and Python namespace variableslast_error — details of the last failed execute(): type, message, line number, and code excerptViewing
render_view — render one or more shapes as PNG / SVG / DXF; auto-detects 3D vs 2D inputs (compos