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:
lsof -nP -iTCP:9875shows whether anything listens.- In the FreeCAD Python console,
Gui.runCommand('Start_RPC_Server', 0)starts it.
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
optimalBoundingBox()reads the tessellation by default and gave a 3 mm plate as 3.033 mm. UseoptimalBoundingBox(False, False)for exact bounds.- A render straight after
viewTop()caught the camera mid-animation. Turn animation off around renders. - A reopened file takes its document name from the file name, not the name it was built with. Find documents by
FileName. - A boolean
commonof a solid with a compound returned a null shape. Sum the common volumes pair by pair. - Two agent sessions can share one FreeCAD, but they share the active document and the view. One session owns the window; the other works in a hidden temporary document.
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.