{"record":{"id":"e0fd685eddcd822f","repo":"CoplayDev/unity-mcp","slug":"result","errorCode":null,"errorMessage":"{result}","messagePattern":"\\{result\\}","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"MCPForUnity/Editor/Clients/McpClientConfiguratorBase.cs","lineNumber":357,"sourceCode":"            return client.status;\n        }\n\n        public override void Configure()\n        {\n            // Always idempotent-write. The per-client UI button routes through Unregister\n            // when the user clicks while the client is already Configured; the bulk\n            // \"Configure All\" path calls this directly and expects an unconditional write.\n            string path = GetConfigPath();\n            McpConfigurationHelper.EnsureConfigDirectoryExists(path);\n            string result = McpConfigurationHelper.WriteMcpConfiguration(path, client);\n            if (result == \"Configured successfully\")\n            {\n                client.SetStatus(McpStatus.Configured);\n                client.configuredTransport = HttpEndpointUtility.GetCurrentServerTransport();\n            }\n            else\n            {\n                throw new InvalidOperationException(result);\n            }\n        }\n\n        public override string GetConfigureActionLabel()\n            => client.status == McpStatus.Configured ? \"Unregister\" : \"Configure\";\n\n        /// <summary>\n        /// Removes the unityMCP entry from the client's JSON config (VS Code-style\n        /// `servers` / `mcp.servers` layouts, the standard `mcpServers` layout, or a\n        /// client-specific container such as Kilo's `mcp`). Leaves the file in place so we\n        /// don't clobber other servers the user has configured.\n        /// </summary>\n        public override void Unregister()\n        {\n            string path = GetConfigPath();\n            try\n            {\n                if (!File.Exists(path))","sourceCodeStart":339,"sourceCodeEnd":375,"githubUrl":"https://github.com/CoplayDev/unity-mcp/blob/c21bf496bca87d54e75bad048563c3adb1782081/MCPForUnity/Editor/Clients/McpClientConfiguratorBase.cs#L339-L375","documentation":"JsonFileMcpConfigurator.Configure() calls McpConfigurationHelper.WriteMcpConfiguration(path, client). If the helper returns any string other than 'Configured successfully', Configure() throws InvalidOperationException with that string as the message. The two known non-success returns are 'uv package manager not found. Please install uv first.' (GetUvxPath returns null) and 'Skipped (locked)' (LOCK_CONFIG_KEY EditorPrefs is true).","triggerScenarios":"Clicking Configure on a JSON-file-based client (Claude Desktop, Cursor, Windsurf, etc.) when uv is not resolvable, or when the config lock EditorPref is enabled.","commonSituations":"uv/uvx not installed on a fresh machine. Config lock was enabled for troubleshooting and not turned off. The uvx override is invalid.","solutions":["Install uv (https://docs.astral.sh/uv/getting-started/installation/) — the most common trigger is 'uv package manager not found'.","Disable the config lock: set EditorPref LOCK_CONFIG_KEY to false, or use the MCP for Unity UI toggle.","If a uvx path override is set incorrectly, clear it in Advanced Settings.","Read the exception Message field — it contains the exact helper return string that identifies the root cause."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"string probe = MCPServiceLocator.Paths.GetUvxPath();\nif (probe == null)\n{ ShowError(\"uv not found. Install uv first.\"); return; }\nif (EditorPrefs.GetBool(LOCK_CONFIG_KEY, false))\n{ ShowError(\"Config is locked. Disable lock in settings.\"); return; }","typeGuard":null,"tryCatchPattern":"try { configurator.Configure(); }\ncatch (InvalidOperationException ex)\n{ Debug.LogError($\"Configuration failed: {ex.Message}\"); }","preventionTips":["Install uv before configuring any JSON-based MCP client.","Disable the config lock before clicking Configure.","Read the exception Message to distinguish uv-not-found from config-locked."],"tags":["configuration","json-config","uvx","config-lock","shared"],"backgroundTag":null,"analyzedSha":"c21bf496bca87d54e75bad048563c3adb1782081","analyzedAt":"2026-08-13T17:36:56.095Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}