New Grasshopper tools: - grasshopper_delete_component: Remove components from canvas - grasshopper_add_group: Add comment groups around components - grasshopper_add_scribble: Add text annotations - grasshopper_rename_component: Rename component nicknames New GIS/Terrain tools: - rhino_import_geotiff: Import GeoTIFF as heightfield mesh - rhino_import_shapefile: Import ESRI Shapefiles - rhino_import_xyz: Import XYZ point clouds - rhino_transform_coordinates: Offset/transform coordinates - rhino_get_bounding_box: Get object bounds - rhino_create_grid: Create survey grids - rhino_create_site_section: Generate terrain profiles - rhino_calculate_area_volume: Calculate cut/fill volumes Added: - CLAUDE.md: Project documentation with dev guidelines - install.bat: Windows installer script - MeshTerrainHandler.cs: Separate handler for mesh/terrain/GIS 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
140 lines
6.4 KiB
Markdown
140 lines
6.4 KiB
Markdown
# RhinoMCP - Claude Code Projektdokumentation
|
|
|
|
## Projektübersicht
|
|
|
|
RhinoMCP ist ein MCP (Model Context Protocol) Plugin, das Claude AI direkten Zugriff auf Rhino 3D und Grasshopper ermöglicht. Es wurde für Landschaftsarchitektur, Straßeninfrastruktur und Regenwassermanagement entwickelt.
|
|
|
|
## Architektur
|
|
|
|
```text
|
|
┌─────────────────────────────────────────────────────────┐
|
|
│ Claude.ai / Claude Code │
|
|
└──────────────────┬──────────────────────────────────────┘
|
|
│ MCP Protocol (stdio)
|
|
┌──────────────────▼──────────────────────────────────────┐
|
|
│ MCP-Server (Python) │
|
|
│ src/mcp-server/server.py │
|
|
│ - Tool-Definitionen │
|
|
│ - Request/Response Handling │
|
|
└──────────────────┬──────────────────────────────────────┘
|
|
│ HTTP (localhost:9000)
|
|
┌──────────────────▼──────────────────────────────────────┐
|
|
│ Rhino-Plugin (C# .rhp) │
|
|
│ src/rhino-plugin/RhinoMCP/ │
|
|
│ ├─ RhinoMcpPlugin.cs (Plugin-Einstieg) │
|
|
│ ├─ HttpServer.cs (HTTP-Endpoint) │
|
|
│ ├─ CommandHandler.cs (Rhino-Befehle) │
|
|
│ ├─ GrasshopperHandler.cs(GH-Befehle) │
|
|
│ └─ MeshTerrainHandler.cs(Mesh/GIS-Tools) │
|
|
└─────────────────────────────────────────────────────────┘
|
|
```
|
|
|
|
## Technische Details
|
|
|
|
- **Rhino-Version**: Rhino 9 WIP
|
|
- **Framework**: .NET 7.0
|
|
- **RhinoCommon/Grasshopper SDK**: 8.0.23304.9001
|
|
- **HTTP-Server**: EmbedIO auf Port 9000
|
|
- **MCP-Transport**: stdio
|
|
|
|
## Verfügbare Tools
|
|
|
|
### Rhino-Geometrie
|
|
|
|
- `rhino_create_point`, `rhino_create_line`, `rhino_create_polyline`
|
|
- `rhino_create_circle`, `rhino_create_sphere`, `rhino_create_box`
|
|
- `rhino_create_surface`, `rhino_create_curve`
|
|
- `rhino_move`, `rhino_rotate`, `rhino_scale`, `rhino_copy`
|
|
- `rhino_boolean_union`, `rhino_boolean_difference`, `rhino_boolean_intersection`
|
|
- `rhino_export`, `rhino_run_command`
|
|
|
|
### Grasshopper
|
|
|
|
- `grasshopper_open_definition`, `grasshopper_get_definition_info`
|
|
- `grasshopper_add_component`, `grasshopper_connect_components`
|
|
- `grasshopper_add_slider`, `grasshopper_set_slider_value`
|
|
- `grasshopper_set_toggle_value`, `grasshopper_set_panel_text`
|
|
- `grasshopper_bake`, `grasshopper_save_definition`, `grasshopper_recompute`
|
|
- `grasshopper_delete_component`, `grasshopper_add_group`
|
|
- `grasshopper_add_scribble`, `grasshopper_rename_component`
|
|
|
|
### Mesh/Terrain/GIS
|
|
|
|
- `rhino_mesh_from_points`, `rhino_import_mesh`, `rhino_mesh_boolean`
|
|
- `rhino_terrain_contours`, `rhino_terrain_slope_analysis`
|
|
- `rhino_terrain_watershed`, `rhino_terrain_low_points`
|
|
- `rhino_create_drainage_line`, `rhino_create_road_surface`
|
|
- `rhino_import_geotiff`, `rhino_import_shapefile`, `rhino_import_xyz`
|
|
- `rhino_transform_coordinates`, `rhino_get_bounding_box`
|
|
- `rhino_create_grid`, `rhino_create_site_section`, `rhino_calculate_area_volume`
|
|
|
|
## Installation
|
|
|
|
1. Plugin bauen: `dotnet build --configuration Release`
|
|
2. `install.bat` ausführen oder manuell nach `%APPDATA%\McNeel\Rhinoceros\9.0\Plug-ins\RhinoMCP (1.0.0)\` kopieren
|
|
3. MCP-Server in Claude Code konfigurieren
|
|
|
|
## Entwicklungsrichtlinien
|
|
|
|
### Automatisches Commit bei Kapazitätswarnung
|
|
|
|
**WICHTIG**: Ab 85% Chat-Kapazität muss automatisch:
|
|
|
|
1. Aktueller Stand dokumentiert werden
|
|
2. Alle Änderungen committet werden
|
|
3. Zusammenfassung der offenen Aufgaben erstellt werden
|
|
|
|
### Code-Struktur
|
|
|
|
- **Maximale Dateigröße: 300 Zeilen pro Datei**
|
|
- Bei Überschreitung: Logisch aufteilen in separate Handler-Klassen
|
|
|
|
### Aktuelle Aufteilungsempfehlungen
|
|
|
|
| Datei | Zeilen | Status | Empfehlung |
|
|
| ---------------------- | ------ | -------- | --------------------------------------------------------- |
|
|
| CommandHandler.cs | ~683 | Zu groß | Aufteilen in GeometryHandler, TransformHandler |
|
|
| MeshTerrainHandler.cs | ~1509 | Zu groß | Aufteilen in MeshHandler, TerrainHandler, GISHandler, RoadHandler |
|
|
| GrasshopperHandler.cs | ~671 | Zu groß | Aufteilen in GH_ComponentHandler, GH_DocumentHandler |
|
|
| server.py | ~1185 | Zu groß | Tool-Definitionen in separate Module |
|
|
|
|
## Changelog
|
|
|
|
### 2025-12-29
|
|
|
|
- Initiale Entwicklung des RhinoMCP Plugins
|
|
- Implementiert: Rhino-Geometrie, Grasshopper-Integration, Mesh/Terrain-Tools
|
|
- Neue GH-Tools: `delete_component`, `add_group`, `add_scribble`, `rename_component`
|
|
- GIS-Tools: GeoTIFF, Shapefile, XYZ Import
|
|
- Terrain-Analyse: Konturlinien, Gefälle, Wasserscheiden
|
|
|
|
## Offene Aufgaben
|
|
|
|
- [ ] Code-Refactoring: Große Dateien aufteilen (max. 300 Zeilen)
|
|
- [ ] Unit-Tests implementieren
|
|
- [ ] Fehlerbehandlung verbessern
|
|
- [ ] Dokumentation erweitern
|
|
|
|
## Projektstruktur
|
|
|
|
```text
|
|
Rhino-MCP/
|
|
├── CLAUDE.md # Diese Dokumentation
|
|
├── README.md # Öffentliche Dokumentation
|
|
├── LICENSE # MIT Lizenz
|
|
├── install.bat # Windows-Installer
|
|
├── src/
|
|
│ ├── mcp-server/
|
|
│ │ ├── server.py # MCP-Server (TODO: aufteilen)
|
|
│ │ └── requirements.txt
|
|
│ └── rhino-plugin/
|
|
│ └── RhinoMCP/
|
|
│ ├── RhinoMCP.csproj
|
|
│ ├── RhinoMcpPlugin.cs
|
|
│ ├── HttpServer.cs
|
|
│ ├── CommandHandler.cs # TODO: aufteilen
|
|
│ ├── GrasshopperHandler.cs # TODO: aufteilen
|
|
│ └── MeshTerrainHandler.cs # TODO: aufteilen
|
|
└── docs/ # Zusätzliche Dokumentation
|
|
```
|