mcp-unity icon indicating copy to clipboard operation
mcp-unity copied to clipboard

Linux Editor unsupported in GetClaudeCodeConfigPath — auto-configure fails on LinuxEditor

Open XY01 opened this issue 8 months ago • 2 comments

Bug

The Configure button for Claude Code in Tools > MCP Unity > Server Window throws an error on Linux:

Unsupported platform for Claude configuration path resolution
UnityEngine.Debug:LogError (object)
McpUnity.Utils.McpUtils:GetClaudeCodeConfigPath () (at ./Packages/com.gamelovers.mcp-unity/Editor/Utils/McpUtils.cs:405)
McpUnity.Utils.McpUtils:AddToClaudeCodeConfig (bool) (at ./Packages/com.gamelovers.mcp-unity/Editor/Utils/McpUtils.cs:211)

Root Cause

GetClaudeCodeConfigPath() in McpUtils.cs around line 388 only handles WindowsEditor and OSXEditor, falling through to an error for LinuxEditor:

if (Application.platform == RuntimePlatform.WindowsEditor)
{
    homeDir = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
}
else if (Application.platform == RuntimePlatform.OSXEditor)
{
    homeDir = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
}
else
{
    Debug.LogError("Unsupported platform for Claude configuration path resolution");
    return null;
}

Fix

Add LinuxEditor alongside OSXEditor — both use $HOME/.claude.json:

else if (Application.platform == RuntimePlatform.OSXEditor
      || Application.platform == RuntimePlatform.LinuxEditor)
{
    homeDir = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
}

The same fix likely applies to other config path methods in McpUtils.cs that have an identical Windows/macOS pattern (e.g. GetAntigravityConfigPath, GetWindsurfConfigPath, etc.).

Environment

  • OS: Linux (Ubuntu, Unity Editor LinuxEditor)
  • mcp-unity: v1.2.0
  • Unity: 6 (6000.x)

XY01 avatar Mar 23 '26 11:03 XY01

Thank you for the very well detailed bug report @XY01

I fixed the issue. Let me know if you continue to have issues

CoderGamester avatar Mar 31 '26 13:03 CoderGamester

Legend, thanks, worked around it but will defs make it easier to setup others

XY01 avatar Apr 14 '26 10:04 XY01