-
Notifications
You must be signed in to change notification settings - Fork 526
Description
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
- Open Unity Editor with a project (e.g.,
E:\Unity_projects\con_mcp) - Ensure MCP is connected (verify with
manage_sceneactionget_active- this works) - Call
list_resourceswithoutproject_root:
{
"pattern": "*.cs",
"under": "Assets"
}- 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.