The Rhino CLI includes a Model Context Protocol (MCP) server that allows Claude Desktop and other MCP clients to control Rhino 3D.
The MCP server uses stdio transport with JSON-RPC 2.0 protocol to communicate with MCP clients like Claude Desktop. It connects to the existing Rhino HTTP server (localhost:9090) and provides access to Rhino functionality through MCP tools and resources.
Claude Desktop
↓ (spawns process)
rhino mcp (stdio JSON-RPC)
↓ (HTTP requests)
rhino server (localhost:9090)
↓ (queue + proxy)
Rhino Python Server (TCP 17890)
# Terminal 1: Start HTTP server
rhino server
# Terminal 2: Start MCP server
rhino mcpThe MCP server requires the HTTP server to be running first.
The server exposes five tools that Claude can call:
Execute Python code in Rhino.
Input:
code(string, required): Python code to execute
Output:
- Execution result (stdout, stderr, result)
Example:
{
"name": "rhino_exec",
"arguments": {
"code": "rs.AddPoint([0,0,0]); sc.doc.Views.Redraw()"
}
}Evaluate a Python expression and return its value.
Input:
expr(string, required): Python expression to evaluate
Output:
- Value of the expression
Example:
{
"name": "rhino_eval",
"arguments": {
"expr": "rs.UnitSystem()"
}
}Get the current status of the Rhino server.
Input: None
Output:
- Server status (version, python version, mode, etc.)
Render the current Rhino viewport as a PNG image.
Input:
width(number, optional): Image width in pixels (default: 800)height(number, optional): Image height in pixels (default: 600)
Output:
- Base64-encoded PNG image
Example:
{
"name": "rhino_render_viewport",
"arguments": {
"width": 1024,
"height": 768
}
}Introspect available Rhino APIs.
Input:
api(string, required): API to introspect: "rs" (rhinoscriptsyntax) or "rhino" (RhinoCommon)
Output:
- List of available functions/types
Example:
{
"name": "rhino_introspect",
"arguments": {
"api": "rs"
}
}The server exposes three resources that Claude can read:
Current viewport screenshot as PNG image.
MIME Type: image/png
Description: Always returns the current state of the Rhino viewport
List of all objects in the current Rhino document.
MIME Type: application/json
Description: Returns a JSON array of object GUIDs
Current status of the Rhino server.
MIME Type: application/json
Description: Server health, version, and configuration info
- Type: stdio (standard input/output)
- Format: Newline-delimited JSON-RPC 2.0 messages
- Logging: All logs go to stderr, stdout is reserved for JSON-RPC
All messages follow JSON-RPC 2.0 specification:
Request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "rhino_exec",
"arguments": {
"code": "print('hello')"
}
}
}Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"content": [
{
"type": "text",
"text": "hello\n"
}
],
"isError": false
}
}The server announces these capabilities during initialization:
{
"capabilities": {
"tools": {},
"resources": {}
}
}See Claude Desktop Setup for configuration instructions.
The MCP server returns standard JSON-RPC error codes:
-32601: Method not found-32602: Invalid params (unknown tool/resource)-32603: Internal error (execution failed)
Example error response:
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32602,
"message": "unknown tool: invalid_tool"
}
}- Single HTTP server: Can only connect to one Rhino HTTP server at a time
- No streaming: All responses are complete (no streaming support yet)
- No prompts: MCP prompts are not implemented yet
- Synchronous: All operations are synchronous (no async/await)
- Ensure HTTP server is running:
rhino server - Check that port 9090 is accessible:
rhino ping - Check stderr for error messages
- Verify config file location:
~/Library/Application Support/Claude/claude_desktop_config.json(macOS) - Check config JSON syntax
- Verify
commandpath points to yourrhinobinary - Restart Claude Desktop after config changes
- Verify HTTP server is healthy:
curl http://localhost:9090/healthz - Check that Rhino process is running
- Look for errors in MCP server logs (stderr)
- Test tools directly via HTTP:
rhino exec --code "print('test')"
- Add MCP prompts for common workflows
- Support streaming responses for long-running operations
- Add more resources (layers, materials, views)
- Support connecting to remote HTTP servers
- Add authentication/authorization
- Implement progress notifications