TF

theosib/freecad-mcp-server

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

37 stars 5 forks 品質 58 トレンド 12

Claude Code が FreeCAD に直接話すことを可能にする MCP サーバーで、state を検査および変更

概要

Claude をライブ FreeCAD インスタンスでブリッジする MCP (Model Context Protocol) サーバー。 ドキュメント構造、オブジェクト特性、形状のトポロジー、スケッチ制約健康など、FreeCADのランタイム状態にClaudeの深いアクセスを提供し、AIによるCAD作業とFreeCAD開発デバッグを可能にします。 単純なスクリプト実行MCPサーバーとは異なり、このプロジェクトは、ClaudeがFreeCAD内で何が起こっているかを本物的に理解できるようにします。 1。 (freecad addon/) — ワークベンチとしてFreeCAD内で実行します。 JSON-RPC リクエストを受け付け、QTimer-polled ジョブキューを介して FreeCAD のメインスレッドで実行するスレッド TCP サーバーを開始します。 2. (src/freecad mcp agent/) — stdio 経由で Claude によってスポーン。 TCP 上のアドオンに接続し、MCP ツールの呼び出しを JSON-RPC リクエストに変換します。 FreeCAD は macOS 上でのsymlinks に確実に従わないため、薄い loader ファイルを使用します。 - macOS: ~/ Library/Application Support/FreeCAD/Mod/ (または ~/Library/Application Support/FreeCAD/v1-2/Mod/ 毎週ビルド) - Linux: ~/.

概要(AI 翻訳)

Claude をライブ FreeCAD インスタンスでブリッジする MCP (Model Context Protocol) サーバー。 ドキュメント構造、オブジェクト特性、形状のトポロジー、スケッチ制約健康など、FreeCADのランタイム状態にClaudeの深いアクセスを提供し、AIによるCAD作業とFreeCAD開発デバッグを可能にします。

それが何をしているか

シンプルなスクリプト実行MCPサーバーとは異なり、このプロジェクトは、ClaudeがFreeCAD内で何が起こっているかを本物的に理解できるようにするリッチコンテキスト抽出を提供します。

| 工具 | 返品について | お問い合わせ | [list_documents | ファイル名、ファイルパス、オブジェクトのカウントを含む全てのオープン文書 | | [get_document_graph | 完全機能ツリー — TypeId、プロパティ、依存関係リンク、有効状態の全てのオブジェクト | | [inspect_object | 形状メタデータで1つのオブジェクトの完全プロパティダンプ | | [analyze_shape | 地質分析 | 顔の分類(平面/シリンダー/コーン/…)、エッジ詳細、境界ボックス、ボリューム | |【get_sketch_diagnostics | 制約健康 — DOF、紛争、冗長性、全ての制約と幾何学的要素を座標で調整 | | [tracked_recompute | 差分前後の対応 — 新しいエラー、解決エラー、永続的なエラー |

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

FreeCAD MCP Server

An MCP (Model Context Protocol) server that bridges Claude with a live FreeCAD instance. It gives Claude deep access to FreeCAD’s runtime state — document structure, object properties, shape topology, sketch constraint health, and more — enabling AI-assisted CAD work and FreeCAD development debugging.

What It Does

Unlike simple script-execution MCP servers, this project provides rich context extraction that lets Claude genuinely understand what’s happening inside FreeCAD:

Tool What It Returns
list_documents All open documents with names, file paths, object counts
get_document_graph Full feature tree — every object with TypeId, properties, dependency links, validity state
inspect_object Complete property dump for a single object, with shape metadata
analyze_shape Topological analysis — face classifications (Plane/Cylinder/Cone/…), edge details, bounding box, volume
get_sketch_diagnostics Constraint health — DOF, conflicts, redundancies, every constraint and geometry element with coordinates
tracked_recompute Recompute with before/after diff — new errors, resolved errors, persistent errors
execute_script Run arbitrary Python inside FreeCAD (escape hatch for anything not covered above)
get_screenshot Capture the 3D viewport as a base64 PNG
reload_handlers Hot-reload handler code without restarting FreeCAD

Architecture

Claude (Code/Desktop)  ←stdio MCP→  Bridge Server  ←TCP:9876→  FreeCAD Addon
                                     (this project)              (inside FreeCAD)

The project has two components:

  1. FreeCAD addon (freecad_addon/) — runs inside FreeCAD as a workbench. Starts a threaded TCP server that accepts JSON-RPC requests and executes them on FreeCAD’s main thread via a QTimer-polled work queue.

  2. MCP bridge server (src/freecad_mcp_agent/) — spawned by Claude via stdio. Connects to the addon over TCP and translates MCP tool calls into JSON-RPC requests.

Installation

1. Install the MCP bridge

# Clone the repo
git clone https://github.com/theosib/FreeCAD-MCP-Server.git
cd FreeCAD-MCP-Server

# Create a venv and install
python3 -m venv .venv
source .venv/bin/activate
pip install -e .

2. Install the FreeCAD addon

FreeCAD doesn’t reliably follow symlinks on macOS, so we use a thin loader file.

Find your FreeCAD Mod directory:

  • macOS: ~/Library/Application Support/FreeCAD/Mod/ (or ~/Library/Application Support/FreeCAD/v1-2/Mod/ for weekly builds)
  • Linux: ~/.local/share/FreeCAD/Mod/
  • Windows: %APPDATA%/FreeCAD/Mod/

Tip: Run FreeCAD.getUserAppDataDir() in FreeCAD’s Python console to find the exact path.

Create the loader:

mkdir -p "/FreeCADMCPAgent"

Create /FreeCADMCPAgent/InitGui.py with:

import sys
GitHub で README 全文を見る

インストール

This server does not publish a one-line install command.

Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "freecad-debug": { "command": "/absolute/path/to/FreeCAD-MCP-Server/.venv/bin/freecad-mcp-agent", "env": { "FREECAD_MCP_HOST": "127.0.0.1", "FREECAD_MCP_PORT": "9876" } } } }