Adam K Dean

Notes on software, systems, engineering, and things

1.1 FreeCAD over MCP

The CAD tool is FreeCAD 1.1.4 with the FreeCADMCP add-on. The call chain is: MCP tool, then an external Python server, then an XML-RPC bridge inside FreeCAD on 127.0.0.1:9875, then FreeCAD's GUI thread.

Starting the bridge

The bridge does not start with FreeCAD, and the MCP tools still load when it is off. Every call then fails with a generic error. Two checks save time:

The console echoes each menu click as a commented line. Remove the # and the line runs. That is a quick way to find the Python call behind any menu item.

Scripts, not clicks

Each part lives in its own directory with a build.py and a check.py. They run inside FreeCAD through execute_code:

exec(compile(open(p).read(), p, "exec"), {"__file__": p, "__name__": "__main__"})

The build script makes the model from named dimensions, saves it and exports STEP and STL. The check script proves the model: valid solids, exact bounds, hole positions, overlap with mating parts (as common volumes), and STL closure. It writes checks.json and the renders.

Things that caught us out

Parametric, and proven

Binding a feature to a spreadsheet cell is easy. Proving that the binding works is the step people skip. Every check.py changes one parameter, recomputes, checks that the volume changes by the expected amount, and then restores the value.