rhinomcp

jingcheng-chen/rhinomcp

3.6

If you are the rightful owner of rhinomcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

RhinoMCP connects Rhino to AI agents through the Model Context Protocol (MCP), allowing AI agents to directly interact with and control Rhino. This integration enables prompt assisted 3D modeling in Rhino 3D.

Tools

Functions exposed to the LLM to take actions

create_object

Create a new object in the Rhino document.

Parameters:

  • type: Object type ("POINT", "LINE", "POLYLINE", "CIRCLE", "ARC", "ELLIPSE", "CURVE", "BOX", "SPHERE", "CONE", "CYLINDER", "PIPE", "SURFACE")
  • name: Optional name for the object
  • color: Optional [r, g, b] color values (0-255) for the object
  • params: Type-specific parameters dictionary (see documentation for each type)
  • translation: Optional [x, y, z] translation vector
  • rotation: Optional [x, y, z] rotation in radians
  • scale: Optional [x, y, z] scale factors

The params dictionary is type-specific. For POINT, the params dictionary should contain the following keys:

  • x: x coordinate of the point
  • y: y coordinate of the point
  • z: z coordinate of the point

For LINE, the params dictionary should contain the following keys:

  • start: [x, y, z] start point of the line
  • end: [x, y, z] end point of the line

For POLYLINE, the params dictionary should contain the following keys:

  • points: List of [x, y, z] points that define the polyline

For CIRCLE, the params dictionary should contain the following keys:

  • center: [x, y, z] center point of the circle
  • radius: Radius of the circle

For ARC, the params dictionary should contain the following keys:

  • center: [x, y, z] center point of the arc
  • radius: Radius of the arc
  • angle: Angle of the arc in degrees

For ELLIPSE, the params dictionary should contain the following keys:

  • center: [x, y, z] center point of the ellipse
  • radius_x: Radius of the ellipse along X axis
  • radius_y: Radius of the ellipse along Y axis

For CURVE, the params dictionary should contain the following keys:

  • points: List of [x, y, z] control points that define the curve
  • degree: Degree of the curve (default is 3, if user asked for smoother curve, degree can be higher) If the curve is closed, the first and last points should be the same.

For BOX, the params dictionary should contain the following keys:

  • width: Width of the box along X axis of the object
  • length: Length of the box along Y axis of the object
  • height: Height of the box along Z axis of the object

For SPHERE, the params dictionary should contain the following key:

  • radius: Radius of the sphere

For CONE, the params dictionary should contain the following keys:

  • radius: Radius of the cone
  • height: Height of the cone
  • cap: Boolean to indicate if the cone should be capped at the base, default is True

For CYLINDER, the params dictionary should contain the following keys:

  • radius: Radius of the cylinder
  • height: Height of the cylinder
  • cap: Boolean to indicate if the cylinder should be capped at the base, default is True

For SURFACE, the params dictionary should contain the following keys:

  • count : ([number, number]) Tuple of two numbers defining number of points in the u,v directions
  • points: List of [x, y, z] points that define the surface
  • degree: ([number, number], optional) Degree of the surface (default is 3, if user asked for smoother surface, degree can be higher)
  • closed: ([bool, bool], optional) Two booleans defining if the surface is closed in the u,v directions

Returns: A message indicating the created object name.

Examples of params:

  • POINT: {"x": 0, "y": 0, "z": 0}
  • LINE: {"start": [0, 0, 0], "end": [1, 1, 1]}
  • POLYLINE: {"points": [[0, 0, 0], [1, 1, 1], [2, 2, 2]]}
  • CIRCLE: {"center": [0, 0, 0], "radius": 1.0}
  • CURVE: {"points": [[0, 0, 0], [1, 1, 1], [2, 2, 2]], "degree": 3}
  • BOX: {"width": 1.0, "length": 1.0, "height": 1.0}
  • SPHERE: {"radius": 1.0}
  • CONE: {"radius": 1.0, "height": 1.0, "cap": True}
  • CYLINDER: {"radius": 1.0, "height": 1.0, "cap": True}
  • SURFACE: {"count": (3, 3), "points": [[0, 0, 0], [1, 0, 0], [2, 0, 0], [0, 1, 0], [1, 1, 0], [2, 1, 0], [0, 2, 0], [1, 2, 0], [2, 2, 0]], "degree": (3, 3), "closed": (False, False)}

create_objects

Create multiple objects at once in the Rhino document.

Parameters:

  • objects: A list of dictionaries, each containing the parameters for a single object

Each object should have the following values:

  • type: Object type ("POINT", "LINE", "POLYLINE", "BOX", "SPHERE", etc.)
  • name: Optional name for the object
  • color: Optional [r, g, b] color values (0-255) for the object
  • params: Type-specific parameters dictionary (see documentation for each type in create_object() function)
  • translation: Optional [x, y, z] translation vector
  • rotation: Optional [x, y, z] rotation in radians
  • scale: Optional [x, y, z] scale factors

Returns: A message indicating the created objects.

Examples of params: [ { "type": "POINT", "name": "Point 1", "params": {"x": 0, "y": 0, "z": 0} }, { "type": "LINE", "name": "Line 1", "params": {"start": [0, 0, 0], "end": [1, 1, 1]} }, { "type": "POLYLINE", "name": "Polyline 1", "params": {"points": [[0, 0, 0], [1, 1, 1], [2, 2, 2]]} }, { "type": "CURVE", "name": "Curve 1", "params": {"points": [[0, 0, 0], [1, 1, 1], [2, 2, 2]], "degree": 3} }, { "type": "BOX", "name": "Box 1", "color": [255, 0, 0], "params": {"width": 1.0, "length": 1.0, "height": 1.0}, "translation": [0, 0, 0], "rotation": [0, 0, 0], "scale": [1, 1, 1] }, { "type": "SPHERE", "name": "Sphere 1", "color": [0, 255, 0], "params": {"radius": 1.0}, "translation": [0, 0, 0], "rotation": [0, 0, 0], "scale": [1, 1, 1] } ]

delete_object

Delete an object from the Rhino document.

Parameters:

  • id: The id of the object to delete
  • name: The name of the object to delete

get_document_info

Get detailed information about the current Rhino document

get_object_info

Get detailed information about a specific object in the Rhino document. The information contains the object's id, name, type, all custom user attributes and geometry info. You can either provide the id or the object_name of the object to get information about. If both are provided, the id will be used.

Returns:

  • A dictionary containing the object's information
  • The dictionary will have the following keys:
    • "id": The id of the object
    • "name": The name of the object
    • "type": The type of the object
    • "layer": The layer of the object
    • "material": The material of the object
    • "color": The color of the object
    • "bounding_box": The bounding box of the object
    • "geometry": The geometry info of the object
    • "attributes": A dictionary containing all custom user attributes of the object

Parameters:

  • id: The id of the object to get information about
  • name: The name of the object to get information about

get_selected_objects_info

Get detailed information about the currently selected objects in Rhino

Parameters:

  • include_attributes: Whether to include the custom user attributes of the objects in the response

modify_object

Modify an existing object in the Rhino document.

Parameters:

  • id: The id of the object to modify
  • name: The name of the object to modify
  • new_name: Optional new name for the object
  • new_color: Optional [r, g, b] color values (0-255) for the object
  • translation: Optional [x, y, z] translation vector
  • rotation: Optional [x, y, z] rotation in radians
  • scale: Optional [x, y, z] scale factors
  • visible: Optional boolean to set visibility

modify_objects

Create multiple objects at once in the Rhino document.

Parameters:

  • objects: A List of objects, each containing the parameters for a single object modification
  • all: Optional boolean to modify all objects, if true, only one object is required in the objects dictionary

Each object can have the following parameters:

  • id: The id of the object to modify
  • new_color: Optional [r, g, b] color values (0-255) for the object
  • translation: Optional [x, y, z] translation vector
  • rotation: Optional [x, y, z] rotation in radians
  • scale: Optional [x, y, z] scale factors
  • visible: Optional boolean to set visibility

Returns: A message indicating the modified objects.

execute_rhinoscript_python_code

Execute arbitrary RhinoScript code in Rhino.

Parameters:

  • code: The RhinoScript code to execute

GUIDE:

  1. To get any output from the script, you should use the python print function.
  2. You can get a list of all possible functions names that can be used by using the get_rhinoscript_python_function_names tool.
  3. You can get the details of a specific function by using the get_rhinoscript_python_code_guide tool.

Example:

  • Your task is: "Create a loft surface between two curves."
  • get_rhinoscript_python_function_names(["surface", "curve"])
  • This will return the function names that are necessary for creating the code.
  • get_rhinoscript_python_code_guide("AddLoftSrf")
  • This will return the syntax of the code that are necessary for creating the code.

Any changes made to the document will be undone if the script returns failure.

DO NOT HALLUCINATE, ONLY USE THE SYNTAX THAT IS SUPPORTED BY RHINO.GEOMETRY OR RHINOSCRIPT.

get_rhinoscript_python_function_names

Return the RhinoScriptsyntax Function Names for specified categories.

Parameters:

  • categories: A list of categories of the RhinoScriptsyntax to get.

Returns:

  • A list of function names that are available in the specified categories.

The following categories are available:

  • application
  • block
  • compat
  • curve
  • dimension
  • document
  • geometry
  • grips
  • group
  • hatch
  • layer
  • light
  • line
  • linetype
  • material
  • mesh
  • object
  • plane
  • pointvector
  • selection
  • surface
  • toolbar
  • transformation
  • userdata
  • userinterface
  • utility
  • view

get_rhinoscript_python_code_guide

Return the RhinoScriptsyntax Details for a specific function.

Parameters:

  • function_name: The name of the function to get the details for.

You should get the function names first by using the get_rhinoscript_python_function_names tool.

select_objects

Select objects in the Rhino document.

Parameters:

  • filters: A dictionary containing the filters. The filters parameter is necessary, unless it's empty, in which case all objects will be selected.
  • filters_type: The type of the filters, it's "and" or "or", default is "and"

Note: The filter value is always a list, even if it's a single value. The reason is that a filter can contain multiple values, for example when we query by a attribute that has EITHER value1 OR value2.

The filters dictionary can contain the following keys:

  • name: The name of the object
  • color: The color of the object, for example [255, 0, 0]

Additionaly, rhino allows to have user custom attributes, which can be used to filters the objects. For example, if the object has a user custom attribute called "category", the filters dictionary can contain:

  • category: custom_attribute_value

Example: filters = { "name": ["object_name1", "object_name2"], "category": ["custom_attribute_value"] }, filters_type = "or"

Returns: A number indicating the number of objects that have been selected.

create_layer

Create a new layer in the Rhino document.

Parameters:

  • name: The name of the new layer. If omitted, Rhino automatically generates the layer name.
  • color: Optional [r, g, b] color values (0-255) for the layer
  • parent: Optional name of the new layer's parent layer. If omitted, the new layer will not have a parent layer.

Returns: A message indicating the created layer name.

Examples of params:

  • name: "Layer 1"
  • color: [255, 0, 0]
  • parent: "Default"

get_or_set_current_layer

Get or set the current layer in the Rhino document. If name is provided, it will try to set the current layer to the layer with the given name. If guid is provided, it will try to set the current layer to the layer with the given guid. If neither is provided, it will return the current layer.

Parameters:

  • name: The name of the layer to set the current layer to.
  • guid: The guid of the layer to set the current layer to.

Returns: A message indicating the current layer.

Examples of params:

  • name: "Layer 1"
  • guid: "00000000-0000-0000-0000-000000000000"

delete_layer

Delete a layer in the Rhino document. If name is provided, it will try to delete the layer with the given name. If guid is provided, it will try to delete the layer with the given guid. If neither is provided, it will return an error.

Parameters:

  • name: The name of the layer to delete.
  • guid: The guid of the layer to delete.

Returns: A message indicating the layer was deleted.

Examples of params:

  • name: "Layer 1"
  • guid: "00000000-0000-0000-0000-000000000000"

Prompts

Interactive templates invoked by user choice

asset_general_strategy

Defines the preferred strategy for creating assets in Rhino

Resources

Contextual data attached and managed by the client

No resources