MCP HubMCP Hub
always-tinkering

rhinoMcpServer

by: always-tinkering

RhinoMCP connects Rhino to Claude AI through the Model Context Protocol (MCP), enabling AI-assisted 3D modeling and architectural design.

28created 15/03/2025
Visit
Rhino
Claude

πŸ“ŒOverview

Purpose: This framework aims to implement a Model Context Protocol (MCP) server for the Rhino 3D environment, enabling AI assistants to create and manipulate 3D objects effectively.

Overview: The Rhino MCP Server allows integration of AI applications like Claude with Rhino 3D through the Model Context Protocol. This setup facilitates direct interaction for creating and managing 3D models via an AI interface, currently under development with active community involvement.

Key Features:

  • MCP Server Implementation: A system that streamlines communication between AI assistants and Rhino 3D, enabling seamless object creation and manipulation.

  • Unified Server Launcher: A versatile tool that lets users run various server modes including combined, standalone, and daemon setups, simplifying the execution process.


Rhino MCP Server

⚠️ UNDER CONSTRUCTION ⚠️
This project is under active development and is not yet fully functional. The Rhino plugin currently has issues with creating objects. Community support is welcome, especially from those experienced with Rhino API, C# plugins, or MCP integration. Please consider contributing by opening an issue on GitHub.

A Model Context Protocol (MCP) server implementation for Rhino 3D, enabling Claude AI to create and manipulate 3D objects.

Overview

This project implements an MCP server for Rhino 3D, allowing AI assistants like Claude to interact with Rhino via the Model Context Protocol. The server facilitates the creation and manipulation of 3D objects directly from the AI interface.

System Architecture

The system consists of Python components implementing the MCP server and C# components integrating with Rhino. The main interactions are:

  • Python Socket Proxy (socket_proxy.py) forwards commands.
  • Python Daemon Server (daemon_mcp_server.py) receives commands via socket.
  • Python Combined MCP Server (combined_mcp_server.py) uses stdin/stdout for communication, recommended for use.
  • C# Rhino Plugin handling Rhino integration.
  • Logging System centralizes logs from all components.
  • Rhino 3D Software as the environment.

For detailed architecture and data flow, see the code_architecture.md file.

Components

Server Implementations

  • Combined MCP Server (Recommended):
    combined_mcp_server.py β€” direct implementation using stdin/stdout.

  • Socket-based Servers:
    daemon_mcp_server.py β€” background server receiving commands via socket.
    socket_proxy.py β€” forwards commands from stdin to the daemon server.

  • Standalone Server:
    standalone-mcp-server.py β€” original standalone implementation.

Setup Instructions

1. Setup Claude Desktop

  • Install Claude Desktop if not already installed.
  • Configure the MCP server connection in Claude Desktop settings.

2. Run the Server

A unified server launcher allows running any server implementation:

./server_launcher.sh [mode]

Available modes:

  • combined (default) β€” run the combined MCP server
  • standalone β€” run the standalone MCP server
  • daemon β€” run the daemon MCP server
  • socket-proxy β€” run the socket proxy
  • direct β€” run both daemon and socket proxy
  • logs β€” view recent logs
  • monitor β€” monitor logs in real-time
  • errors β€” view recent errors
  • help β€” show help message

Examples:

# 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

Available Tools

The server provides several 3D modeling tools:

  1. geometry_tools.create_sphere β€” create a sphere with center and radius
  2. geometry_tools.create_box β€” create a box with specified dimensions
  3. geometry_tools.create_cylinder β€” create a cylinder with parameters
  4. scene_tools.get_scene_info β€” get information about the current scene
  5. scene_tools.clear_scene β€” clear objects from the scene
  6. scene_tools.create_layer β€” create a new layer in the document

Troubleshooting

If connection issues occur:

  1. Ensure no old servers are running:

    ./server_launcher.sh help  # cleans up existing processes
    
  2. Check log files:

    ./server_launcher.sh logs   # view logs
    ./server_launcher.sh errors # view errors
    
  3. Restart Claude Desktop completely.

Improved Logging System

The system centralizes logs from all components in a unified format, stored under the logs/ directory with separate subdirectories:

  • Server logs
  • Plugin logs
  • Claude AI logs
  • Diagnostic logs

Log Management

Log management commands:

# 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
./log_manager.py report

For more on logging, see LOGGING.md.

Development

Project Structure

  • combined_mcp_server.py: main MCP server implementation
  • diagnose_rhino_connection.py: diagnostic tool for testing Rhino connection
  • log_manager.py: log management and analysis
  • server_launcher.sh: unified server launcher script
  • logs/: directory containing all logs

Adding New Features

  1. Add new tools as methods in combined_mcp_server.py.
  2. Use the existing logging framework for error handling.
  3. Update diagnostic tools as needed.

License

This project is licensed under the MIT License. See LICENSE for details.