Skip to content

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

@XY01

Description

@XY01

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions