alfredatnycu_grasshopper_mcp

alfredatnycu_grasshopper_mcp

by alfredatnycu
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

  1. Install the Grasshopper MCP Component
  2. Method 1: Download the pre-compiled GH_MCP.gha file from the GitHub repository and copy it to %APPDATA%\Grasshopper\Libraries\.
  3. Method 2: Build from source using Visual Studio.

  4. Install the Python MCP Bridge Server

  5. Method 1: Install from PyPI:
    bash pip install grasshopper-mcp
  6. Method 2: Install from GitHub:
    bash pip install git+https://github.com/alfredatnycu/grasshopper-mcp.git
  7. Method 3: Install from source:
    bash git clone https://github.com/alfredatnycu/grasshopper-mcp.git cd grasshopper-mcp pip install -e .
  8. Install a Specific Version:
    bash pip install grasshopper-mcp==0.1.0

Usage

  1. Start Rhino and Grasshopper.
  2. Add the GH_MCP Component to your Grasshopper canvas.
  3. Start the Python MCP Bridge Server:
    bash python -m grasshopper_mcp.bridge
  4. Connect Claude Desktop to the MCP Bridge:
  5. Manual Connection: Use the settings Protocol: MCP, Host: localhost, Port: 8080.
  6. Auto-Start Configuration: Modify Claude Desktop's configuration:
    json "grasshopper": { "command": "python", "args": ["-m", "grasshopper_mcp.bridge"] }
  7. 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

  1. GH_MCP Component Not Loading:
  2. Ensure the .gha file is in the correct location.
  3. Unblock new components in Grasshopper preferences.
  4. Restart Rhino and Grasshopper.
  5. Bridge Server Won't Start:
  6. Use python -m grasshopper_mcp.bridge if grasshopper-mcp doesn’t work.
  7. Ensure Python dependencies are installed.
  8. Check if port 8080 is in use.
  9. Claude Desktop Can't Connect:
  10. Ensure the bridge server is running.
  11. Verify connection settings (localhost:8080).
  12. Check the bridge server console for errors.
  13. Commands Not Executing:
  14. Verify the GH_MCP component is on the canvas.
  15. Check the bridge server console for errors.
  16. 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.

Features & Capabilities

Categories
mcp_server model_context_protocol grasshopper claude python c# api_integration rhino

Implementation Details

Stats

0 Views
1 GitHub Stars

Repository Info

alfredatnycu Organization

Similar MCP Servers

continuedev_continue by continuedev
25049
21423
9300