GH_mcp_server 提供了一种方法,使设计师能够通过大语言模型(LLMs)直接与 Rhino 和 Grasshopper 进行交互,包括分析 .3dm 文件、进行三维建模以及根据用户的指导在 Grasshopper 中自动生成 GHPython。
该项目仍在建设中——我们非常欢迎您的帮助!
- 如果您遇到错误或有想法,请随时打开一个议题。
- 我们总是欢迎合并请求。
- 如果您有兴趣长期合作,请随时联系 yizhuod@andrew.cmu.edu ——我们非常希望您加入团队!

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
git clone git@github.com:veoery/GH_mcp_server.git
cd GH_mcp_server
我们推荐使用 uv:
uv venv
source .venv/bin/activate
uv pip install -e .
uv venv
.venv\Scripts\activate
uv pip install -e .
确保在运行或开发项目之前激活虚拟环境。
在 Claude Desktop 中,导航到设置 -> 开发者。您会看到 编辑配置。
点击 编辑配置 并打开文件 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。如果您能看到锤子图标,则配置成功。点击锤子图标以检查所有附加的 MCP 工具。
启动 Rhino
输入命令 CodeListener。您应该会看到 VS Code 监听器已启动...。
打开 Claude Desktop 并输入提示以与 GH_mcp_server 工具进行交互。请参阅文件 examples\zaha01.gh 作为与 Grasshopper 交互的参考。这里有一些示例:
首先读取文件 "D:\test01.3dm" 并分析该文件中的对象。
编写 GHpython 创建一座参照扎哈风格的塔,并将 ghpython 代码写入 "D:\zaha01.py"