Skip to main content
Glama
RhinoMCP

RhinoMCP

RhinoMCP:一个用于 Rhino 3D 的 MCP 服务器

105 个工具,用于通过 Model Context Protocol 进行 AI 驱动的 3D 建模、分析、诊断和 Grasshopper 集成。

RhinoMCP 通过一套全面的工具将 Claude 连接到 Rhino 3D,涵盖从基本图元到高级曲面建模(放样、扫掠、旋转)、布尔运算、网格诊断、块管理和 Grasshopper 参数化设计等所有内容。

架构

┌────────────────┐   stdio    ┌──────────────┐   TCP/JSON    ┌──────────────┐
│ Claude Desktop │◄──────────►│  rhino_mcp   │◄─────────────►│    Rhino 3D  │
│                │   (MCP)    │  (Python)    │  localhost:   │  listener.py │
│                │            │  server.py   │    9876       │  (inside     │
└────────────────┘            └──────────────┘               │   Rhino)     │
                                                             └──────────────┘

MCP 服务器(rhino_mcp/)。使用 FastMCP 的 Python 包。通过 stdio 与 Claude 通信,通过 TCP 与 Rhino 通信。

Rhino 监听器(rhino/listener.py)。在 Rhino 内部运行的 Python 脚本。打开 TCP 服务器,接收 JSON 命令,使用 RhinoCommon/rhinoscriptsyntax 执行这些命令,并返回结果。

Related MCP server: revit-mcp

功能

几何创建(21 个工具)

工具

描述

create_point、create_points

单个或批量创建点

create_line、create_polyline

直线和多段线

create_curve

插值 NURBS 曲线

create_circle、create_arc、create_ellipse

圆形几何体

create_rectangle

矩形多段线

create_sphere、create_box、create_cylinder、create_cone、create_torus

实体图元

create_extrusion、create_pipe

沿曲线拉伸和管道

create_surface_from_points、create_mesh

NURBS 曲面和网格

create_text

文字点

create_loft

通过横截面放样曲面

create_sweep1、create_sweep2

单轨和双轨扫掠

create_revolve

绕轴旋转轮廓

create_planar_surface、create_patch

平面和补丁曲面

变换(8 个工具)

move、rotate、scale、scale_non_uniform、mirror、copy、array_linear、array_polar

布尔运算(3 个工具)

boolean_union、boolean_difference、boolean_intersection

修改(18 个工具)

工具

描述

delete、set_color、set_material、set_name、set_layer

基本修改

group、ungroup

分组

join、explode

连接和分解几何体

trim、split

修剪和分割曲线

offset_curve、offset_surface

偏移几何体

fillet_edge、chamfer_edge、fillet_curves

边缘处理

cap_planar_holes

封盖开放的 brep

extend_curve、rebuild_curve

曲线编辑

project_to_surface

将曲线投影到曲面

duplicate_edge、duplicate_border

提取边缘/边界

块和实例(4 个工具)

create_block、insert_block、list_blocks、explode_block

用户数据(2 个工具)

set_user_text、get_user_text:存储元数据、BIM 数据、成本等。

图层(6 个工具)

list_layers、create_layer、delete_layer、set_layer_color、set_layer_visibility、set_current_layer

材质(3 个工具)

list_materials、create_material、assign_material

分析(10 个工具)

工具

描述

get_bounding_box、get_area、get_volume、get_length

测量

distance、closest_point

空间查询

intersect

查找对象之间的交点

get_curvature

曲率分析

is_point_on_surface、is_point_in_solid

点包含测试

诊断(4 个工具)

工具

描述

check_objects

检查有效性,查找坏几何体

get_naked_edges

查找曲面中的间隙

check_mesh

网格质量分析

repair_mesh

自动修复网格问题

视图(5 个工具)

zoom_extents、set_view、capture_view(带 base64 选项)、list_views、set_display_mode

Grasshopper(3 个工具)

gh_run_script、gh_set_slider、gh_get_outputs

代码执行(2 个工具)

run_python、run_command:完全访问 rhinoscriptsyntax 和 RhinoCommon

撤销/重做(2 个工具)

undo、redo

场景(4 个工具)

scene_info、get_objects、get_object(包含边缘信息的详细)、select_objects

导入/导出(2 个工具)

export(.3dm、.obj、.stl、.step、.iges、.fbx)、import_file

粗体 = v2.0 新增

先决条件

  • Rhino 7 或 8(Windows 或 Mac)

  • Python 3.10+

  • uv 包管理器(安装)

安装

1. 克隆并安装

git clone https://github.com/kbangaru-cyber/rhino-mcp.git
cd Rhino_MCP
uv sync

2. 启动 Rhino 监听器

在 Rhino 中:

  1. 转到 工具 > PythonScript > 运行

  2. 选择 rhino/listener.py

  3. 你应该看到:

============================================================
  RhinoMCP Listener v2.0.0
  Listening on 127.0.0.1:9876
  Registered handlers: 90
  Ready for MCP connection (Claude)
============================================================

3. 配置 Claude Desktop

Claude Desktop

编辑 claude_desktop_config.json:

{
  "mcpServers": {
    "rhino": {
      "command": "uv",
      "args": ["--directory", "/ABSOLUTE/PATH/TO/Rhino_MCP", "run", "rhino-mcp"],
      "env": {
        "RHINO_MCP_HOST": "127.0.0.1",
        "RHINO_MCP_PORT": "9876",
        "RHINO_MCP_TIMEOUT": "30"
      }
    }
  }
}

使用示例

创建简单的建筑形体

“为建筑体量创建一个 10x8x4 米的盒子,然后在中心添加一个半径为 2、高度为 6 的圆柱体作为塔楼。将它们并集,并对所有边缘进行半径为 0.3 的圆角。”

诊断模型问题

“检查场景中的所有对象是否有问题。查找任何裸露边缘,并告诉我需要修复什么。”

参数化设计

“通过创建轮廓曲线并旋转来制作花瓶形状。然后在它周围创建装饰性圆柱体的极轴阵列。”

内置提示

RhinoMCP 包含引导式工作流提示:

  • model-from-description:从文本描述创建 3D 模型的结构化工作流

  • diagnose-model:查找和修复模型问题的系统方法

  • parametric-design:Grasshopper/参数化工作流指南

资源

服务器将实时数据作为 MCP 资源公开:

URI

描述

rhino://scene/info

当前场景概览

rhino://layers

图层树

rhino://materials

材质列表

rhino://blocks

块定义

配置

环境变量

默认值

描述

RHINO_MCP_HOST

127.0.0.1

Rhino 监听器主机

RHINO_MCP_PORT

9876

Rhino 监听器端口

RHINO_MCP_TIMEOUT

30

命令超时(秒)

开发

# Install dev dependencies
uv sync --extra dev

# Run tests (no Rhino needed)
uv run pytest -v

# Lint
uv run ruff check .

# Type check
uv run mypy rhino_mcp

集成测试

在 Rhino 运行且监听器激活的情况下:

uv run pytest -v -m integration

协议

命令是通过 TCP 发送的 JSON 对象(以换行符分隔):

{"id": "abc123", "action": "create_sphere", "params": {"center": [0,0,0], "radius": 5}}

响应:

{"id": "abc123", "ok": true, "result": {"guid": "d3e4f5..."}}

线程安全

Rhino 监听器在 Rhino 8+ 上使用 Rhino.RhinoApp.InvokeOnUiThread() 以确保所有几何操作都在 UI 线程上运行。在 Rhino 7 上,操作直接执行(这对于单客户端连接是安全的)。

许可证

MIT。参见 LICENSE。

作者

Karthick Raja B G,作品集 · GitHub

相关工作:SPIDER,一个用于计算几何和空间分析的 Grasshopper 插件。

Available Tools

105 tools
rhino_array_linearB

Create a linear array of objects along a direction with even spacing.

Inputs: params (required). Returns: result

rhino_array_polarB

Create a polar (circular) array of objects around a center point.

Inputs: params (required). Returns: result

rhino_assign_materialC
Idempotent

Assign an existing material to objects.

Inputs: params (required). Returns: result

rhino_boolean_differenceB
Destructive

Subtract solid B from solid A.

Inputs: params (required). Returns: result

rhino_boolean_intersectionC
Destructive

Keep only the intersecting volume of two solids.

Inputs: params (required). Returns: result

rhino_boolean_unionA
Destructive

Boolean union of two solids (merge into one).

Inputs: params (required). Returns: result

rhino_cap_planar_holesA
Destructive

Cap all planar openings on an open brep to make it solid.

Inputs: params (required). Returns: result

rhino_capture_viewA
Read-onlyIdempotent

Capture the active viewport as a PNG image. Set include_base64=true to get the image data directly in the response.

Inputs: params (required). Returns: result

rhino_chamfer_edgeB
Destructive

Apply a chamfer (beveled edge) to specified edges of a solid. Use get_object first to see available edge indices.

Inputs: params (required). Returns: result

rhino_check_meshA
Read-onlyIdempotent

Check mesh quality: closed, normals, degenerate faces, naked edges.

Inputs: params (required). Returns: result

rhino_check_objectsA
Read-onlyIdempotent

Check objects for validity, bad geometry, naked edges, and common problems. Provide specific GUIDs or leave empty to check the entire scene.

Inputs: params (required). Returns: result

rhino_closest_pointA
Read-onlyIdempotent

Find the closest point on an object to a test point.

Inputs: params (required). Returns: result

rhino_copyB

Duplicate objects with an optional translation offset.

Inputs: params (required). Returns: result

rhino_create_arcB

Create an arc from center, radius, and angle range.

Inputs: params (required). Returns: result

rhino_create_blockC

Create a block definition from existing objects. Blocks are reusable geometry instances that save memory and allow batch updates.

Inputs: params (required). Returns: result

rhino_create_boxB

Create a box/cuboid with origin, width, depth, and height.

Inputs: params (required). Returns: result

rhino_create_circleC

Create a circle with given center, radius, and optional plane normal.

Inputs: params (required). Returns: result

rhino_create_coneC

Create a cone with base center, radius, and height.

Inputs: params (required). Returns: result

rhino_create_curveC

Create an interpolated NURBS curve through control points.

Inputs: params (required). Returns: result

rhino_create_cylinderB

Create a cylinder with base center, radius, and height.

Inputs: params (required). Returns: result

rhino_create_ellipseC

Create an ellipse with separate X and Y radii.

Inputs: params (required). Returns: result

rhino_create_extrusionB

Extrude an existing curve along a direction. Caps closed curves.

Inputs: params (required). Returns: result

rhino_create_layerC

Create a new layer. Use :: for nesting (e.g., 'Walls::Interior').

Inputs: params (required). Returns: result

rhino_create_lineC

Create a line from start to end point.

Inputs: params (required). Returns: result

rhino_create_loftA

Loft a surface through multiple cross-section curves. Great for creating smooth transitions between different profile shapes.

Inputs: params (required). Returns: result

rhino_create_materialB

Create a new render material with color, transparency, and reflectivity.

Inputs: params (required). Returns: result

rhino_create_meshA

Create a mesh from vertices and face indices (triangles or quads).

Inputs: params (required). Returns: result

rhino_create_patchA

Create a patch surface from boundary curves and/or interior points.

Inputs: params (required). Returns: result

rhino_create_pipeC

Create a pipe (tube) along an existing rail curve.

Inputs: params (required). Returns: result

rhino_create_planar_surfaceA

Create a planar surface from one or more closed planar curves.

Inputs: params (required). Returns: result

rhino_create_pointD

Create a point object in Rhino.

Inputs: params (required). Returns: result

rhino_create_pointsC

Create multiple point objects at once.

Inputs: params (required). Returns: result

rhino_create_polylineB

Create a polyline through ordered vertices. Optionally close it into a polygon.

Inputs: params (required). Returns: result

rhino_create_rectangleB

Create a rectangle from origin, width, and height.

Inputs: params (required). Returns: result

rhino_create_revolveA

Revolve a profile curve around an axis to create a surface of revolution. Use for creating vases, goblets, turned parts, etc.

Inputs: params (required). Returns: result

rhino_create_sphereA

Create a solid sphere with given center and radius.

Inputs: params (required). Returns: result

rhino_create_surface_from_pointsC

Create a NURBS surface from a grid of control points.

Inputs: params (required). Returns: result

rhino_create_sweep1B

Sweep one or more cross-section curves along a single rail curve. Useful for creating moldings, pipes with varying cross-sections, etc.

Inputs: params (required). Returns: result

rhino_create_sweep2A

Sweep cross-section curves along two rail curves. Gives more control over the shape of the resulting surface than single-rail sweep.

Inputs: params (required). Returns: result

rhino_create_textC

Create a text dot (always-facing label) at a point.

Inputs: params (required). Returns: result

rhino_create_torusC

Create a torus (donut shape) with major and minor radii.

Inputs: params (required). Returns: result

rhino_deleteB
Destructive

Permanently delete objects by GUID.

Inputs: params (required). Returns: result

rhino_delete_layerA
Destructive

Delete a layer and its objects.

Inputs: params (required). Returns: result

rhino_distanceB
Read-onlyIdempotent

Calculate the distance between two objects.

Inputs: params (required). Returns: result

rhino_duplicate_borderB

Duplicate the border/naked edge curves of a surface, brep, or mesh.

Inputs: params (required). Returns: result

rhino_duplicate_edgeC

Duplicate the edges of a brep as individual curves.

Inputs: params (required). Returns: result

rhino_explodeB
Destructive

Explode compound objects into individual components.

Inputs: params (required). Returns: result

rhino_explode_blockA
Destructive

Explode a block instance into its constituent objects.

Inputs: params (required). Returns: result

rhino_exportB
Read-onlyIdempotent

Export objects or the entire scene to a file (.3dm, .obj, .stl, .step, .iges, .fbx).

Inputs: params (required). Returns: result

rhino_extend_curveB
Destructive

Extend a curve by a given length from start, end, or both ends.

Inputs: params (required). Returns: result

rhino_fillet_curvesC

Create a fillet arc between two curves at their intersection.

Inputs: params (required). Returns: result

rhino_fillet_edgeA
Destructive

Apply a fillet (rounded edge) to specified edges of a solid. Use get_object first to see available edge indices.

Inputs: params (required). Returns: result

rhino_get_areaB
Read-onlyIdempotent

Calculate the surface area of a surface, brep, or mesh.

Inputs: params (required). Returns: result

rhino_get_bounding_boxA
Read-onlyIdempotent

Get the axis-aligned bounding box of an object: min/max points, dimensions, center.

Inputs: params (required). Returns: result

rhino_get_curvatureB
Read-onlyIdempotent

Get curvature at a point on a curve or surface. Returns curvature, radius of curvature, tangent, and (for surfaces) gaussian/mean curvature.

Inputs: params (required). Returns: result

rhino_get_lengthB
Read-onlyIdempotent

Calculate the length of a curve.

Inputs: params (required). Returns: result

rhino_get_naked_edgesA

Find and duplicate the naked (unjoined) edges of a brep. These indicate gaps in the surface that prevent it from being a closed solid.

Inputs: params (required). Returns: result

rhino_get_objectA
Read-onlyIdempotent

Get detailed information about a specific object by GUID, including geometry type, dimensions, area, volume, edge info, material, and user data.

Inputs: params (required). Returns: result

rhino_get_objectsA
Read-onlyIdempotent

List objects in the scene with optional filters by type, layer, or name. Returns guid, name, type, layer, color, and bounding box for each.

Inputs: params (required). Returns: result

rhino_get_user_textA
Read-onlyIdempotent

Get user text from an object. Returns a specific key or all key/value pairs.

Inputs: params (required). Returns: result

rhino_get_volumeC
Read-onlyIdempotent

Calculate the volume of a closed solid.

Inputs: params (required). Returns: result

rhino_gh_get_outputsA
Read-onlyIdempotent

Read current output values from the active Grasshopper definition.

Inputs: no named parameters. Returns: result

rhino_gh_run_scriptB

Execute a GHPython script inside Grasshopper. Has access to all Grasshopper and RhinoCommon APIs.

Inputs: params (required). Returns: result

rhino_gh_set_sliderA
Idempotent

Set the value of a Grasshopper slider to drive parametric updates.

Inputs: params (required). Returns: result

rhino_groupB

Group objects together with an optional name.

Inputs: params (required). Returns: result

rhino_import_fileB

Import geometry from a file into the current document.

Inputs: params (required). Returns: result

rhino_insert_blockB

Insert a block instance at a point with optional scale and rotation.

Inputs: params (required). Returns: result

rhino_intersectB
Read-onlyIdempotent

Find intersection between two geometric objects. Creates intersection curves if surfaces/breps intersect.

Inputs: params (required). Returns: result

rhino_is_point_in_solidA
Read-onlyIdempotent

Check if a point is inside a closed solid.

Inputs: params (required). Returns: result

rhino_is_point_on_surfaceA
Read-onlyIdempotent

Check if a point lies on a surface within tolerance.

Inputs: params (required). Returns: result

rhino_joinB
Destructive

Join adjacent curves or surfaces into a single object.

Inputs: params (required). Returns: result

rhino_list_blocksA
Read-onlyIdempotent

List all block definitions in the document.

Inputs: no named parameters. Returns: result

rhino_list_layersA
Read-onlyIdempotent

List all layers with colors, visibility, lock state, and object counts.

Inputs: no named parameters. Returns: result

rhino_list_materialsA
Read-onlyIdempotent

List all render materials in the document.

Inputs: no named parameters. Returns: result

rhino_list_viewsA
Read-onlyIdempotent

List all viewports and named views with their display modes.

Inputs: no named parameters. Returns: result

rhino_mirrorC

Mirror objects across a plane, creating copies.

Inputs: params (required). Returns: result

rhino_moveB

Move objects by a translation vector.

Inputs: params (required). Returns: result

rhino_offset_curveC

Create an offset copy of a curve at a given distance.

Inputs: params (required). Returns: result

rhino_offset_surfaceB

Offset a surface or brep by a distance. Optionally create a solid.

Inputs: params (required). Returns: result

rhino_project_to_surfaceC

Project curves onto a brep/surface along a direction.

Inputs: params (required). Returns: result

rhino_rebuild_curveA
Destructive

Rebuild a curve with a new point count and degree for a smoother result.

Inputs: params (required). Returns: result

rhino_redoB

Redo the last undone operation.

Inputs: no named parameters. Returns: result

rhino_repair_meshA
Destructive

Attempt to repair common mesh issues: degenerate faces, duplicate vertices, unified normals, and optionally fill holes.

Inputs: params (required). Returns: result

rhino_rotateB

Rotate objects around an axis through a center point.

Inputs: params (required). Returns: result

rhino_run_commandC

Execute a Rhino command string as if typed in the command line.

Inputs: params (required). Returns: result

rhino_run_pythonA

Execute arbitrary Python code inside Rhino. Has access to rhinoscriptsyntax (rs), RhinoCommon (Rhino.*), and scriptcontext (sc). Use this for advanced operations not covered by other tools.

Inputs: params (required). Returns: result

rhino_scaleB

Uniformly scale objects from a center point.

Inputs: params (required). Returns: result

rhino_scale_non_uniformD

Scale objects with separate X, Y, Z factors.

Inputs: params (required). Returns: result

rhino_scene_infoA
Read-onlyIdempotent

Get an overview of the current Rhino document: filename, unit system, tolerances, object count by type, layers, and active view.

Inputs: no named parameters. Returns: result

rhino_select_objectsB
Idempotent

Select objects in the Rhino viewport by their GUIDs.

Inputs: params (required). Returns: result

rhino_set_colorB
Idempotent

Set the display color on objects.

Inputs: params (required). Returns: result

rhino_set_current_layerC
Idempotent

Set the active/current layer.

Inputs: params (required). Returns: result

rhino_set_display_modeA
Idempotent

Set the display mode of the active viewport (Wireframe, Shaded, Rendered, etc.).

Inputs: params (required). Returns: result

rhino_set_layerC
Idempotent

Move objects to a specified layer.

Inputs: params (required). Returns: result

rhino_set_layer_colorC
Idempotent

Change the color of a layer.

Inputs: params (required). Returns: result

rhino_set_layer_visibilityB
Idempotent

Show or hide a layer.

Inputs: params (required). Returns: result

rhino_set_materialB
Idempotent

Assign a named material to objects.

Inputs: params (required). Returns: result

rhino_set_nameA
Idempotent

Set or change the name of a Rhino object.

Inputs: params (required). Returns: result

rhino_set_user_textB
Idempotent

Set a user text key/value pair on objects. Useful for storing metadata, BIM data, cost information, etc.

Inputs: params (required). Returns: result

rhino_set_viewB
Idempotent

Switch the viewport to a named view (Top, Front, Right, Perspective, etc.).

Inputs: params (required). Returns: result

rhino_splitB
Destructive

Split a curve at its intersection with a cutting object.

Inputs: params (required). Returns: result

rhino_trimB
Destructive

Trim a curve at its intersection with a cutting object.

Inputs: params (required). Returns: result

rhino_undoA

Undo the last operation in Rhino.

Inputs: no named parameters. Returns: result

rhino_ungroupA
Idempotent

Ungroup a named group, releasing its members.

Inputs: params (required). Returns: result

rhino_zoom_extentsA
Idempotent

Zoom the active viewport to show the entire scene.

Inputs: no named parameters. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.7/5.0

    Scored across 105 tools

    Disambiguation2/5

    Most geometry creation/editing tools are distinguishable by their object type and operation, but the set contains direct duplicates (set_material/assign_material, duplicate_border/get_naked_edges) and overlapping checks (check_objects/check_mesh). With 105 tools, an agent must navigate many near-synonyms and the line between trim/split and copy/array is not always obvious.

    Naming Consistency4/5

    Tools consistently use the rhino_ prefix with snake_case verb_noun operations, making groups like create_* and get_* easy to scan. Minor inconsistencies exist (scene_info is noun-only, distance/intersect have no target, set_material vs assign_material) but they do not undermine the overall pattern.

    Tool Count1/5

    At 105 tools, this is an extreme mismatch for an MCP tool surface, far beyond the 25+ threshold where selection overhead becomes severe. Many narrow variants (e.g., point vs points, multiple sweep/loft surface creators) could be consolidated without losing capability.

    Completeness4/5

    The server covers the full Rhino modeling lifecycle: primitive creation, editing, transformations, booleans, analysis, layers, materials, blocks, Grasshopper, and file I/O. Minor gaps like layer rename/lock or block definition removal exist, but the universal run_python and run_command escape hatches prevent dead ends.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables AI assistants to interact with Autodesk Revit to query project data, manage elements, and execute generated code via the Model Context Protocol. It provides full compatibility with GitHub Copilot and Claude to automate BIM modeling workflows.
      13
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Connects Rhino and Grasshopper to Claude AI via the Model Context Protocol, enabling prompt-assisted 3D modeling, scene manipulation, and control through tools like object creation, layer management, and code execution.
      32
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI-powered 3D modeling in Rhino 8 through 135+ tools for geometry, transformations, booleans, layers, materials, and more, using natural language.
      7
      MIT