Skip to content

list_resources and read_resource require explicit project_root parameterΒ #384

@jrep41

Description

@jrep41

Description

The list_resources and read_resource tools require the project_root parameter to be explicitly specified, even when Unity Editor is open and connected. Without it, they only return unity://spec/script-edits.

Steps to Reproduce

  1. Open Unity Editor with a project (e.g., E:\Unity_projects\con_mcp)
  2. Ensure MCP is connected (verify with manage_scene action get_active - this works)
  3. Call list_resources without project_root:
   {
     "pattern": "*.cs",
     "under": "Assets"
   }
  1. Observe that it only returns ["unity://spec/script-edits"]

Expected Behavior

When Unity Editor is open and MCP is connected, list_resources and read_resource should automatically detect the project root from the active Unity instance.

Actual Behavior

These tools require explicit project_root parameter:

{
  "pattern": "*.cs",
  "project_root": "E:\\Unity_projects\\con_mcp",
  "under": "Assets"
}

Only then do they return the actual scripts in the project.

Environment

  • OS: Windows
  • Unity Version: 6.0 (6000.0.51f1)
  • MCP Package: com.coplaydev.unity-mcp@030896ead96d
  • Python: 3.14
  • MCP Client: Claude Desktop

Additional Context

Other MCP tools like manage_scene, manage_script, and manage_gameobject work correctly without requiring project_root, which suggests the issue is specific to the resource listing/reading functionality.

The debug_request_context shows active_instance: null, which might be related to this issue.

Suggested Fix

The MCP server should automatically determine the project root from the connected Unity instance, similar to how other tools operate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions