基本能力
产品定位
GH_mcp_server旨在为设计师和开发者提供一个高效的3D建模和自动化工具,通过LLMs简化Rhino和Grasshopper的工作流程。
核心功能
- 分析.3dm文件:能够读取和分析Rhino的.3dm文件内容。
- 3D建模:支持在Rhino中进行3D建模操作。
- 自动生成GHPython代码:根据用户需求,在Grasshopper中自动生成GHPython代码。
适用场景
- 建筑设计:快速生成和修改3D模型。
- 自动化脚本生成:减少手动编写GHPython代码的工作量。
- 教育与研究:用于教学和研究中的3D建模自动化。
工具列表
- RhinoPython:用于在VSCode中编写和运行RhinoPython脚本。
- uv:一个轻量级的Python包管理工具,用于环境设置和依赖管理。
- Claude Desktop:用于与GH_mcp_server交互的桌面应用。
常见问题解答
- 如何反馈问题或建议?:可以通过GitHub的issue功能提交问题或建议。
- 如何贡献代码?:欢迎通过Pull Request提交代码贡献。
- 如何长期合作?:可以联系yizhuod@andrew.cmu.edu获取更多合作信息。
使用教程
使用依赖
- 安装Rhino 7或8:确保已安装Rhino 7或8。
- 安装RhinoPython:
https://github.com/jingcheng-chen/RhinoPythonForVscode/tree/master?tab=readme-ov-file
- 安装uv:
- MacOS和Linux:
curl -LsSf https://astral.sh/uv/install.sh | sh
- Windows:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
- 安装Claude Desktop:确保已安装Claude Desktop。
安装教程
- 克隆仓库:
git clone git@github.com:veoery/GH_mcp_server.git
cd GH_mcp_server - 设置环境:
- macOS/Linux:
uv venv
source .venv/bin/activate
uv pip install -e . - Windows:
uv venv
.venv\Scripts\activate
uv pip install -e . - 配置Claude Desktop:
- 在Claude Desktop中,导航到Settings->Developer,点击Edit Config,编辑claude_desktop_config.json文件,添加以下内容:
json
{
"mcpServers": {
"grasshopper": {
"command": "path_to_GH_mcp_server/.venv/bin/python",
"args": [
"path_to_GH_mcp_server/run_server.py"
]
}
}
} - 重启Claude Desktop,确认配置成功。
调试方式
- 启动Rhino:打开Rhino。
- 启动CodeListener:在Rhino中输入命令
CodeListener
,确认看到VS Code Listener Started...
。 - 使用Claude Desktop交互:在Claude Desktop中输入提示语与GH_mcp_server工具交互。参考examples/zaha01.gh文件。
- 示例命令:
Read the file "D:\test01.3dm" first and analyse the objects in this file.
write GHpython to create a tower referring to zaha and write the ghpython code to "D:\zaha01.py"