freecad_mcp

MCP.Pizza Chef: bonninr

Only two tools exist here, and one of them does nearly everything: it hands a block of Python straight to FreeCAD, so the assistant is writing modelling code on the fly rather than picking from safe, ready-made shapes. The other reads back what is in your open document — objects, positions, sketch geometry, camera view. FreeCAD itself is free and no key or account is involved. Setup is fiddly: copy files into FreeCAD's add-on folder, edit full file paths by hand, restart. The code has not changed since March 2025.

Unmaintained · no code changes since March 2025; no replacement named
Coding
Images/Design

Use This MCP server To

Create a simple box or cylinder by describing its size Ask what objects are in the document I have open Check the position and rotation of a part Generate a repeating pattern of shapes in one go Have routine edits made for me instead of clicking menus

README

FreeCAD MCP (Model Control Protocol)

Overview

The FreeCAD MCP (Model Control Protocol) provides a simplified interface for interacting with FreeCAD through a server-client architecture. This allows users to execute commands and retrieve information about the current FreeCAD document and scene.

freecad.mp4

Configuration

To configure the MCP server, you can use a JSON format to specify the server settings. Below is an example configuration:

{
    "mcpServers": {
        "freecad": {
            "command": "C:\\ProgramData\\anaconda3\\python.exe",
            "args": [
                "C:\\Users\\USER\\AppData\\Roaming\\FreeCAD\\Mod\\freecad_mcp\\src\\freecad_bridge.py"
            ]
        }
    }
}

Configuration Details

  • command: The path to the Python executable that will run the FreeCAD MCP server. This can vary based on your operating system:

    • Windows: Typically, it might look like C:\\ProgramData\\anaconda3\\python.exe or C:\\Python39\\python.exe.
    • Linux: It could be /usr/bin/python3 or the path to your Python installation.
    • macOS: Usually, it would be /usr/local/bin/python3 or the path to your Python installation.
  • args: An array of arguments to pass to the Python command. The first argument should be the path to the freecad_bridge.py script, which is responsible for handling the MCP server logic. Make sure to adjust the path according to your installation.

Example for Different Operating Systems

Windows
{
    "mcpServers": {
        "freecad": {
            "command": "C:\\ProgramData\\anaconda3\\python.exe",
            "args": [
                "C:\\Users\\USER\\AppData\\Roaming\\FreeCAD\\Mod\\freecad_mcp\\src\\freecad_bridge.py"
            ]
        }
    }
}
Linux
{
    "mcpServers": {
        "freecad": {
            "command": "/usr/bin/python3",
            "args": [
                "/home/USER/.FreeCAD/Mod/freecad_mcp/src/freecad_bridge.py"
            ]
        }
    }
}
macOS
{
    "mcpServers": {
        "freecad": {
            "command": "/usr/local/bin/python3",
            "args": [
                "/Users/USER/Library/Preferences/FreeCAD/Mod/freecad_mcp/src/freecad_bridge.py"
            ]
        }
    }
}

Features

The FreeCAD MCP currently supports the following functionalities:

1. get_scene_info

  • Description: Retrieves comprehensive information about the current FreeCAD document, including:
    • Document properties (name, label, filename, object count)
    • Detailed object information (type, position, rotation, shape properties)
    • Sketch data (geometry, constraints)
    • View information (camera position, direction, etc.)

2. run_script

  • Description: Executes arbitrary Python code within the FreeCAD context. This allows users to perform complex operations, create new objects, modify existing ones, and automate tasks using FreeCAD's Python API.

Example Usage

To use the FreeCAD MCP, you can connect to the server and send commands as follows:

import socket
import json

# Connect to the FreeCAD MCP server
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect(('localhost', 9876))

# Example: Get scene information
command = {
    "type": "get_scene_info"
}
client.sendall(json.dumps(command).encode('utf-8'))

# Receive the response
response = client.recv(4096)
print(json.loads(response.decode('utf-8')))

# Example: Run a script
script = """
import FreeCAD
doc = FreeCAD.ActiveDocument
box = doc.addObject("Part::Box", "MyBox")
box.Length = 20
box.Width = 20
box.Height = 20
doc.recompute()
"""
command = {
    "type": "run_script",
    "params": {
        "script": script
    }
}
client.sendall(json.dumps(command).encode('utf-8'))

# Receive the response
response = client.recv(4096)
print(json.loads(response.decode('utf-8')))

# Close the connection
client.close()

Installation

  1. Clone the repository or download the files.
  2. Place the freecad_mcp directory in your FreeCAD modules directory:
    • Windows: %APPDATA%/FreeCAD/Mod/
    • Linux: ~/.FreeCAD/Mod/
    • macOS: ~/Library/Preferences/FreeCAD/Mod/
  3. Restart FreeCAD and select the "FreeCAD MCP" workbench from the workbench selector.

Contributing

Feel free to contribute by submitting issues or pull requests. Your feedback and contributions are welcome!

License

This project is licensed under the MIT License. See the LICENSE file for details.

freecad_mcp FAQ

Is this still maintained?
There is no sign of it. The code has not changed since March 2025. It is not archived and the author names no replacement, but expect to fix things yourself.
Do I need a paid key or account?
No. FreeCAD is free and open source, and this add-on talks to it on your own computer with nothing to sign up for.
Can I use this to design a 3D part by describing it?
Yes, within limits. It works by having the assistant write and run FreeCAD's own scripting code, so simple shapes and patterns go well while anything intricate tends to come back as broken geometry rather than a clear error.
Which apps does it work in?
Claude Desktop and Cursor, using a settings block that points at the bridge file inside FreeCAD's add-on folder.
How hard is setup?
Developer-level. You copy the folder into FreeCAD's add-on directory, write out full paths to both your Python program and the bridge file, then restart FreeCAD and pick the new workbench.
Is it risky to run?
The main tool executes whatever code the assistant writes, inside FreeCAD, with access to your files. Save a copy of your work first and read each script before approving it.
Does the description match what actually ships?
Close but not exact. The notes name two features; the shipped bridge offers one tool that runs a script and one that sends a command back and returns your document's details.