{"record":{"id":"623c313f7171ca8d","repo":"CoplayDev/unity-mcp","slug":"uvx-not-found-install-uv-uvx-or-set-the-override-623c31","errorCode":null,"errorMessage":"uvx not found. Install uv/uvx or set the override in Advanced Settings.","messagePattern":"uvx not found\\. Install uv/uvx or set the override in Advanced Settings\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"MCPForUnity/Editor/Clients/Configurators/OpenCodeConfigurator.cs","lineNumber":177,"sourceCode":"            return JsonConvert.SerializeObject(snippet, Formatting.Indented);\n        }\n\n        public override IList<string> GetInstallationSteps() => new List<string>\n        {\n            \"Install OpenCode (https://opencode.ai)\",\n            \"Click Configure to add Unity MCP to ~/.config/opencode/opencode.json\",\n            \"Restart OpenCode\",\n            \"The Unity MCP server should be detected automatically\"\n        };\n\n        private static JObject BuildServerEntry()\n        {\n            if (HttpEndpointUtility.GetCurrentServerTransport() == ConfiguredTransport.Stdio)\n            {\n                var (uvxPath, _, packageName) = AssetPathUtility.GetUvxCommandParts();\n                if (string.IsNullOrWhiteSpace(uvxPath))\n                {\n                    throw new InvalidOperationException(\"uvx not found. Install uv/uvx or set the override in Advanced Settings.\");\n                }\n\n                var command = new JArray { uvxPath };\n                foreach (string value in AssetPathUtility.GetUvxDevFlagsList())\n                {\n                    command.Add(value);\n                }\n                foreach (string value in AssetPathUtility.GetBetaServerFromArgsList())\n                {\n                    command.Add(value);\n                }\n                command.Add(packageName);\n                command.Add(\"--transport\");\n                command.Add(\"stdio\");\n\n                return new JObject\n                {\n                    [\"type\"] = LocalType,","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/CoplayDev/unity-mcp/blob/c21bf496bca87d54e75bad048563c3adb1782081/MCPForUnity/Editor/Clients/Configurators/OpenCodeConfigurator.cs#L159-L195","documentation":"OpenCodeConfigurator.BuildServerEntry() constructs the MCP server entry for ~/.config/opencode/opencode.json. When stdio transport is selected and GetUvxCommandParts() returns a null/whitespace uvx path, it throws because a valid command string cannot be produced. The root cause is identical to the OpenClaw case: PathResolverService.GetUvxPath() returns null only when an explicit override is invalid and no system uvx/uv binary is found.","triggerScenarios":"Transport is Stdio, the uvx path override is set but invalid, no system uvx/uv binary is discoverable, and Configure() or GetManualSnippet() calls BuildServerEntry().","commonSituations":"Fresh machine where uv was never installed. Override path from a different machine persisted in EditorPrefs. uv was installed via pip and later removed. The user manually edited EditorPrefs and introduced a bad path.","solutions":["Install uv (https://docs.astral.sh/uv/getting-started/installation/) so GetUvxPath() can discover it without an override.","Clear or fix the uvx path override in MCP for Unity > Advanced Settings.","Switch to HTTP transport in Advanced Settings to bypass the uvx dependency entirely.","After installing or fixing, restart Unity so EditorPrefs caches are re-read."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"string uvx = MCPServiceLocator.Paths.GetUvxPath();\nif (string.IsNullOrWhiteSpace(uvx))\n{ ShowUserError(\"Install uv/uvx or switch to HTTP transport.\"); return; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install uv system-wide before configuring OpenCode with stdio transport.","Clear stale uvx overrides when switching machines.","Prefer HTTP transport if uvx installation is not feasible."],"tags":["configuration","opencode","uvx","stdio","dependency"],"backgroundTag":null,"analyzedSha":"c21bf496bca87d54e75bad048563c3adb1782081","analyzedAt":"2026-08-13T17:36:56.095Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}