Skip to main content

MCP server wrapping build123d for interactive 3D CAD

Project description

build123d-mcp

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(name, shape) to register named parts
  • render_view — render one or more shapes as PNG; supports assembly compositing, high-quality tessellation, and cross-section clip planes
  • measure — query bounding box, volume, surface area, 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
  • save_snapshot / restore_snapshot — checkpoint and recover geometric state without re-running prior code
  • reset — clear the session back to empty state

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

Requirements

  • Python 3.10+
  • uv (recommended) or pip
  • build123d, pyvista (installed automatically via uv)
  • An MCP-compatible client (Claude Code, Claude Desktop, Cursor, etc.)

Installation

Clone the repository:

git clone https://github.com/pzfreo/build123d-mcp
cd build123d-mcp

Install dependencies with uv:

uv sync

Or with pip:

pip install -e .

Adding to MCP clients

The server runs over stdio — the client launches it as a subprocess. The command in all cases is:

uv run python server.py

run from the build123d-mcp directory.

Claude Code

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

{
  "mcpServers": {
    "build123d-mcp": {
      "command": "uv",
      "args": ["run", "python", "server.py"],
      "cwd": "/path/to/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": ["run", "python", "server.py"],
      "cwd": "/path/to/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": ["run", "python", "server.py"],
      "cwd": "/path/to/build123d-mcp"
    }
  }
}

VS Code (GitHub Copilot / Continue)

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

{
  "mcpServers": [
    {
      "name": "build123d-mcp",
      "command": "uv",
      "args": ["run", "python", "server.py"],
      "cwd": "/path/to/build123d-mcp"
    }
  ]
}

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

{
  "servers": {
    "build123d-mcp": {
      "type": "stdio",
      "command": "uv",
      "args": ["run", "python", "server.py"],
      "cwd": "/path/to/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.2.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.1.0.tar.gz (172.2 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.1.0-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: build123d_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 172.2 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.1.0.tar.gz
Algorithm Hash digest
SHA256 6bbfbc4f1e8523633f7baa5232dba01d94304132e85ce576c577d9aedee385f8
MD5 6131c374bb57ea2570dcfb882ad3efff
BLAKE2b-256 31660c4ab343735d2303fa49f8543165b8542901a31630be42bcf85d86d6c820

See more details on using hashes here.

Provenance

The following attestation bundles were made for build123d_mcp-0.1.0.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.1.0-py3-none-any.whl.

File metadata

  • Download URL: build123d_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.4 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 873685374e77a1c58a1e77deb427b0d049864624191356348c41b4c41e3cbe0c
MD5 615c73980570fcf2bc4b14c2d43baed4
BLAKE2b-256 6aa18de4bf8e71293300c56c390c6ee882456bc0ec0d92ea2cbbb727eede407e

See more details on using hashes here.

Provenance

The following attestation bundles were made for build123d_mcp-0.1.0-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