TommeCAD FreeCAD MCP
# TommeCAD FreeCAD MCP
TommeCAD is a Windows-first Model Context Protocol (MCP) server for machine design in FreeCAD, with a portable OpenCode setup. The structured workflows cover associative bolted joints across assembly links, sheet metal, cable routing, sampled joint collision checks, revisioned component reuse and bills of materials, TechDraw, and static FEM with result provenance.
See the [232-tool catalog](TOOL-CATALOG.md), [comparison with other FreeCAD MCP servers](FREECAD-MCP-COMPARISON.md), and [machine-design coverage and gaps](MACHINE-DESIGN.md).
## Repository scope
This repository distributes the standalone MCP server, its FreeCAD bridge, the OpenCode setup, and their tests and documentation. STEP import, export, inspection, and component-library operations are part of the CAD interface. The TommeCAD2 automatic STEP recognition and parametric reconstruction pipeline is a separate project. Its source code, datasets, original CAD files, and reconstruction outputs are outside this distribution. The tests generate synthetic CAD fixtures locally.
## Setup
On Windows with Python 3.12 and FreeCAD 1.1.4, extract the release ZIP. Run these commands in order from Command Prompt in the extracted package directory.
```bat
Setup.cmd
Start-FreeCAD.cmd
Start-OpenCode.cmd
```
Wait for FreeCAD to load before starting OpenCode. The setup creates or reuses the host `.venv`, installs the package and MCP SDK 1.30.0, and generates `opencode.local.json` with absolute local paths. It selects the full catalog through `TOMME_MCP_PROFILE=all`. The OpenCode configuration timeout applies to MCP connection and discovery. CAD job execution has its own timeout.
The CMD launchers work independently of local PowerShell profile and script-policy settings. The PowerShell launchers are also available, for example `Start-FreeCAD.ps1 -ShowWindow` for a visible demo or `Start-FreeCAD.ps1 -FreeCAD <path>` for a custom installation. For CMD, use `Start-FreeCAD.cmd --freecad <path>`. See the [detailed OpenCode demo](DEMO-OPENCODE.md) and [upgrade guide for existing installations](UPGRADE-OPENCODE.md).
## Architecture and optional workbenches
OpenCode launches the `tomme_freecad_mcp` host using local stdio. The host connects via loopback XML-RPC to a separate FreeCAD process. The bootstrap macro and `Mod/FreeCADPythonIsolation` keep CAD libraries in that process. The default port is 9987. For a custom port, set `TOMME_FREECAD_PORT` for both the bridge and the MCP client. Use trusted local clients. The bridge checks the Host header and XML media type, refuses browser-origin requests, and has no per-client authentication. The packaged launchers disable raw Python.
Optional workbenches are installed separately. See [fastener mounting](FASTENERS.md), [harness and cable modelling](HARNESS.md), and the [tested addon versions](upstream/optional-addons-20261028.json). Use `configure_addons.py` for custom Fasteners and Cables paths. Set `TOMME_SHEETMETAL_PATH` to select a compatible local SheetMetal installation. SheetMetal has its own LGPL license. The optional [locking washer research](LOCKING-WASHERS.md) documents catalog gaps and the distinction between washer types.
The `tomme_freecad_mcp.client.FreeCADClient` Python API uses the same structured bridge modules and GUI queue. The external Python environment does not load FreeCAD DLLs.
## Validation and scope
The catalog includes upstream Assembly, Draft and TechDraw. Native SheetMetal operations cover a base with a governing thickness, an SMBendWall flange, inspection and SMUnfold with an explicit K-factor. Fold, junction, relief and other workbench variants remain open. FEM covers the documented linear static workflow. Each document requires its own geometry checks, including appropriate BOP checks and a review of modelling intent.
See the [initial validation](VALIDATION.md) and [machine-design validation](VALIDATION-20261029.md) for the tested cases and known limits. Detailed references cover [multipart fasteners](FASTENERS-ASSEMBLY.md), [transmissions](TRANSMISSIONS.md), [library and motion](LIBRARY-MOTION.md), and [drawings and FEM](ENGINEERING.md).
Run `python -m unittest discover -s tests` in the host environment. To include the optional native tests, set `TOMME_FASTENERS_PATH`, `TOMME_CABLES_PATH` and `TOMME_SHEETMETAL_PATH` to the local workbench directories. Run `python package_build.py` to build a portable ZIP that excludes the virtual environment, caches, local configuration and output files.
## License and attribution
The MIT-licensed server and FreeCAD bridge derive from [JakobThiessen/FreeCad_MCP_Server](https://github.com/JakobThiessen/FreeCad_MCP_Server/tree/f1ca258fb1aa4cc60add294cf3b1090157073097). See [LICENSE](LICENSE) and the [upstream reference](upstream/README.md) for attribution and provenance.
TDQS
Scored across 232 tools
Many tools have distinct module prefixes and rich descriptions, but the set contains numerous overlapping alternatives: create_container vs partdesign_body, save_document vs save_document_safe, export_step vs exchange_export, screenshot vs capture_view, and part_* vs partdesign_* modeling/fillet/loft operations. At 232 tools, these overlaps make tool selection error-prone despite detailed contracts.
Nearly all names use snake_case and follow a module_action_object pattern such as sketch_add_line, partdesign_pad, and techdraw_create_view. Minor deviations exist with bare verbs/nouns like measure, screenshot, undo, and redo, but the overall convention is readable and mostly consistent.
232 tools is far beyond a well-scoped toolset and spans dozens of workbenches, safe duplicates, specialized modules, and generated variants. This creates extreme cognitive load and selection risk; a smaller curated surface would be more appropriate.
The surface is exceptionally broad, covering document/object lifecycle, sketching, constraints, PartDesign/Part modeling, booleans, TechDraw, Draft, mesh, exchange, assembly, sheetmetal, fasteners, harness, FEM, and library operations. Some native operations are absent or only workaroundable, such as PartDesign Boolean/ShapeBinder, but core mechanical CAD workflows are well covered.