An unofficial FreeCAD (≥ 1.1) addon that adds a dockable Claude Code chat panel: an AI agent that drives FreeCAD for you — creating objects, editing documents, inspecting the scene, and visually checking its own work with 3D-view screenshots. This is a third-party project and is not affiliated with or endorsed by Anthropic.
Authentication goes through your Claude subscription: the addon launches
the claude CLI (Claude Code) already logged in on your machine. No API key
required.
The agent modeling an Oldham coupling from a single chat request, then verifying the result with a screenshot of the 3D view.
- Dockable chat panel available in every workbench (docked on the right)
- Subscription auth — uses your existing Claude Code login, no API key
- Agentic tool use via MCP: the agent can
exec_python— run Python in the live FreeCAD sessionget_scene— list open documents, objects, bounding boxes, errorsscreenshot— capture the active 3D view and see it (visual feedback loop)
- Conversation continuity across turns (
--resume <session_id>) - Restricted toolset by default — only the three FreeCAD tools are
pre-authorized; an explicit checkbox widens access to all Claude Code
tools (
--dangerously-skip-permissions). Note: this is not a sandbox — see Security notes. - Model selector (default / sonnet / opus / haiku), Stop button, New conversation
┌─ FreeCAD ────────────────────────────────┐
│ Qt dock panel (panel.py) │
│ │ prompt ▲ events │
│ ▼ │ stream-json │
│ QProcess: claude -p --mcp-config … │──── Claude subscription
│ │
│ rpc_server.py (TCP on 127.0.0.1, GUI │
│ thread) ◄── mcp_bridge.py (stdio MCP │
│ server spawned by claude) │
└──────────────────────────────────────────┘
- Each chat turn runs
claude -p --output-format stream-json; the panel streams assistant text and tool calls into the history view. mcp_bridge.pyis a dependency-free (stdlib-only) MCP stdio server that forwards tool calls over TCP torpc_server.py, a tiny QTcpServer running on FreeCAD's GUI thread — so agent code executes safely in the live document context.
- FreeCAD ≥ 1.1 (Qt6 / PySide6)
- Claude Code installed and logged in
(
claude, then/login) with a Claude subscription - A system Python (
python3on Linux/macOS,python/pyon Windows — the MCP bridge uses only the standard library)
Windows, Linux and macOS are supported; Windows support is community-tested (please report issues).
The installer auto-detects your FreeCAD user Mod directory, checks the
required FreeCAD version (≥ 1.1), the claude CLI and a Python interpreter
for the MCP bridge, then installs the addon (symlink on Linux/macOS, copy on
Windows).
git clone https://github.com/jacquesh82/FreeCAD-ClaudeCode.git
cd FreeCAD-ClaudeCode
./install.sh # Linux/macOS
install.bat # WindowsOptions: --mod-dir <path> if auto-detection fails, --copy to force a
copy instead of a symlink, --uninstall to remove the addon.
Clone this repository into your FreeCAD user Mod directory.
Note: FreeCAD 1.1+ may use a versioned user directory. Check the real path with
FreeCAD.getUserAppDataDir()in the Python console — on Linux it is typically~/.local/share/FreeCAD/v1-1/.
cd ~/.local/share/FreeCAD/v1-1/Mod # adjust to your getUserAppDataDir()
git clone https://github.com/jacquesh82/FreeCAD-ClaudeCode.git ClaudeCodeWBRestart FreeCAD. Then either:
- Select the Claude Code Connector workbench, or
- Use the Claude Code Connector → Claude Code Connector panel menu entry.
The panel stays docked and usable across all workbenches.
Type a request in the panel, e.g.:
Model the 3 discs of an Oldham coupling, exploded view, and show me the result.
The agent inspects the scene, executes FreeCAD Python in small steps,
recomputes the document, and can verify its work with a screenshot.
Enter sends, Shift+Enter inserts a newline, Stop aborts the current
turn, New conversation resets the session.
Nothing leaves your machine until you type a prompt. Once you do, your prompt and the tool results the agent produces are sent to Anthropic's API as part of the Claude conversation. That explicitly includes:
get_sceneoutput: document names, file paths, object labels/types and bounding boxes;- full screenshots of your 3D view (the PNG is uploaded as an image);
- anything
exec_pythonprints, and your prompt text itself.
If your designs are proprietary or confidential, assume the agent may share the geometry it inspects with Anthropic. Do not use this addon on confidential work if that disclosure is unacceptable.
- This addon is not a sandbox. Even in the default mode, the
exec_pythontool lets the agent run arbitrary Python code inside FreeCAD with your user permissions. Do not describe the default mode as "safe": it is a restricted toolset, not a security boundary. Enabling the "allow all tools" checkbox additionally grants file and shell access. - The RPC server listens on
127.0.0.1only, on a random port chosen at startup, and requires a per-session secret token: the token is generated at startup and passed only to the MCP bridge via the config's environment variables. Requests without the token are rejected. - The agent executes arbitrary Python inside FreeCAD by design: review what it does in the chat history, and save your documents before long tasks.
MIT — see LICENSE.
