Bridges Grasshopper (Rhino's visual programming environment) with Cursor through the Model Context Protocol, enabling natural language control of Grasshopper components, automated workflow execution, and programmatic management of 3D modeling workflows.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Grasshopper MCP Workflowcreate a parametric surface from these points"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Grasshopper MCP workflow
Grasshopper MCP workflow is a bridging server that connects Grasshopper and Cursor using the Model Context Protocol (MCP) standard.
Language Selection / 語言選擇: English | 繁體中文
Features
MCP Protocol Integration: Connects Grasshopper and Cursor through the Model Context Protocol (MCP) standard
Component Management: Intuitive tool functions for creating, managing, and connecting Grasshopper components
Intent Recognition: Supports high-level intent recognition, automatically creating complex component patterns from simple descriptions
Component Knowledge Base: Includes a comprehensive knowledge base that understands parameters and connection rules for common components
Workflow Automation: Provides tools for executing complex Grasshopper workflows from JSON and MMD files
CLI Tools: Command-line interface for batch operations and automation
Parameter Management: Advanced parameter setting and management capabilities
Group Management: Organize components into groups with custom colors and names
System Architecture
The system consists of the following parts:
Grasshopper MCP Component (GH_MCP.gha): A C# plugin installed in Grasshopper that provides a TCP server to receive commands
Python MCP Bridge Server (
grasshopper_mcp): A bridge server that connects Cursor and the Grasshopper MCP componentGrasshopper Tools (
grasshopper_tools): A comprehensive Python library for managing Grasshopper components, connections, parameters, and workflowsComponent Knowledge Base: JSON files containing component information, patterns, and intents
Workflow Skill (
grasshopper-workflow): A specialized skill for Cursor that provides advanced workflow automation capabilities
Installation Instructions
Prerequisites
Rhino 7 or higher
Grasshopper
Python 3.8 or higher
Cursor
Installation Steps
Install the Grasshopper MCP Component
Method 1: Download the pre-compiled GH_MCP.gha file (Recommended)
Download the GH_MCP.gha file directly from the GitHub repository and copy it to the Grasshopper components folder:
%APPDATA%\Grasshopper\Libraries\Method 2: Build from source
If you prefer to build from source, clone the repository and build the C# project using Visual Studio.
Install the Python MCP Bridge Server
Method 1: Install from PyPI (Recommended)
The simplest method is to install directly from PyPI using pip:
pip install grasshopper-mcpMethod 2: Install from GitHub
You can also install the latest version from GitHub:
pip install git+https://github.com/alfredatnycu/grasshopper-mcp.gitMethod 3: Install from Source Code
If you need to modify the code or develop new features, you can clone the repository and install:
git clone https://github.com/alfredatnycu/grasshopper-mcp.git cd grasshopper-mcp pip install -e .
Usage
Start Rhino and Grasshopper
Launch Rhino and open Grasshopper.
Add the GH_MCP Component to Your Canvas
Find the GH_MCP component in the Grasshopper component panel and add it to your canvas.
Start the Python MCP Bridge Server
Open a terminal and run:
python -m grasshopper_mcp.bridgeNote: The command
grasshopper-mcpmight not work directly due to Python script path issues. Usingpython -m grasshopper_mcp.bridgeis the recommended and more reliable method.Configure Cursor MCP Connection
Configure the MCP server connection in Cursor to enable communication between Cursor and the Grasshopper MCP bridge server.
Configuration Steps:
Locate Cursor's MCP configuration file
mcp.json, typically located at:Windows:
%APPDATA%\Cursor\User\mcp.jsonor~\.cursor\mcp.jsonmacOS:
~/Library/Application Support/Cursor/User/mcp.jsonor~/.cursor/mcp.json
Add the following configuration to the
mcp.jsonfile:{ "mcpServers": { "grasshopper": { "command": "python", "args": ["-m", "grasshopper_mcp.bridge"] } } }Using Virtual Environment or Specific Python Path:
If you're using a virtual environment or conda environment, specify the full path to the Python executable:
{ "mcpServers": { "grasshopper": { "command": "C:\\Users\\YourUsername\\.conda\\envs\\grasshopper-mcp\\python.exe", "args": ["-m", "grasshopper_mcp.bridge"] } } }Tip: On Windows, backslashes in paths need to be escaped with double backslashes
\\or use forward slashes/.Verify Python Path:
You can find the full path to your Python executable using:
Windows:
where pythonorwhere python3macOS/Linux:
which pythonorwhich python3
If using a conda environment, you can run:
conda activate grasshopper-mcp where python # Windows which python # macOS/LinuxAfter saving the configuration file, restart Cursor for the changes to take effect.
Note: Make sure you have completed steps 2 (adding the GH_MCP component to the Grasshopper canvas) and step 3 (starting the Python MCP bridge server) before configuring MCP. The MCP bridge server needs to be running before Cursor can connect.
Start Using Grasshopper with Cursor
You can now use Cursor to control Grasshopper through natural language commands.
Example Commands
Here are some example commands you can use with Cursor:
"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"
"Create a rectangle component and set its width to 10"
"Group all selected components and name them 'Geometry Group'"
Using Grasshopper Tools
The project includes a comprehensive grasshopper_tools library for programmatic control of Grasshopper:
Python API Usage
CLI Usage
For more detailed documentation, see the grasshopper_tools documentation.
Troubleshooting
If you encounter issues, check the following:
GH_MCP Component Not Loading
Ensure the .gha file is in the correct location:
%APPDATA%\Grasshopper\Libraries\In Grasshopper, go to File > Preferences > Libraries and click "Unblock" to unblock new components
Restart Rhino and Grasshopper
Check that you have the correct .NET runtime installed (net48 or net7.0)
Bridge Server Won't Start
If
grasshopper-mcpcommand doesn't work, usepython -m grasshopper_mcp.bridgeinsteadEnsure all required Python dependencies are installed:
pip install -r requirements.txtCheck if port 8080 is already in use by another application
Verify Python version is 3.8 or higher:
python --version
Cursor Can't Connect
Ensure the bridge server is running
Verify you're using the correct connection settings (localhost:8080)
Check the console output of the bridge server for any error messages
Ensure the GH_MCP component is added to your Grasshopper canvas
Check that Cursor's MCP configuration is correct
Commands Not Executing
Verify the GH_MCP component is on your Grasshopper canvas
Check the bridge server console for error messages
Ensure Cursor is properly connected to the bridge server
Verify the component GUIDs are correct when using
grasshopper_tools
Grasshopper Tools Issues
Ensure you're using the correct host and port (default: localhost:8080)
Check that the MCP bridge server is running before using the tools
Verify file paths when using CLI commands
See grasshopper_tools documentation for detailed troubleshooting
Development
Project Structure
Additional Resources
Grasshopper Tools Documentation: See grasshopper_tools/docs/ for detailed API documentation and usage guides
Workflow Skill: The
grasshopper-workflowskill provides advanced workflow automation capabilities for CursorExample Scripts: Check the
scripts/directory for example usage scriptsPrompt Templates: The
prompt/directory contains prompt templates for various workflow steps
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
When contributing:
Follow the existing code style and structure
Add documentation for new features
Include tests when possible
Update this README if adding new features or changing installation steps
Changelog
Version 0.1.0
Release Date: 2024-12-19
Initial release of Grasshopper MCP Bridge
Support for MCP protocol integration with Cursor
Component management and connection tools
Intent recognition for automatic component pattern creation
Comprehensive component knowledge base
Workflow automation from JSON and MMD files
CLI tools for batch operations
Parameter and group management capabilities
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 Cursor and the MCP protocol support
Contact
For questions or support, please open an issue on the GitHub repository.