Claude Rhino
No description available
Ask AI about Claude Rhino
Powered by Claude Β· Grounded in docs
I know everything about Claude Rhino. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
rhino-mcp
A Model Context Protocol (MCP) server that enables interaction with Rhinoceros 3D software through Python scripts. This server allows you to execute RhinoPython scripts programmatically via the MCP protocol.
What This Project Does
This MCP server provides a bridge between MCP-compatible clients (like AI assistants) and Rhinoceros 3D. It allows you to:
- Execute Python scripts that interact with Rhino 3D
- Automate Rhino operations through the MCP protocol
- Control Rhino programmatically from external applications
The server creates a COM connection to Rhino using the winax library, executes Python scripts in Rhino's Python environment, and manages temporary script files.
Dependencies
Runtime Dependencies
- @modelcontextprotocol/sdk (^1.13.2): The Model Context Protocol SDK for building MCP servers. Provides the server infrastructure, tool registration, and stdio transport.
- winax (^3.6.2): A Node.js library for creating and interacting with Windows COM objects. Used to connect to Rhino's COM interface.
Development Dependencies
- typescript (^5.8.3): TypeScript compiler for type-safe JavaScript development
- @types/node (^24.0.8): TypeScript type definitions for Node.js
How It Works
-
Server Initialization: The server starts as an MCP server named "rhino-server" using stdio transport for communication.
-
Rhino Connection: When a tool is called, the server attempts to connect to Rhino via COM:
- Creates a
Rhino.ApplicationCOM object usingwinax - Sets Rhino to visible mode
- Maintains a singleton instance that is reused across requests
- Creates a
-
Script Execution:
- Receives Python script content via the
rhino_executetool - Creates a temporary script file in the
temp-scriptsdirectory - Executes the script in Rhino using the
-_RunPythonScriptcommand - Cleans up the temporary file after execution
- Receives Python script content via the
-
Tool Registration: The server registers one tool:
rhino_execute: Executes a Python script in Rhino and returns the result
Prerequisites
- Node.js: Required to run the server (version compatible with ES2022 modules)
- Rhinoceros 3D: Must be installed on your Windows system
- Windows OS: Required for COM object support (winax only works on Windows)
Installation
- Install dependencies:
npm install
- Build the TypeScript code:
npm run build
Running the Server
Development Mode
Run the server directly with TypeScript (requires tsx):
npm run dev
Production Mode
Build first, then run:
npm run build
npm start
As a Binary
After building, the server can be run as:
node dist/index.js
Usage with MCP Clients
To use this server with an MCP client (like Claude Desktop or other MCP-compatible applications), you need to configure the client to connect to this server via stdio.
Example configuration for Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"rhino-mcp": {
"command": "node",
"args": ["path/to/rhino-mcp/dist/index.js"]
}
}
}
Available Tools
rhino_execute
Executes a Python script in Rhino 3D.
Input Schema:
pythonScript(string): The Python script to execute in Rhino
Example Usage:
import rhinoscriptsyntax as rs
# Create a point at origin
point = rs.AddPoint([0, 0, 0])
print(f"Created point: {point}")
Project Structure
rhino-mcp/
βββ src/
β βββ index.ts # Main server implementation
βββ dist/ # Compiled JavaScript output
βββ temp-scripts/ # Temporary Python script storage
βββ package.json # Project dependencies and scripts
βββ tsconfig.json # TypeScript configuration
βββ README.md # This file
Scripts
npm run build: Compiles TypeScript to JavaScript in thedistdirectorynpm run build:watch: Watches for changes and rebuilds automaticallynpm run dev: Runs the server in development mode using tsxnpm start: Runs the compiled server fromdist/index.jsnpm test: Placeholder test script (currently not implemented)
Notes
- The server requires Rhino to be installed and accessible via COM
- Scripts are temporarily stored in
temp-scripts/and cleaned up after execution - The server maintains a single Rhino instance connection that is reused
- If the Rhino connection is lost, the server will attempt to reconnect on the next request
- This server is Windows-only due to COM object requirements
