{"record":{"id":"2b9900ec1cc3eb9b","repo":"different-ai/openwork","slug":"mcp-config-load-failed","errorCode":"mcp.config_load_failed","errorMessage":"t(\"mcp.config_load_failed\")","messagePattern":"t\\(\"mcp\\.config_load_failed\"\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"apps/app/src/react-app/domains/settings/pages/mcp-view.tsx","lineNumber":952,"sourceCode":"    if (!isDesktopRuntime() || revealBusy) return;\n    const root = props.selectedWorkspaceRoot.trim();\n\n    if (configScope === \"project\" && !root) {\n      setConfigError(t(\"mcp.pick_workspace_error\"));\n      return;\n    }\n\n    setRevealBusy(true);\n    setConfigError(null);\n    try {\n      const resolved = props.readConfigFile\n        ? await props.readConfigFile(configScope)\n        : !props.isRemoteWorkspace\n        ? await readOpencodeConfig(configScope, root)\n        : null;\n      const configFile = resolved as OpencodeConfigFile | null;\n      if (!configFile) {\n        throw new Error(t(\"mcp.config_load_failed\"));\n      }\n      if (isWindowsPlatform()) {\n        await openDesktopPath(configFile.path);\n      } else {\n        await revealDesktopItemInDir(configFile.path);\n      }\n    } catch (error) {\n      setConfigError(\n        error instanceof Error ? error.message : t(\"mcp.reveal_config_failed\"),\n      );\n    } finally {\n      setRevealBusy(false);\n    }\n  };\n\n  const detailPanels = (\n    <>\n      {detailEntry ? (() => {","sourceCodeStart":934,"sourceCodeEnd":970,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/apps/app/src/react-app/domains/settings/pages/mcp-view.tsx#L934-L970","documentation":"The \"reveal MCP config file\" action resolves the config file path either via props.readConfigFile or by reading the local opencode config. If resolution yields null (no config file could be located or read for the given scope), it throws the localized \"mcp.config_load_failed\" instead of attempting to open a nonexistent path.","triggerScenarios":"Clicking to open/reveal the MCP config file when no opencode config file exists for the scope, the file read fails, or a remote workspace has no local config to read.","commonSituations":"Fresh install with no opencode.json yet; remote workspace where reveal is not supported; scope pointing at a missing project config; filesystem permission errors.","solutions":["Create an opencode config file (e.g. opencode.json) for the scope, then retry","Check the scope is correct (project vs. global) and the file exists on disk","Verify read permissions on the config directory"],"exampleFix":"// before\nawait readOpencodeConfig(scope, root); // null if missing\n// after\nawait writeFile(configPath, \"{}\\n\");\nawait readOpencodeConfig(scope, root);","handlingStrategy":"try-catch","validationCode":"const resolved = scope ? await props.readConfigFile(scope) : await readOpencodeConfig(scope, root);\nif (!resolved) {\n  showToast(t(\"mcp.config_load_failed\"));\n  return;\n}","typeGuard":"const isConfigFile = (f: unknown): f is OpencodeConfigFile =>\n  f != null && typeof (f as OpencodeConfigFile).path === \"string\";","tryCatchPattern":"try {\n  await openConfigFile(configScope);\n} catch (e) {\n  if ((e as Error).message.includes(\"config_load_failed\")) showCreateConfigHint();\n  else throw e;\n}","preventionTips":["Create the opencode config file before using reveal actions","Check file existence with fs access before resolving","Pick the correct scope (project vs global)"],"tags":["mcp","config-file","file-not-found"],"backgroundTag":"missing-config-file","analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}