CoplayDev/unity-mcp · error · ArgumentException

The selected uvx executable does not exist

Error message

The selected uvx executable does not exist

What it means

Thrown by PathResolverService.SetUvxPathOverride when the given path does not exist as a file (File.Exists is false). uvx (the uv tool runner) must be a real executable on disk before it is stored as the override in EditorPrefs. An empty path is treated as 'clear override' and does not throw; only a non-empty, non-existent path throws.

Source

Thrown at MCPForUnity/Editor/Services/PathResolverService.cs:142

                2000);
        }

        public bool IsClaudeCliDetected()
        {
            return !string.IsNullOrEmpty(GetClaudeCliPath());
        }

        public void SetUvxPathOverride(string path)
        {
            if (string.IsNullOrEmpty(path))
            {
                ClearUvxPathOverride();
                return;
            }

            if (!File.Exists(path))
            {
                throw new ArgumentException("The selected uvx executable does not exist");
            }

            EditorPrefs.SetString(EditorPrefKeys.UvxPathOverride, path);
        }

        public void SetClaudeCliPathOverride(string path)
        {
            if (string.IsNullOrEmpty(path))
            {
                ClearClaudeCliPathOverride();
                return;
            }

            if (!File.Exists(path))
            {
                throw new ArgumentException("The selected Claude CLI executable does not exist");
            }

View on GitHub (pinned to c21bf496bc)

Solutions

  1. Locate the real uvx/uv executable (run 'which uvx' on macOS/Linux or 'where uvx' on Windows).
  2. On Windows pass the full path including .exe (e.g. C:\Users\you\.local\bin\uvx.exe).
  3. If unsure, clear the override (pass empty) and let auto-detection find uvx on PATH.

Example fix

// before
resolver.SetUvxPathOverride(typedPath); // throws if file missing

// after
if (!string.IsNullOrEmpty(typedPath) && File.Exists(typedPath))
    resolver.SetUvxPathOverride(typedPath);
else
    resolver.ClearUvxPathOverride(); // fall back to auto-detection
Defensive patterns

Strategy: validation

Validate before calling

if (string.IsNullOrEmpty(path)) { resolver.ClearUvxPathOverride(); return; }
if (!File.Exists(path)) return ErrorResponse($"uvx executable not found: {path}");
resolver.SetUvxPathOverride(path);

Type guard

static bool IsExistingExecutable(string p) => !string.IsNullOrEmpty(p) && File.Exists(p);

Try / catch

try { resolver.SetUvxPathOverride(path); }
catch (ArgumentException ex) when (ex.Message.Contains("uvx"))
{ /* locate the real uvx/uv binary; or clear override to use auto-detection */ }

Prevention

When it happens

Trigger: User picked a uvx path that is a directory, a stale shortcut, or a typo; the uv install was moved/uninstalled after selection; a bare command name ('uvx') passed instead of a full path.

Common situations: uv installed via a method that moved/removed the binary; Windows path without .exe; user typed a name instead of browsing; PATH changed since selection.

Related errors


AI-assisted analysis of CoplayDev/unity-mcp@c21bf496bc (2026-08-13). Data as JSON: /api/errors/a53279f0fa4ed0cb. Report an issue: GitHub.