Add scene context resource and get_object_info tool#11
Conversation
- Scene context resource (rhino://scene-context): exposes document state (units, tolerances, layer tree, object summary, bounding box) as a read-only MCP resource. Single-pass iteration for performance. Wrapped in InvokeAndWait for thread safety. - get_object_info tool: returns detailed info for a single object by GUID including bounding box, layer, visibility, and type-specific metrics (area/volume for breps, vertex/face count for meshes, length/degree for curves, etc.).
|
Hey! I've been building an MCP integration for Rhino on my own project and noticed this repo doesn't have any MCP resources yet. Thought a scene context resource would be a natural first one — agents really benefit from knowing document state (units, layers, what's in the scene) before they start creating geometry. Also added a I only have Rhino 7 so I couldn't runtime test, but everything compiles clean and follows the existing patterns. Let me know if you'd like any changes! |
|
Hey @mien-bot do you publish your MCP integration on GitHub or elsewhere? I'd be curious to take a look. I'm still learning and reading about Resources but am trying to see what claude naturally reaches for when creating things |
|
@clicky Yeah! I created my own rhino mcp plugin in a private repo, but the plugin is called Aurox which his similar MCP features. I was focusing on making it as easy as possible for users to install MCP functionality either through the Claude desktop app, CLI mode, or API integration. I just thought I'd contribute a bit, since with get context claude would have a better understanding of what's in the scene and what scale and the units of the objects. |
Wave-1 port (jingcheng get_object_info + mien-bot PR mcneel#11 design). Single additive [McpServerTool]: object detail by GUID — name, type, layer, visibility/lock, display color, world bbox, attribute user-strings, and type-specific metrics (curve length/degree/closed; brep & extrusion area/volume/solid/face-count; mesh vertex/face; surface area). Verified the full plugin+router(NativeAOT) build on macOS arm64 with SDK 8.0.422 and that the router source generator proxies it with a populated description. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Summary
rhino://scene-context): Exposes current document state (units, tolerances, layer tree with object counts, type breakdown, and scene bounding box) as a read-only MCP resource. Gives AI agents the context they need before creating or modifying geometry.get_object_infotool: Returns detailed information for a single object by GUID — bounding box, layer, visibility, and type-specific metrics (area/volume for breps, vertex/face count for meshes, length/degree for curves).Both follow existing patterns:
InvokeAndWaitfor thread safety,System.Text.Jsonserialization, DI-injectedRhinoDoc.Test plan
RhinoMCPto start serverscene_contextresource appears in resource list and returns valid JSONget_object_infowith a valid GUID, verify metrics are returnedget_object_infowith invalid GUID, verify error response