Skip to content

Add scene context resource and get_object_info tool#11

Open
mien-bot wants to merge 1 commit into
mcneel:mainfrom
mien-bot:add-scene-context-resource
Open

Add scene context resource and get_object_info tool#11
mien-bot wants to merge 1 commit into
mcneel:mainfrom
mien-bot:add-scene-context-resource

Conversation

@mien-bot

Copy link
Copy Markdown

Summary

  • Scene context resource (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_info tool: 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: InvokeAndWait for thread safety, System.Text.Json serialization, DI-injected RhinoDoc.

Test plan

  • Load plugin in Rhino 8, run RhinoMCP to start server
  • Verify scene_context resource appears in resource list and returns valid JSON
  • Create some objects, confirm resource reflects correct counts/layers/bbox
  • Call get_object_info with a valid GUID, verify metrics are returned
  • Call get_object_info with invalid GUID, verify error response

Note: Build-verified only — I don't have Rhino 8 to runtime test. Happy to iterate on feedback.

- 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.).
@mien-bot

Copy link
Copy Markdown
Author

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 get_object_info tool since list_objects gives the overview but there's no way to drill into a specific object's metrics.

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!

@clicky

clicky commented May 10, 2026

Copy link
Copy Markdown
Collaborator

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

@mien-bot

Copy link
Copy Markdown
Author

@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.

ktkt40208 pushed a commit to ktkt40208/RhinoMCP that referenced this pull request Jun 13, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants