CADPilot

CADPilot

AI pilots FreeCAD. Provides full control of FreeCAD for parametric modeling, assembly, geometry sensing, and more via MCP tool calls.

Category
访问服务器

README

CADPilot

English | Chinese

AI pilots FreeCAD. CADPilot is an MCP (Model Context Protocol) server that gives AI clients (Cherry Studio, Claude Code, ZCode, Kimi Code, Claude Desktop, …) full control of FreeCAD: create documents, build constrained sketches, run parametric features, assemble parts with persistent joints, and verify geometry — all via tool calls over XML-RPC.

Showcase

Models built by the AI through CADPilot — demo files live in examples/:

Modern Bicycle (uncolored) Sports Car (colored)
Modern bicycle modeled by CADPilot Sports car modeled by CADPilot

Features

  • Parametric modeling, end to end — spreadsheet-driven variables, fully constrained sketches, PartDesign features (pad/pocket/revolution/…), dress-up ops, and a multi-view 2D→3D visual hull, all through one unified cad() tool.
  • Step recording & rollback — every mutation runs in a FreeCAD transaction and is recorded as a session step; session_rollback backtracks via native undo, so the AI can experiment and retry instead of rebuilding from scratch.
  • Persistence — sessions, patterns, and settings survive restarts as JSON under ~/.cadpilot/; pause a session today, resume it tomorrow.
  • Geometry sensing — measure volumes/areas, inspect face/edge topology, and check interference after every step; quantitative feedback replaces guesswork on complex models.
  • Data-driven assembly — named anchors, residual-checked mates, connectivity audits, and persistent joints (FreeCAD 1.1 Assembly workbench) with declarative priority trimming.
  • Workflow memory — successful modeling recipes are stored as reusable patterns and recalled on demand; the agent gets better the more you use it.
  • Token-friendly — text-first responses with opt-in screenshots (768 px cap), a tiny tool surface, and on-demand operation docs keep context usage low.

Installation

Step 1: Install the FreeCAD addon

FreeCAD addon directory:

  • Windows: %APPDATA%\FreeCAD\Mod\
  • macOS:
    • FreeCAD 1.1: ~/Library/Application Support/FreeCAD/v1-1/Mod/
    • FreeCAD 1.0: ~/Library/Application Support/FreeCAD/v1-0/Mod/
  • Linux:
    • Ubuntu: ~/.FreeCAD/Mod/ or ~/snap/freecad/common/Mod/ (snap installs)
    • Debian: ~/.local/share/FreeCAD/Mod
    • Arch / CachyOS (FreeCAD 1.1 from extra/freecad): ~/.local/share/FreeCAD/v1-1/Mod/

Copy the addon/CADPilot directory into the addon directory:

git clone https://github.com/LBurny/cadpilot.git
cd cadpilot

# Linux (Ubuntu/Debian)
mkdir -p ~/.FreeCAD/Mod/
cp -r addon/CADPilot ~/.FreeCAD/Mod/

# macOS (FreeCAD 1.1)
mkdir -p ~/Library/Application\ Support/FreeCAD/v1-1/Mod/
cp -r addon/CADPilot ~/Library/Application\ Support/FreeCAD/v1-1/Mod/

# Windows (PowerShell)
Copy-Item -Recurse addon/CADPilot "$env:APPDATA\FreeCAD\Mod\"

Restart FreeCAD, select CADPilot from the workbench list, and start the RPC server with the Start RPC Server command in the CADPilot toolbar. To start it automatically on every launch, enable Auto-Start Server in the CADPilot menu.

Step 2: Install the MCP server

Option A: PyPI (recommended)

With uv installed, no explicit install is needed — uvx fetches the package from PyPI on first use:

uvx cadpilot

Or with pip: pip install cadpilot

Option B: From source

git clone https://github.com/LBurny/cadpilot.git
cd cadpilot
uv sync

Then use this MCP client configuration instead of the one below — replace /path/to/cadpilot with the actual clone path (--no-sync skips the editable rebuild on every launch, which would fail while another server instance is running):

{
  "mcpServers": {
    "cadpilot": {
      "command": "uv",
      "args": ["--directory", "/path/to/cadpilot", "run", "--no-sync", "cadpilot"]
    }
  }
}

The server speaks MCP on stdio and connects to FreeCAD's XML-RPC addon on localhost:9875 — you normally don't run it by hand; your AI client launches it via the configuration below.

Client setup

All MCP clients that support stdio servers use the same configuration — command uvx, args ["cadpilot"]. Paste this snippet into your client's MCP configuration (Claude Code, Kimi Code, Cherry Studio, ZCode, Claude Desktop, Cursor, …):

{
  "mcpServers": {
    "cadpilot": {
      "command": "uvx",
      "args": ["cadpilot"]
    }
  }
}

Startup options

Tool responses are text-only by default — screenshots are opt-in per call (with_screenshot=true) or via the get_view tool, which keeps token usage low. Startup flags:

  • --with-screenshots: attach a screenshot to every mutation/read tool response (for multimodal models)
  • --only-text-feedback: never return screenshots, even when requested (hard guarantee for text-only models)
  • --host <ip>: connect to a FreeCAD instance on another machine
{
  "mcpServers": {
    "cadpilot": {
      "command": "uvx",
      "args": ["cadpilot", "--with-screenshots"]
    }
  }
}

Remote connections

By default the RPC server listens on localhost only. To control FreeCAD from another machine:

  1. In the CADPilot toolbar, enable Remote Connections (the server binds to 0.0.0.0 on next restart) and click Configure Allowed IPs to enter a comma-separated list of allowed IP addresses or CIDR subnets, e.g. 192.168.1.100, 10.0.0.0/24. Only listed addresses can connect; restart the RPC server after changing settings.
  2. Point the MCP server at that machine: "args": ["cadpilot", "--host", "192.168.1.100"].

Tools

  • cad — unified CAD mutation tool: create_object / edit_object / delete_object / batch, parametric feature ops (boolean / fillet / chamfer / loft / sweep / mirror / pattern / move), Sketcher/PartDesign ops (variables / sketch / pad / pocket / revolution / groove / thickness / draft / datum_plane / hull). Edge/face selectors are fed by get_topology; every mutation is transactional and rollback-able.
  • execute_code / execute_code_async / get_task_result — run arbitrary Python in FreeCAD (GUI-thread safe), or background-safe code for long OCCT computations with polling.
  • Modeling sessionssession_start / session_status / session_get_steps / session_rollback / session_redo / session_add_note / session_pause / session_resume / session_list / session_complete: step recording with rollback via FreeCAD's native transaction undo.
  • Knowledge hierarchysave_pattern / recall_patterns (reusable workflow memory), inspect_freecad (runtime API introspection), operation_help (per-operation reference docs).
  • Geometry sensingmeasure_geometry / get_topology / check_interference / get_positioning_info: quantitative feedback after each modeling step.
  • Assemblyget_anchors / set_anchors / assemble / align_shapes / verify_assembly for data-driven spatial positioning; assembly_session for mate-based assembly with persistent joints (FreeCAD 1.1 Assembly workbench) and declarative priority trimming.
  • Documents & viewscreate_document / list_documents / get_objects / get_object / get_view (screenshots capped at 768 px on the long edge by default).

See the design document for the architecture behind these tools, and try the demo model examples/ModernBicycle.FCStd in FreeCAD.

Documentation

Development

git clone https://github.com/LBurny/cadpilot.git
cd cadpilot
uv sync
uv run pytest          # run the test suite
uv run ruff check .    # lint
uv run cadpilot        # run the MCP server from source

Acknowledgments

This project was originally based on neka-nat/freecad-mcp by Shirokuma (k tanaka) — many thanks to the original authors; parts of this project are derived from their work (MIT License).

License

MIT — see LICENSE.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选