使用说明
GH_mcp_server
GH_mcp_server提供了一种方法,允许设计人员通过LLM直接与Rhino和Grasshopper交互,包括分析.3dm文件、进行3D建模以及根据用户的指导在Grasshopper中自动生成GHPython。
这个项目是 仍在建设中 --我们很乐意得到你的帮助!
- 可以随便 打开一个问题 如果你遇到bug或有想法。
- 拉取请求总是受欢迎的。
- 如果你有兴趣长期合作,请随时联系yizhuod@andrew.cmu.edu--我们很乐意 你在队里吗!
需求
-
犀牛7或8
-
安装
RhinoPython: https://github.com/jingcheng-chen/RhinoPythonForVscode/tree/master?tab=readme-ov文件 -
uv-
# For MacOS and Linux curl -LsSf https://astral.sh/uv/install.sh | sh -
# For Windows powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
-
-
克劳德桌面
安装
1.克隆存储库
git clone git@github.com:veoery/GH_mcp_server.git
cd GH_mcp_server
2.设置环境
我们建议使用 uv:
macOS/Linux
uv venv
source .venv/bin/activate
uv pip install -e .
视窗
uv venv
.venv\Scripts\activate
uv pip install -e .
在运行或开发项目之前,请确保虚拟环境已激活。
3.配置
-
在Claude桌面中,导航到“设置”->“开发人员”。你会看到
Edit Config. -
点击
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桌面。如果您能看到锤子图标,则配置成功。单击锤子图标检查所有连接的MCP工具。
用法
-
启动Rhino
-
type命令
CodeListener你应该看看VS Code Listener Started.... -
打开Claude Desktop并键入与GH_mcp_server工具交互的提示。请同时检查文件
examples\zaha01.gh作为与Grasshopper互动的参考。以下是一些示例: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"
