A bridging server that connects Grasshopper and Claude Desktop using the Model Context Protocol (MCP) standard.
Grasshopper MCP Bridge for Claude Desktop
Overview
The Grasshopper MCP Bridge is a bridging server that connects Grasshopper and Claude Desktop using the Model Context Protocol (MCP) standard. It enables seamless communication between the two platforms, allowing users to control Grasshopper components through natural language commands in Claude Desktop.
Features
- Grasshopper-Claude Integration: Connects Grasshopper and Claude Desktop through the MCP protocol.
- Intuitive Tool Functions: Provides functions for creating and connecting Grasshopper components.
- High-Level Intent Recognition: Automatically creates complex component patterns from simple descriptions.
- Component Knowledge Base: Includes JSON files with component information, patterns, and intents.
- Component Guidance: Offers resources to help Claude Desktop correctly connect components.
System Architecture
The system consists of:
1. Grasshopper MCP Component (GH_MCP.gha): A plugin installed in Grasshopper that provides a TCP server to receive commands.
2. Python MCP Bridge Server: A bridge server that connects Claude Desktop and the Grasshopper MCP component.
3. Component Knowledge Base: JSON files containing component information, patterns, and intents.
Installation Instructions
Prerequisites
- Rhino 7 or higher
- Grasshopper
- Python 3.8 or higher
- Claude Desktop
Installation Steps
- Install the Grasshopper MCP Component
- Method 1: Download the pre-compiled
GH_MCP.gha
file from the GitHub repository and copy it to %APPDATA%\Grasshopper\Libraries\
.
-
Method 2: Build from source using Visual Studio.
-
Install the Python MCP Bridge Server
- Method 1: Install from PyPI:
bash
pip install grasshopper-mcp
- Method 2: Install from GitHub:
bash
pip install git+https://github.com/alfredatnycu/grasshopper-mcp.git
- Method 3: Install from source:
bash
git clone https://github.com/alfredatnycu/grasshopper-mcp.git
cd grasshopper-mcp
pip install -e .
- Install a Specific Version:
bash
pip install grasshopper-mcp==0.1.0
Usage
- Start Rhino and Grasshopper.
- Add the GH_MCP Component to your Grasshopper canvas.
- Start the Python MCP Bridge Server:
bash
python -m grasshopper_mcp.bridge
- Connect Claude Desktop to the MCP Bridge:
- Manual Connection: Use the settings
Protocol: MCP
, Host: localhost
, Port: 8080
.
- Auto-Start Configuration: Modify Claude Desktop's configuration:
json
"grasshopper": {
"command": "python",
"args": ["-m", "grasshopper_mcp.bridge"]
}
- Control Grasshopper using natural language commands in Claude Desktop.
Example Commands
- "Create a circle with radius 5 at point (0,0,0)"
- "Connect the circle to an extrude component with a height of 10"
- "Create a grid of points with 5 rows and 5 columns"
- "Apply a random rotation to all selected objects"
Troubleshooting
- GH_MCP Component Not Loading:
- Ensure the
.gha
file is in the correct location.
- Unblock new components in Grasshopper preferences.
- Restart Rhino and Grasshopper.
- Bridge Server Won't Start:
- Use
python -m grasshopper_mcp.bridge
if grasshopper-mcp
doesn’t work.
- Ensure Python dependencies are installed.
- Check if port 8080 is in use.
- Claude Desktop Can't Connect:
- Ensure the bridge server is running.
- Verify connection settings (
localhost:8080
).
- Check the bridge server console for errors.
- Commands Not Executing:
- Verify the GH_MCP component is on the canvas.
- Check the bridge server console for errors.
- Ensure Claude Desktop is connected to the bridge server.
Development
Project Structure
grasshopper-mcp/
├── grasshopper_mcp/ # Python bridge server
│ ├── __init__.py
│ └── bridge.py # Main bridge server implementation
├── GH_MCP/ # Grasshopper component (C#)
│ └── ...
├── releases/ # Pre-compiled binaries
│ └── GH_MCP.gha # Compiled Grasshopper component
├── setup.py # Python package setup
└── README.md # This file
Contributing
Contributions are welcome! Submit a Pull Request.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Acknowledgments
- Thanks to the Rhino and Grasshopper community for their excellent tools.
- Thanks to Anthropic for Claude Desktop and the MCP protocol.
Contact
For questions or support, open an issue on the GitHub repository.