An MCP server for generating and managing Grasshopper Python components
Project description
Sand Martin
Sand Martin is an MCP (Model Context Protocol) server that enables real-time orchestration of the Grasshopper canvas within Rhino. It allows Large Language Models (like Claude) to create components, inject Python code, and wire nodes together directly in a live Grasshopper session.
Architecture
Sand Martin uses a Client-Server model:
- SandMartin.Host (C#): A Grasshopper plugin (
.gha) that runs an internal HTTP server inside the Rhino process. It has direct access to theGrasshopper.KernelAPI. - Sand Martin Bridge (Python): A lightweight MCP server that translates LLM requests into commands for the Host server.
Getting Started
1. Requirements
- Rhino 8 (macOS/Windows)
- .NET SDK 6.0+ (for building the Host)
- Python 3.10+
2. Build & Install the Host Plugin
From the root directory:
dotnet build
The build process will automatically attempt to deploy the .gha plugin to your Rhino Libraries folder.
3. Install the Python Bridge
pip install -e .
Configuration for Claude Desktop
Add the following to your claude_desktop_config.json:
{
"mcpServers": {
"sand-martin": {
"command": "python",
"args": ["/PATH/TO/YOUR/sand-martin/src/sand_martin/server.py"]
}
}
}
Note: Replace /PATH/TO/YOUR/ with the actual absolute path to this repository.
Usage
- Start Rhino and open Grasshopper.
- Launch Claude Desktop.
- You can now ask Claude to:
- "Create a Python component that calculates a Fibonacci sequence."
- "Connect a Slider to the input of my component."
- "Show me the current state of my canvas."
Project Structure
src/SandMartin.Host/: C# source for the Grasshopper plugin.src/sand_martin/: Python source for the MCP server.sand-martin.sln: Visual Studio Solution file.pyproject.toml: Python project configuration.
License
This project is licensed under the Apache License 2.0.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sand_martin-0.1.0.tar.gz.
File metadata
- Download URL: sand_martin-0.1.0.tar.gz
- Upload date:
- Size: 677.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21983302296cff56227346f36f4379253121f4aaa19ce517f52e86d4717ef0a0
|
|
| MD5 |
e40d9bc92b7cd0fd38dda57e6e716d00
|
|
| BLAKE2b-256 |
85b6c94eab0d97f759f44c2f01af50cb300eb2bfc17287b3bb46b8bbfdc5c669
|
File details
Details for the file sand_martin-0.1.0-py3-none-any.whl.
File metadata
- Download URL: sand_martin-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c577d6da70ad771f1dd3fc465f2d718f76cde73ec32b9687c03405e932625b5e
|
|
| MD5 |
b8690dd55f1824d30023b206d668a391
|
|
| BLAKE2b-256 |
c55e0ef7592c7a4b2b86ddc51fae7085e4f8bd8f2554f22e2d217161589889fc
|