FreeCAD MCP
local-only server
The server can only run on the client’s local machine because it depends on local resources.
Integrations
Enables creation and manipulation of 3D objects, parametric modeling operations, document management, and export/import capabilities in FreeCAD through natural language commands.
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.
https://github.com/user-attachments/assets/5acafa17-4b5b-4fef-9f6c-617e85357d44
Configuration
To configure the MCP server, you can use a JSON format to specify the server settings. Below is an example configuration:
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
orC:\\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.
- Windows: Typically, it might look like
- 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
Linux
macOS
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:
Installation
- Clone the repository or download the files.
- Place the
freecad_mcp
directory in your FreeCAD modules directory:- Windows:
%APPDATA%/FreeCAD/Mod/
- Linux:
~/.FreeCAD/Mod/
- macOS:
~/Library/Preferences/FreeCAD/Mod/
- Windows:
- 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.
This server cannot be installed
A FreeCAD addon that implements the Model Context Protocol (MCP) to enable communication between FreeCAD and Claude AI through Claude Desktop.