Drive FreeCAD from an agent

AnkusDrive is a CLI and MCP server that wraps FreeCAD's Python API in 280+ typed tools, so Claude or any MCP client can model parts, make drawings and run FEM and multiphysics simulation without clicking through the GUI.

pipx install ankusdrive
v0.5.7Latest release, 29 Oct 2026
Apache-2.0Open source
Mac, Linux, WindowsFreeCAD 1.1
QCreate a 60 × 40 × 10 mm mounting plate with four 5.5 mm through-holes, each 5 mm in from the nearest two edges. Confirm it's a single watertight solid, then give me its volume and its mass in aluminum.
  1. new_document
  2. add_primitive box
  3. add_primitive cyl ×4
  4. boolean_op cut
  5. check_shape
  6. mass_properties
PartMounting plate
CheckWatertight solid
Volume23,049.7 mm³
Mass, Al 2.70 g/cm³62.2 g

Example 1 from the reviewer guide. The same scenario runs against the real server and FreeCAD on every change.

Ask in plain words, get checked engineering back

The agent picks the tools; AnkusDrive returns structured results and the gates that say whether the answer holds. Three scenarios, with the results the automated test expects.

Model a part and check it

Mounting plate with four M5 clearance holes. Confirm one watertight solid, then volume and mass in aluminum.
Solid checkWatertight
Volume≈ 23,049.7 mm³
Mass (2.70 g/cm³)≈ 62.2 g

new_document, add_primitive, boolean_op, check_shape, mass_properties

Structural FEM, against theory

Steel cantilever, 100 mm long, 10 × 10 mm section, 100 N at the tip, second-order elements. Compare with Euler–Bernoulli.
Tip displacement0.1907 mm theory 0.1905
Max von Mises59.7 MPa theory 60

fem_new_analysis, fem_set_material, fem_add_constraint, fem_mesh, fem_run, fem_results

A drawing, and an honest gate

Three views, overall dimensions, title block, DXF to my Desktop. Then: is it complete enough to make the part?
DXF export3 views, overall dims
drawing_gateFails, correctly
Reported missingHole size and positions

make_drawing_page, add_projection_group, set_title_block, export_drawing, drawing_gate

280+ tools, from a sketch to a release package

Every tool has validated parameters and returns JSON. Geometry tools hand back stable handles like pad_1 that later calls reference.

Parametric modeling

Sketches, constraints and the full PartDesign feature set.

make_sketch, pad, pocket, revolve, loft, sweep, hole

Standard components

Gears, racks, springs, fasteners, bearings and threads, plus catalog sizes you can actually buy.

add_gear, add_fastener, catalog_nearest

Measure and inspect

Distances, clearances, interference and shape validity, on stable face and edge tags.

measure_distance, min_clearance, check_shape

Technical drawings

Headless TechDraw with views, dimensions, GD&T and title blocks, exported to PDF, SVG or DXF.

add_projection_group, add_gdt_callout, drawing_gate

FEM

Static, modal, buckling, thermal and nonlinear analysis with CalculiX or Elmer.

fem_mesh, fem_modal, fem_run_submit, fem_result_probe

Hand-calcs and oracles

Machine elements, structural, fatigue, thermal and tolerance checks to sanity-test a solve.

bearing_life, bolted_joint_check, tolerance_stackup

Multiphysics simulation

CFD, conjugate heat transfer, EM, acoustics, FSI, molding, impact, DEM, optics and multibody, as async jobs.

cfd_external_flow_submit, em_fullwave_submit, job_result

Specs and optimization

Declare a performance spec, sweep a design space, or optimize until every constraint is proven.

declare_performance, study_submit, optimize_submit

Manufacturability and cost

DFM, molding, sheet metal, CNC time and tolerance-to-cost checks.

dfm_check, sheet_flat_export, cnc_time_estimate

Design control

Part numbers, recipes, variant families, lifecycle, ECOs and versioned interfaces.

items_new, family_materialize, eco_create

Release packages

STEP, drawings, BOM and inspection package with a checksummed manifest, gated before anything is written.

release_package, fai_report, bom_extract

Rendering and review

Multi-view and photoreal renders, plus an opt-in second opinion from Claude's vision.

render_views, render_photoreal, visual_review

Typed MCP tools

The everyday path. Grouped into toolsets you can switch on and off to save context.

Property reflection

get_object and set_property reach any property a typed tool doesn't expose.

run_script

The escape hatch to the whole FreeCAD API. Off by default in the Claude Desktop extension.

Built with AnkusDrive

A whole instrument, designed by an agent driving FreeCAD headless and checked in the CAD before anything was printed.

Rendered incubator imager, assembled
Assembled: the plate in its nest on the XY stage, the LED arm over the optical axis, the looms under the deck.
Case study · design package rev 0.3

Incubator Imager

A printable well-plate imager that sits on one shelf of a CO₂ incubator. The plate moves on an XY stage while the optics stay fixed, and every hour it images each well of a 6-, 24- or 96-well plate.

3.77 × 2.83 mmfield at 4×, one per 96 well
1.86 µm/px2 × 2 binned
6.5 minper 96-well plate, 5 images per well
295 × 260 × 157 mmenvelope, fits one shelf
  • One parametric FreeCAD script, run headless. 46 bodies, 15 printed parts, and every screw and heat-set insert placed in the model.
  • 0 interferences, 0 in the light path. Eight stage, focus, slider and plate configurations were checked pairwise, and against the imaging bundle and illumination hull.
  • The sweeps changed the design. Y travel dropped to ±34 mm because the nest's ledge vignetted the field at ±37, and the leadscrew moved outboard after its nut crossed the objective.
  • Assembly drawn step by step from the same model, and rendered in Blender Cycles.

From the imager's design package. The CAD source and build files aren't published.

Install in about five minutes

FreeCAD is the only thing you install separately. CalculiX and gmsh ship inside every FreeCAD install, so CAD and structural FEM work out of the box.

  1. Install FreeCAD 1.1

    From freecad.org, into its default location. AnkusDrive finds it on each OS; set ANKUSDRIVE_FREECADCMD if yours lives elsewhere.

  2. Install AnkusDrive

    Python 3.10 to 3.14.

    pipx install ankusdrive      # or: pip install ankusdrive
  3. Check it can reach FreeCAD

    ankusdrive ping     # → ping=pong freecad=1.1.1
    ankusdrive doctor   # per-item checklist with the fix for each
  4. Add it to your MCP host

    Pick your client. After a restart you'll see the ankusdrive__* tools.

One click

Download ankusdrive-<version>.mcpb from the latest release and open it. Claude Desktop sets up Python with uv, so no pipx step. FreeCAD 1.1 is still needed; leave the FreeCAD path field empty unless auto-discovery misses it.

Or edit the config

~/Library/Application Support/Claude/claude_desktop_config.json on macOS, %APPDATA%\Claude\claude_desktop_config.json on Windows:

{
  "mcpServers": {
    "ankusdrive": { "command": "ankusdrive", "args": ["mcp"] }
  }
}

If the host can't find ankusdrive on its PATH, use the absolute path, for example ~/.local/bin/ankusdrive for pipx.

Keep context lean. All 283 tool definitions come to roughly 114k tokens. Set ANKUSDRIVE_TOOLSETS=drawings,fem,simulation (core is always on) to load only what you need. The Claude Desktop extension starts with core, drawings and fem, about 31k tokens.

Optional solvers, wherever you work

Heavy simulation families shell out to external solvers found at runtime. A missing solver returns a clean "not installed" with the install command, never a crash. ankusdrive doctor shows what resolves.

FamiliesSolvermacOSLinuxWindows
Structural FEMCalculiX, bundled with FreeCADNativeNativeNative
Multibody, topology, optics, fluidspip wheels via extrasNativeNativeNative
Internal-flow CFD, 3D-print slicingSU2, PrusaSlicerNativeNativeNative
Transient thermalElmerContainerNativeNative
CFD, FSI, injection moldingOpenFOAM, preCICE, openInjMoldSimContainerNativeWSL
Granular, full-wave EM, acousticsYADE, openEMS, BemppContainerNativeWSL

On a Mac the Linux solvers run in a signed, multi-arch container (native on Apple Silicon): docker pull ghcr.io/gchen19/ankusdrive-solvers, then ankusdrive doctor --verify-image. Full setup is in the README and Windows guide.

Where to get it

Runs on your machine

No telemetry, analytics or accounts, and no network requests from its own code unless you opt in to visual_review. Your MCP host's own policy covers what it sends to its model. Privacy policy

Open source

Apache-2.0, with inbound contributions under the same terms. The name and logo are trademarks; TRADEMARKS.md says what you can do without asking.

Alpha, moving fast

Pre-1.0: a minor release may break compatibility, so read the changelog before upgrading and pin an exact version if you need the guarantee.

How AnkusDrive was built and tested

Notes from the releases, the CI and the evals, and from the Claude Code sessions that did the work.

How it's tested How AnkusDrive is testedGoing public made our own build machines unsafe for fork PRs, and agent pass rates could slip unnoticed. Seven CI lanes now cover both.

Why we needed it: Taking the repo public (#303) meant pull requests from forks would run on our own build machines, so every lane had to move to GitHub-hosted runners that hold no keys. And a change to the renderer or to a tool's description could quietly lower how often agents succeed with no lane noticing (#517), so the paid evals had to run on a schedule.

An agent that drives CAD can fail in ways a unit test never sees, so AnkusDrive is tested in layers, and every layer runs on GitHub-hosted runners in the public repo.

Fast checks run on every push and pull request without installing FreeCAD. They catch the codebase's most common slip, a worker command and its MCP tool drifting apart, and give a pull request a signal in about a minute.

The full suite then runs on Linux and on Windows for every push to main and every pull request, fork pull requests included. Windows is provisioned the way a user installs it: the portable FreeCAD, then the project's own solver installer. A separate lane installs FreeCAD 1.1 from conda-forge daily to catch upstream build drift.

Heavy solves, the live OpenFOAM, Elmer, openEMS, Bempp, YADE, preCICE and SU2 cases, take minutes each, so they run daily and whenever solver code changes. Their cheap analytic-oracle halves still run on every push.

Paid evals run every Monday against the Anthropic API. They ask the questions pixel tests can't: when a render goes back to the model, can it say what it is looking at, and does each tool's description make Claude pick it?

An agent review comments on every pull request. It's advisory only: it can't approve or merge, and merging stays a maintainer's call.

Workflows · RELIABILITY.md · Link to this post

Build log When red CI isn't a code bugA failing FreeCAD suite on main turned out to have run zero tests.

Why we needed it: Main went red overnight, and the first question was whether code had broken or the run had never really happened.

The hosted FreeCAD suite went red on main one morning. Before touching any code, Claude Code checked whether the tests had run at all.

They hadn’t. Downloading FreeCAD from conda-forge kept failing on dropped connections, so the job died before a single test ran. The same commit had passed on main on the two previous days, and two pull-request runs built on it had passed too.

A quieter gap turned up on the way. Main had since moved on to a Dependabot bump of a GitHub Action that had never been tested, because merges made by Dependabot’s auto-merge don’t start workflows.

Rather than open a fix for a problem that wasn’t in the code, the session asked one question: run the suite on main now, or wait for the nightly? GC said “Run it now.” It passed on main’s newest commit in about two minutes.

The checklist it leaves behind for red CI: check that tests actually ran, compare against the same commit’s earlier runs, and check whether the newest commit was ever tested. Only then go looking for a code fix.

Link to this post

Build log Moving AnkusDrive to mcp 2.x, tested on four versionsWorking as a Claude tool meant supporting mcp 2.x, without dropping 1.x users.

Why we needed it: AnkusDrive had to support mcp 2.x to work as a Claude tool.

Issue #516 asked to move AnkusDrive’s MCP server to the mcp 2.x SDK without dropping 1.x users. It was one of five issues GC handed to parallel Claude Code agents; one agent took #516 and left the merge to GC.

The two SDK lines differ more than the version number suggests:

  • Server class: FastMCP became MCPServer.
  • Error text: from 2.1 on, a failing tool reaches the client as a bare “Error executing tool X”, without the reason.
  • Tool calls: call_tool now needs a context argument.
  • Threading: 2.x runs sync tools in a thread pool, where 1.x ran them on the event loop.

The port added a small compatibility module that picks the right server class, restores the error reason, and keeps per-call workspace pinning working across the thread hop. The dependency became mcp>=1.10,<3, with a contract test enforcing that ceiling.

Verification ran on mcp 1.10.0, 1.30.0, 2.0.0 and 2.3.0. tools/list returned the same 287 tools byte for byte on all four, the 35 MCP-related test files gave identical results, and a new stdio test fails on 2.3.0 if the error-text fix is removed. The automated review flagged one unused helper; GC said “Clean up, then merge,” and PR #524 closed the issue.

Issue #516 · PR #524 · Link to this post

v0.5.7 Agents that share a server stop stepping on each otherSubagents sharing one server were silently retargeting each other's work. Now each call names its own workspace.

Why we needed it: Claude Code subagents share their parent session's MCP server, and one agent switching workspace was silently retargeting every other agent's calls.

Several agents can share one MCP server. Claude Code subagents share their parent session’s. Until 0.5.7 the only way to keep their work apart was use_workspace, and its selection was server-wide, so one agent’s switch quietly retargeted every other agent’s calls. Now each call can name its own workspace.

Two FEM fixes ride along: a default mesh-size floor, so sliver edges in imported CAD no longer explode a mesh, and a CalculiX working directory per worker, so concurrent workspaces no longer share one.

Windows also gets the solvers that used to be Linux-only. OpenFOAM, FSI, molding, YADE, openEMS and Bempp run from the prebuilt solver image through Docker inside WSL, set up with one command, where they used to need hours of source builds.

0.5.7 changelog · Link to this post

v0.5.6 A result you can auditA design review needs to see how a design was made. Every tool call is now journalled, and a session replays as a script.

Why we needed it: To be a formal tool, AnkusDrive has to let a design review reliably reference how a design was made and what it was meant to do.

0.5.6 is about trusting a result after the fact. Every tool call is now journalled, and a session can be exported as a Python script that regenerates the model and its simulations.

That script checks every number a solve reported, names the exact solver binary and version that produced it, and diffs the input deck the solver was handed. With one setting the journal also goes to disk, where it outlasts the session.

The same release made a Mac a real solver host. YADE, Elmer, openEMS and Bempp joined OpenFOAM in a new runtime-only solver container, about a fifth of the CI image’s download, signed and scanned, and it records which solvers it holds so doctor can’t report a missing one as ready.

0.5.6 changelog · Link to this post

Build log Testing photoreal Blender rendering on macOSA renderer tested only on Linux got a full run on Apple Silicon: one slow first render and several installer bugs.

Why we needed it: In a sample run, Claude reached for Blender Cycles instead of AnkusDrive's own renderer, which raised the question of whether AnkusDrive should point to Blender. PR #357 added that, but as GC put it, “the tests were on a linux box,” so the macOS instructions needed checking.

PR #357 added photoreal rendering through Blender Cycles, plus an installer script, and had only been tested on Linux. GC asked Claude Code to “evaluate if blender cycles instructions for MacOS work.”

On an Apple Silicon Mac the path held up. The download matched its pinned hash, Blender 5.2.1 was detected with the Metal GPU as its render device, and all 18 Blender render tests passed along with the 7 in the photoreal suite. One thing worth knowing: the first render took 91.6 s while Metal compiled its kernels once, and later renders took about half a second.

The review found five small installer issues:

  • No “already installed” check.
  • It assumed Homebrew installs into one fixed folder.
  • It didn't handle Intel Macs with Homebrew.
  • It could leave the disk image mounted after a failure.
  • --list and --help gave misleading output.

Fixing those turned up a bug Linux testing had missed: every successful install exited with status 1, because the cleanup step ran last and ended on a failing test.

To finish, the session started the branch’s own AnkusDrive MCP server, built a gear pair on bearings and shafts over a brushed-aluminium plate, and rendered it with one render_photoreal call: nine parts, each with its own appearance, 384 samples at 1280×960, in 15 s on Metal.

PR #357 · Link to this post

v0.5.5 From 114k tokens to 31kGetting into Anthropic's directory meant a session couldn't start 114k tokens deep.

Why we needed it: AnkusDrive was being listed in MCP directories, including Anthropic's, and Anthropic's new software policy had to be met point by point. A session was paying about 114k tokens of tool definitions before its first call.

Before 0.5.5 a session paid about 114k tokens of tool definitions before its first call. The 281 tools are now grouped into 12 families that an install switches on, and the Claude Desktop extension starts with the model, drawing and analysis loop at about 31k.

run_script, which runs agent-written Python with full file access, is off in the extension unless the user turns it on.

A reviewer guide now gives three example prompts, and their results are checked against the real server on every change. One is an FEM run on a cantilever, held to beam theory.

Reviewer guide · 0.5.5 changelog · Link to this post

Build log Why our FEM test was flaky: Gmsh threadsA test that missed by a fraction of a percent pointed to non-deterministic meshing.

Why we needed it: A test failed on one run and passed on the re-run. GC wanted the merge and the flakiness fixed: “merge it and fix the flaky test.”

A CI run on PR #336 failed one test out of 146. test_fem_decomposed_cantilever builds the same beam twice and requires the two maximum displacements to agree within 8%. This run they came out at 0.0541 mm and 0.0497 mm, just over the limit. A re-run passed, but a test that only sometimes fails hides real regressions, so GC’s call was “merge it and fix the flaky test.”

Claude Code found the cause. Two meshing paths let Gmsh use every core, and as the session put it, “Gmsh’s multi-threaded 3D mesher doesn’t give the same mesh twice, so results drifted between runs.” The codebase already had a helper that forces single-threaded meshing; these two call sites just didn’t use it.

The session ran the demo six times each way:

  • Multi-threaded: 162 or 163 nodes, and displacement from 0.04973 to 0.05121 mm.
  • Single-threaded: all six runs identical.

On a mesh of about 440k tetrahedra, single-threaded meshing took 12.2 s against 11.8 s, so the cost is small. PR #344 routes every Gmsh call in the worker through the helper and tightens the determinism tests from 8% displacement and 15% stress to 2% and 2%. Three back-to-back runs then differed by 0.0%, and the PR merged.

PR #344 · Link to this post

v0.4.0 Every solver answers to an oracleOpen-loop CAD scripts gave wrong output, so open-source solvers were added to prove a design works, each checked against an analytic answer.

Why we needed it: The first open-loop pass, Claude Code driving FreeCAD's Python API, produced incorrect output. Solvers were needed to prove a design could actually work, so we searched for open-source solvers to add.

0.4.0 is where AnkusDrive stopped being a CAD wrapper with FEM attached and became a simulation surface: thermal, CFD, EM, acoustics, multibody dynamics, topology optimization and optics.

Each family is gated against an analytic oracle rather than trusted because a solver returned. The gallery above shows several of those comparisons side by side.

The multi-agent RFC landed in the same release. It turned “partition a product across agents and merge it back” from an experiment into a mechanism, with typed interfaces and merge gates.

0.4.0 changelog · Link to this post

Eval Can a team of agents build parts that fit?Runs took too long and could be parallelized. So: can a team of agents split a design and still make parts that fit?

Why we needed it: The runs were taking too long, and they could be parallelized.

The multi-agent work asks whether a team of agents can split a design, build the pieces independently and merge them into a product that actually fits. Phases 0 to 2, the partition and merge substrate, shipped on 30 May 2026.

In Phase 3 every feature ships with a free two-sided test, and the features that claim to change agent behavior also get billed runs: Claude Haiku 4.5, 20 runs per condition.

Two results stand out. A resolve step, which turns global constraints into literal per-builder slices, took one partitioned task from 2 of 20 to 20 of 20. A builder-side self-check, verify_contract, took the single-agent version of that task from 8 of 20 to 20 of 20.

MULTI_AGENT_EVAL.md · Link to this post

v0.3.0 Tools that know what a hole is forRaw FreeCAD scripts from an agent weren't reliable, so the tools started encoding what each feature is for.

Why we needed it: The first pass, having the agent write FreeCAD Python scripts directly, didn't generate reliable output.

0.3.0 was the first tagged release, and the point at which the tools started encoding design intent rather than just exposing FreeCAD operations.

A tool that knows what a hole is for can refuse to make a wrong one, which a generic pad and pocket pair can’t. Hence verify_feature, explicit directions, through=wall, and intended_for with thread options.

The same release added the first CI workflow, running the full suite on every push to main and every pull request.

0.3.0 changelog · Link to this post