CoplayDev/unity-mcp

Improve LLMs with Resources

Opened this issue · 1 comments

MCP spec: https://modelcontextprotocol.io/specification/2025-06-18/server/resources
FastMCP documentation: https://gofastmcp.com/servers/resources

There are some major benefits for converting read-only tool calls into resources:

  • Better performance as there are less tools in the context
  • Better UX as users can select resources relevant to the context
  • LLMs can discover resources on their own w/o having to make a tool call, so potentially faster
  • Good MCP hosts cache the resources, so it's faster
  • Actually follows the protocol

This seems like the ideal way to encode data for models. Here are some things we should add:

  • Scene hierarchy, we should make a compact representation of the game objects in a scene for the models
  • Serialized game objects. Right now we do searching and the like, but we should get a game object with instance ID or path as a resource
  • Logs, instead of a tool call it could be a resource as well
  • Packages
  • Menu items (I recently made this a tool call, it should be a resource)
  • EditorPrefs
  • Tests
  • Editor state (read only items in manage_editor)
  • Tags
  • Layers

What else could be added?

Will definitely make a more optimised resource for the scene hierarchy, game objects and components: see #317