FreeCAD MCP(模型控制协议)
概述
FreeCAD MCP(模型控制协议)提供了一个简化的接口,用于通过服务器-客户端架构与 FreeCAD 进行交互。这允许用户执行命令并检索有关当前 FreeCAD 文档和场景的信息。
https://github.com/user-attachments/assets/5acafa17-4b5b-4fef-9f6c-617e85357d44
配置
要配置 MCP 服务器,您可以使用 JSON 格式指定服务器设置。以下是示例配置:
配置详细信息
- command :运行 FreeCAD MCP 服务器的 Python 可执行文件的路径。这可能会因操作系统而异:
- Windows :通常,它可能看起来像
C:\\ProgramData\\anaconda3\\python.exe
或C:\\Python39\\python.exe
。 - Linux :它可以是
/usr/bin/python3
或 Python 安装的路径。 - macOS :通常,它是
/usr/local/bin/python3
或 Python 安装的路径。
- Windows :通常,它可能看起来像
- args :传递给 Python 命令的参数数组。第一个参数应为
freecad_bridge.py
脚本的路径,该脚本负责处理 MCP 服务器逻辑。请务必根据您的安装情况调整路径。
不同操作系统的示例
视窗
Linux
macOS
特征
FreeCAD MCP 目前支持以下功能:
1. get_scene_info
- 描述:检索有关当前 FreeCAD 文档的综合信息,包括:
- 文档属性(名称、标签、文件名、对象数量)
- 详细的对象信息(类型、位置、旋转、形状属性)
- 草图数据(几何形状、约束)
- 查看信息(摄像机位置、方向等)
2. run_script
- 描述:在 FreeCAD 环境中执行任意 Python 代码。这允许用户使用 FreeCAD 的 Python API 执行复杂的操作、创建新对象、修改现有对象以及自动执行任务。
示例用法
要使用 FreeCAD MCP,您可以连接到服务器并发送以下命令:
安装
- 克隆存储库或下载文件。
- 将
freecad_mcp
目录放在您的 FreeCAD 模块目录中:- Windows:
%APPDATA%/FreeCAD/Mod/
- Linux:
~/.FreeCAD/Mod/
- macOS:
~/Library/Preferences/FreeCAD/Mod/
- Windows:
- 重新启动 FreeCAD 并从工作台选择器中选择“FreeCAD MCP”工作台。
贡献
欢迎通过提交问题或拉取请求来贡献代码。欢迎您的反馈和贡献!
执照
本项目遵循 MIT 许可证。详情请参阅 LICENSE 文件。
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
一个实现模型上下文协议 (MCP) 的 FreeCAD 插件,以实现 FreeCAD 和 Claude AI 通过 Claude Desktop 之间的通信。
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityConnects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender for AI-assisted 3D modeling, scene manipulation, and rendering.Last updated -1712,670PythonMIT License
- AsecurityAlicenseAqualityThis repository is a FreeCAD MCP that allows you to control FreeCAD from Claude Desktop.Last updated -10224PythonMIT License
- -securityAlicense-qualityThis project provides a robust integration between AI assistants and FreeCAD CAD software using the Model Context Protocol (MCP). It allows external applications to interact with FreeCAD through a standardized interface, offering multiple connection methods and specialized tools.Last updated -10PythonMIT License
- AsecurityFlicenseAqualityA Model Context Protocol (MCP) server that allows Claude AI to interact with custom tools, enabling extension of Claude's capabilities through the MCP framework.Last updated -TypeScript