FreeCAD MCP server

Enables AI-driven CAD modeling by providing a remote procedure call (RPC) server that allows programmatic control of FreeCAD, supporting operations like creating documents, inserting parts, editing objects, and executing Python code for generative design workflows.
Back to servers
Setup instructions
Provider
neka-nat
Release date
Mar 17, 2025
Language
Python
Package
Stats
9.5K downloads
356 stars

FreeCAD MCP is a protocol implementation that allows controlling FreeCAD from Claude Desktop. This integration enables AI-assisted 3D modeling by connecting FreeCAD with Claude's capabilities, allowing you to create and manipulate 3D models through natural language commands.

Installation

Installing the FreeCAD Addon

First, locate your FreeCAD Addon directory based on your operating system:

  • Windows: %APPDATA%\FreeCAD\Mod\
  • Mac: ~/Library/Application\ Support/FreeCAD/Mod/
  • Linux:
    • Ubuntu: ~/.FreeCAD/Mod/ or ~/snap/freecad/common/Mod/ (if installed via snap)
    • Debian: ~/.local/share/FreeCAD/Mod

Install the addon by copying the FreeCADMCP directory to your FreeCAD Addon directory:

git clone https://github.com/neka-nat/freecad-mcp.git
cd freecad-mcp
cp -r addon/FreeCADMCP ~/.FreeCAD/Mod/

After installation, restart FreeCAD. You can then select "MCP Addon" from the Workbench list to use it.

Starting the RPC Server

Once the addon is installed:

  1. Open FreeCAD
  2. Select "MCP Addon" from the Workbench list
  3. Click the "Start RPC Server" command in the "FreeCAD MCP" toolbar

Setting up Claude Desktop

Prerequisites

First, install uvx on your system.

Configuration

Edit the Claude Desktop config file claude_desktop_config.json with one of these configurations:

Standard Configuration

{
  "mcpServers": {
    "freecad": {
      "command": "uvx",
      "args": [
        "freecad-mcp"
      ]
    }
  }
}

Text-Only Feedback Configuration

For reduced token usage:

{
  "mcpServers": {
    "freecad": {
      "command": "uvx",
      "args": [
        "freecad-mcp",
        "--only-text-feedback"
      ]
    }
  }
}

Developer Configuration

If you're developing with the source code:

{
  "mcpServers": {
    "freecad": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/freecad-mcp/",
        "run",
        "freecad-mcp"
      ]
    }
  }
}

Available Tools

The FreeCAD MCP provides several tools for controlling FreeCAD:

  • create_document: Create a new document in FreeCAD
  • create_object: Create a new object in FreeCAD
  • edit_object: Edit an object in FreeCAD
  • delete_object: Delete an object in FreeCAD
  • execute_code: Execute arbitrary Python code in FreeCAD
  • insert_part_from_library: Insert a part from the parts library
  • get_view: Get a screenshot of the active view
  • get_objects: Get all objects in a document
  • get_object: Get an object in a document
  • get_parts_list: Get the list of parts in the parts library

Usage Examples

Creating Basic 3D Objects

To create a simple cube:

# Create a new document
create_document(name="MyDocument")

# Create a cube
create_object(
    document_name="MyDocument",
    object_type="Part::Box",
    object_name="Cube",
    properties={
        "Length": 10,
        "Width": 10,
        "Height": 10
    }
)

Modifying Objects

To edit an existing object:

# Modify the cube's dimensions
edit_object(
    document_name="MyDocument",
    object_name="Cube",
    properties={
        "Length": 20,
        "Width": 15,
        "Height": 30
    }
)

Using the Parts Library

To insert a standard part:

# First, get a list of available parts
parts = get_parts_list()

# Insert a specific part
insert_part_from_library(
    document_name="MyDocument",
    part_path="Mechanical Parts/Fasteners/Bolts & Screws/ISO7380.fcstd"
)

Executing Custom Python Code

For more advanced operations:

execute_code("""
import FreeCAD as App
import Part

# Create a cylinder
cylinder = App.ActiveDocument.addObject("Part::Cylinder", "MyCylinder")
cylinder.Radius = 5
cylinder.Height = 15

# Refresh the view
App.ActiveDocument.recompute()
""")

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "freecad" '{"command":"uvx","args":["freecad-mcp"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "freecad": {
            "command": "uvx",
            "args": [
                "freecad-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "freecad": {
            "command": "uvx",
            "args": [
                "freecad-mcp"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later