Skip to main content

MCP server wrapping build123d for interactive 3D CAD

Project description

build123d-mcp

PyPI version Python CI License: MIT build123d-mcp MCP server

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.

Why

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.

Tools

  • execute — run build123d Python code in a persistent session; use show(shape, name) to register named parts
  • render_view — render one or more shapes as PNG or SVG; supports assembly compositing, high-quality tessellation, and cross-section clip planes
  • measure — query bounding box, volume, surface area, topology, minimum wall thickness, or clearance between two named bodies
  • export — export as STEP, STL, or both in one call; targets a named object or the current shape
  • session_state — full JSON snapshot of active shapes, named objects, and snapshot names
  • health_check — verify VTK/SVG/STEP/STL dependencies work end-to-end before starting work
  • save_snapshot / restore_snapshot / diff_snapshot — checkpoint, recover, and compare geometric state
  • interference — check intersection volume between two named shapes
  • list_objects — list all named shapes with geometry stats
  • version — return the server version
  • reset — clear the session back to empty state

See llms.md for full tool reference and usage patterns.

Requirements

  • uv
  • An MCP-compatible client (Claude Code, Claude Desktop, Cursor, etc.)

All Python dependencies (build123d, vtk, etc.) are installed automatically by uv.

Installation

No clone needed. Install directly from PyPI:

pip install build123d-mcp

Or just use uv tool run — it fetches and runs the package in one step with no prior install required (see below).


Adding to MCP clients

The server runs over stdio — the client launches it as a subprocess using uv tool run build123d-mcp.

Note on Python version. All examples below pass --python 3.12. VTK and cadquery-ocp do not yet ship wheels for Python 3.13+, so pinning to 3.12 is required. uv will auto-download a managed Python 3.12 if you don't already have one.

Claude Code

Add to your project's .mcp.json (or ~/.claude/mcp.json for global use):

{
  "mcpServers": {
    "build123d-mcp": {
      "command": "uv",
      "args": ["tool", "run", "--python", "3.12", "build123d-mcp"]
    }
  }
}

Restart Claude Code after editing. The tools appear automatically once connected.

Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "build123d-mcp": {
      "command": "uv",
      "args": ["tool", "run", "--python", "3.12", "build123d-mcp"]
    }
  }
}

Restart Claude Desktop after saving.

Cursor

Open Settings → MCP and add a new server entry, or edit ~/.cursor/mcp.json:

{
  "mcpServers": {
    "build123d-mcp": {
      "command": "uv",
      "args": ["tool", "run", "--python", "3.12", "build123d-mcp"]
    }
  }
}

VS Code (GitHub Copilot / Continue)

For Continue extension, add to .continue/config.json:

{
  "mcpServers": [
    {
      "name": "build123d-mcp",
      "command": "uv",
      "args": ["tool", "run", "--python", "3.12", "build123d-mcp"]
    }
  ]
}

For GitHub Copilot with MCP support, add to .vscode/mcp.json in your workspace:

{
  "servers": {
    "build123d-mcp": {
      "type": "stdio",
      "command": "uv",
      "args": ["tool", "run", "--python", "3.12", "build123d-mcp"]
    }
  }
}

System prompt

For best results, paste the contents of default_prompt.md as a system prompt in your AI client. This tells the assistant to work incrementally, verify geometry after each step, and use the tools in the right order.


Status

Active development (v0.1.0).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

build123d_mcp-0.3.12.tar.gz (158.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

build123d_mcp-0.3.12-py3-none-any.whl (41.7 kB view details)

Uploaded Python 3

File details

Details for the file build123d_mcp-0.3.12.tar.gz.

File metadata

  • Download URL: build123d_mcp-0.3.12.tar.gz
  • Upload date:
  • Size: 158.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for build123d_mcp-0.3.12.tar.gz
Algorithm Hash digest
SHA256 7730fac1dd9c8cabd3f11bd9fe7ab69bb651223938377716ccb9efe88c50bb7b
MD5 4472b50d049eee4ac06356fb06cc76a6
BLAKE2b-256 fe5aa4e5a8546b9d6b9b326b9955c40e06669cfdc7497e441837d12546ba508a

See more details on using hashes here.

Provenance

The following attestation bundles were made for build123d_mcp-0.3.12.tar.gz:

Publisher: publish.yml on pzfreo/build123d-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file build123d_mcp-0.3.12-py3-none-any.whl.

File metadata

  • Download URL: build123d_mcp-0.3.12-py3-none-any.whl
  • Upload date:
  • Size: 41.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for build123d_mcp-0.3.12-py3-none-any.whl
Algorithm Hash digest
SHA256 3cd198d8e85440690eaffd54d959d57b995eb573926dd9ecf99161e09fd52309
MD5 3eb1bccf40b4975341394cb6f73ddaba
BLAKE2b-256 feef29e0be1ad1c9c6d5cb2fd5cbc9a5f5b0ac4da0371e59ce1e98fc158ba4cf

See more details on using hashes here.

Provenance

The following attestation bundles were made for build123d_mcp-0.3.12-py3-none-any.whl:

Publisher: publish.yml on pzfreo/build123d-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page