CoplayDev/unity-mcp · error · InvalidOperationException

uvx not found. Install uv/uvx or set the override in Advance

Error message

uvx not found. Install uv/uvx or set the override in Advanced Settings.

What it means

OpenClawConfigurator.BuildUnityServerEntry() builds the stdio server block for OpenClaw. When ConfiguredTransport.Stdio is active, it calls AssetPathUtility.GetUvxCommandParts() which delegates to PathResolverService.GetUvxPath(). If that returns null/whitespace, the method cannot construct a valid command string and throws. GetUvxPath() returns null only when an explicit uvx path override is set in Advanced Settings but is invalid AND no system-level uvx/uv binary is discoverable.

Source

Thrown at MCPForUnity/Editor/Clients/Configurators/OpenClawConfigurator.cs:280

                {
                    continue;
                }

                normalized[name] = legacyServer;
            }

            return normalized;
        }

        private static JObject BuildUnityServerEntry()
        {
            ConfiguredTransport transport = HttpEndpointUtility.GetCurrentServerTransport();
            if (transport == ConfiguredTransport.Stdio)
            {
                var (uvxPath, _, packageName) = AssetPathUtility.GetUvxCommandParts();
                if (string.IsNullOrWhiteSpace(uvxPath))
                {
                    throw new InvalidOperationException("uvx not found. Install uv/uvx or set the override in Advanced Settings.");
                }

                var args = new JArray();
                foreach (string value in AssetPathUtility.GetUvxDevFlagsList())
                {
                    args.Add(value);
                }
                foreach (string value in AssetPathUtility.GetBetaServerFromArgsList())
                {
                    args.Add(value);
                }
                args.Add(packageName);
                args.Add("--transport");
                args.Add("stdio");

                return new JObject
                {
                    ["enabled"] = true,

View on GitHub (pinned to c21bf496bc)

Solutions

  1. Install uv: run `curl -LsSf https://astral.sh/uv/install.sh | sh` (macOS/Linux) or `powershell -c "irm https://astral.sh/uv/install.ps1 | iex"` (Windows).
  2. Clear the stale uvx path override: MCP for Unity > Advanced Settings > remove the Uvx Path Override field, or set it to the correct binary path.
  3. Switch transport to HTTP in Advanced Settings so uvx is not required.
  4. Verify the binary location with `which uvx` (macOS/Linux) or `where uvx` (Windows) and set the override to that path.
Defensive patterns

Strategy: validation

Validate before calling

string uvx = MCPServiceLocator.Paths.GetUvxPath();
if (string.IsNullOrWhiteSpace(uvx))
{ ShowUserError("Install uv/uvx or switch to HTTP transport."); return; }

Prevention

When it happens

Trigger: Transport is set to Stdio in Advanced Settings, GetUvxPath() returns null (invalid override + no system fallback), and the user clicks Configure for OpenClaw or CheckStatus triggers an auto-rewrite.

Common situations: The user set a uvx path override that points to a moved/deleted binary. uv/uvx was uninstalled or never installed and the override points to a stale path. The user switched machines and the override path from the previous machine persists in EditorPrefs.

Related errors


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