Summary
Under the file:com.coplaydev.unity-mcp/MCPForUnity submodule mount layout, AssetPathUtility.GetMcpPackageRootPath() returns a package root that is missing the MCPForUnity/ segment, so every Editor-window UXML load returns null. Both the main MCP window and the setup window become unusable, leaving the "Start Session" button unreachable.
Environment
- Unity 6000.3.16f1, macOS
- Reporter context: StickmanForge_IdleRPG consumer project, 2026-06-04
- Package mounted via manifest:
"com.coplaydev.unity-mcp": "file:com.coplaydev.unity-mcp/MCPForUnity"
- Repo checked out at
Packages/com.coplaydev.unity-mcp @ beta SHA 8a2b4267
Root cause
AssetPathUtility.GetMcpPackageRootPath() (MCPForUnity/Editor/Helpers/AssetPathUtility.cs:109) returns:
var packageInfo = PackageInfo.FindForAssembly(typeof(AssetPathUtility).Assembly);
if (packageInfo != null && !string.IsNullOrEmpty(packageInfo.assetPath))
{
return packageInfo.assetPath; // => "Packages/com.coplaydev.unity-mcp"
}
PackageInfo.assetPath here is Packages/com.coplaydev.unity-mcp, but in this submodule layout the assets actually resolve under Packages/com.coplaydev.unity-mcp/MCPForUnity/.... So every:
AssetDatabase.LoadAssetAtPath($"{basePath}/Editor/Windows/*.uxml", ...)
returns null. Note the existing script-path fallback (lines 121-141, derives the root by stripping at /Editor/) would yield the correct .../MCPForUnity root — but it is only reached when packageInfo.assetPath is empty, which it is not in this layout.
Symptoms (console)
MCP-FOR-UNITY: Failed to load UXML at: Packages/com.coplaydev.unity-mcp/Editor/Windows/MCPForUnityEditorWindow.uxml
MCP-FOR-UNITY: Failed to load UXML at: Packages/com.coplaydev.unity-mcp/Editor/Windows/MCPSetupWindow.uxml
Both the main window and the setup window are unusable -> the "Start Session" button is unreachable.
Knock-on effect
UseHttpTransport defaults to true (EditorConfigurationCache.cs:131). With the window broken, the stdio bridge never auto-starts, so external MCP servers report "No Unity Editor instances found."
Workaround used
A project-local [InitializeOnLoadMethod] calling McpCiBoot.StartStdioForCi() to force the stdio transport.
Suggested fix
In GetMcpPackageRootPath(), validate the PackageInfo path by probing a known asset (e.g. the window UXML) and fall back to the script-path derivation (which already yields the correct .../MCPForUnity root). Alternatively, prefer PackageInfo.resolvedPath-relative asset paths.
Summary
Under the
file:com.coplaydev.unity-mcp/MCPForUnitysubmodule mount layout,AssetPathUtility.GetMcpPackageRootPath()returns a package root that is missing theMCPForUnity/segment, so every Editor-window UXML load returns null. Both the main MCP window and the setup window become unusable, leaving the "Start Session" button unreachable.Environment
"com.coplaydev.unity-mcp": "file:com.coplaydev.unity-mcp/MCPForUnity"Packages/com.coplaydev.unity-mcp@betaSHA8a2b4267Root cause
AssetPathUtility.GetMcpPackageRootPath()(MCPForUnity/Editor/Helpers/AssetPathUtility.cs:109) returns:PackageInfo.assetPathhere isPackages/com.coplaydev.unity-mcp, but in this submodule layout the assets actually resolve underPackages/com.coplaydev.unity-mcp/MCPForUnity/.... So every:returns null. Note the existing script-path fallback (lines 121-141, derives the root by stripping at
/Editor/) would yield the correct.../MCPForUnityroot — but it is only reached whenpackageInfo.assetPathis empty, which it is not in this layout.Symptoms (console)
Both the main window and the setup window are unusable -> the "Start Session" button is unreachable.
Knock-on effect
UseHttpTransportdefaults totrue(EditorConfigurationCache.cs:131). With the window broken, the stdio bridge never auto-starts, so external MCP servers report "No Unity Editor instances found."Workaround used
A project-local
[InitializeOnLoadMethod]callingMcpCiBoot.StartStdioForCi()to force the stdio transport.Suggested fix
In
GetMcpPackageRootPath(), validate thePackageInfopath by probing a known asset (e.g. the window UXML) and fall back to the script-path derivation (which already yields the correct.../MCPForUnityroot). Alternatively, preferPackageInfo.resolvedPath-relative asset paths.