Rhino 3D 建模器
STDIO让Claude在Rhino中创建和操作3D对象
让Claude在Rhino中创建和操作3D对象
⚠️ UNDER CONSTRUCTION ⚠️
This project is currently under active development and is not yet in working order. The Rhino plugin is experiencing issues with creating objects. We are actively seeking support from the community to help resolve these issues. If you have experience with Rhino API development, C# plugins, or MCP integration, please consider contributing. Contact us by opening an issue on GitHub.
A Model Context Protocol (MCP) server implementation for Rhino 3D, allowing Claude to create and manipulate 3D objects.
This project implements an MCP server for Rhino 3D that enables AI assistants like Claude to interact with Rhino through the Model Context Protocol. The server allows for the creation and manipulation of 3D objects directly from the AI interface.
The system consists of Python components that implement the MCP server and C# components that integrate with Rhino. Here's an overview of how the system components interact:
graph TD %% Client Applications client[Client Applications] --> socketProxy %% Socket Proxy subgraph "Python Socket Proxy" socketProxy[socket_proxy.py] --> daemonServer end %% Daemon Server subgraph "Python Daemon Server" daemonServer[daemon_mcp_server.py] --> combinedServer end %% Combined MCP Server subgraph "Python Combined MCP Server" combinedServer[combined_mcp_server.py] mcp[FastMCP] --> tools combinedServer --> mcp combinedServer --> rhinoConn subgraph "MCP Tools" tools[MCP Tool Methods] end rhinoConn[RhinoConnection] end %% Rhino Plugin Components subgraph "C# Rhino Plugin" rhinoPlugin[RhinoMcpPlugin.cs] socketServer[RhinoSocketServer.cs] utilities[RhinoUtilities.cs] commands[RhinoMcpCommand.cs] rhinoPlugin --> socketServer rhinoPlugin --> commands socketServer --> utilities end %% Connections between components rhinoConn <==> socketServer %% Logger Components subgraph "Logging System" logManager[log_manager.py] nlogConfig[NLog.config] end combinedServer --> logManager rhinoPlugin --> nlogConfig %% Connection to Rhino rhino[Rhino 3D Software] rhinoPlugin --> rhino classDef pythonClass fill:#3572A5,color:white; classDef csharpClass fill:#178600,color:white; classDef rhinoClass fill:#555555,color:white; class socketProxy,daemonServer,combinedServer,mcp,tools,rhinoConn,logManager pythonClass; class rhinoPlugin,socketServer,utilities,commands csharpClass; class rhino rhinoClass;
For more detailed information about the system architecture, including component descriptions and data flow, see code_architecture.md.
There are several implementations available:
Combined MCP Server (Recommended):
combined_mcp_server.py
- Direct implementation that uses stdin/stdout for communicationSocket-based Servers:
daemon_mcp_server.py
- Background server that receives commands via socket connectionsocket_proxy.py
- Proxy that forwards commands from stdin to the daemon server and backStandalone Server:
standalone-mcp-server.py
- Original standalone implementationWe now have a unified server launcher that allows you to run any of the server implementations:
./server_launcher.sh [mode]
Available modes:
combined
(default) - Run the combined MCP serverstandalone
- Run the standalone MCP serverdaemon
- Run the daemon MCP serversocket-proxy
- Run the socket proxydirect
- Run both daemon and socket proxylogs
- View recent logsmonitor
- Monitor logs in real-timeerrors
- View recent errorshelp
- Show help messageExamples:
# Run the combined server (recommended) ./server_launcher.sh combined # Or simply ./server_launcher.sh # Run the socket-based approach (daemon + proxy) ./server_launcher.sh direct # Monitor logs in real-time ./server_launcher.sh monitor
The server provides several tools for 3D modeling:
If you encounter connection issues:
Make sure no old servers are running:
./server_launcher.sh help # This will clean up existing processes
Check the log files:
./server_launcher.sh logs # View logs ./server_launcher.sh errors # View errors
Restart Claude Desktop completely
This project is released under the MIT License. See the LICENSE file for details.
The system features a unified logging framework that centralizes logs from all components:
All logs follow a consistent format and are stored in the logs/
directory with separate subdirectories for each component.
A log management tool is provided that offers powerful capabilities for viewing, monitoring, and analyzing logs:
# View logs ./server_launcher.sh logs # Monitor logs in real-time ./server_launcher.sh monitor # View errors with context ./server_launcher.sh errors # Generate error reports (using the log manager directly) ./log_manager.py report
For detailed information on using the logging system, see LOGGING.md.
combined_mcp_server.py
: Main MCP server implementationdiagnose_rhino_connection.py
: Diagnostic tool for testing Rhino connectionlog_manager.py
: Tool for managing and analyzing logsserver_launcher.sh
: Unified script to start any server implementationlogs/
: Directory containing all logscombined_mcp_server.py
file