{"record":{"id":"c391ea9ae4b6945f","repo":"different-ai/openwork","slug":"openwork-server-cannot-read-mcp-config-for-this-wo","errorCode":null,"errorMessage":"OpenWork server cannot read MCP config for this workspace.","messagePattern":"OpenWork server cannot read MCP config for this workspace\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"apps/app/src/react-app/domains/connections/store.ts","lineNumber":362,"sourceCode":"\n  const listMcpFromOpenworkServer = async (projectDir: string) => {\n    const openworkSnapshot = getOpenworkSnapshot();\n    const { openworkClient, openworkWorkspaceId, hasOpenworkTarget, canUseOpenworkServer } =\n      await resolveMcpOpenworkTarget(\"read\");\n    const canTryOpenworkServer = canUseOpenworkServer;\n\n    recordPerfLog(options.developerMode(), \"mcp.refresh\", \"server-path-check\", {\n      workspaceType: options.workspaceType(),\n      projectDir: projectDir || null,\n      openworkStatus: openworkSnapshot.openworkServerStatus,\n      hasOpenworkClient: Boolean(openworkClient),\n      openworkWorkspaceId: openworkWorkspaceId ?? null,\n      canReadMcp: openworkSnapshot.openworkServerCapabilities?.mcp?.read ?? null,\n      canTryOpenworkServer,\n    });\n\n    if (hasOpenworkTarget && !canTryOpenworkServer) {\n      throw new Error(\"OpenWork server cannot read MCP config for this workspace.\");\n    }\n\n    if (!canTryOpenworkServer || !openworkClient || !openworkWorkspaceId) return null;\n\n    const response = await openworkClient.listMcp(openworkWorkspaceId);\n    const next = response.items.map((entry) => ({\n      name: entry.name,\n      config: entry.config as McpServerEntry[\"config\"],\n      source: entry.source,\n      managedOAuth: entry.managedOAuth,\n    }));\n    const engineSync = response.engineSync ?? null;\n\n    let nextStatuses: McpStatusMap = {};\n    const activeClient = options.client();\n    if (activeClient && projectDir) {\n      try {\n        const status = unwrap(await activeClient.mcp.status({ directory: projectDir }));","sourceCodeStart":344,"sourceCodeEnd":380,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/apps/app/src/react-app/domains/connections/store.ts#L344-L380","documentation":"listMcpFromOpenworkServer throws 'OpenWork server cannot read MCP config for this workspace.' when an OpenWork server target exists (hasOpenworkTarget) but canTryOpenworkServer is false — meaning the workspace snapshot's server capabilities report that MCP read is not available (canReadMcp is false/null). The function refuses to attempt an RPC the server said it cannot serve.","triggerScenarios":"Calling listMcpFromOpenworkServer with an openworkWorkspaceId set while openworkSnapshot.openworkServerCapabilities.mcp.read is false (or absent) — the connected OpenWork server does not advertise MCP read capability for that workspace.","commonSituations":"Pointing the app at an older OpenWork server without MCP read support; a self-hosted server deployed without MCP features; stale capability snapshot after a server upgrade; wrong workspace id whose capabilities lack the mcp.read flag.","solutions":["Upgrade the OpenWork server to a version that supports MCP config read","Verify openworkServerCapabilities.mcp.read is true for the workspace (fix server config/workspace setup)","Refresh the capability snapshot after upgrading/restarting the server","If no server read is intended, don't set the OpenWork target/workspace so the function returns null gracefully"],"exampleFix":"// before\nconst items = await listMcpFromOpenworkServer(client, workspaceId, snapshot);\n// after\nconst canRead = snapshot.openworkServerCapabilities?.mcp?.read ?? false;\nif (!canRead) {\n  console.warn(\"Server cannot read MCP config; using local MCP config instead.\");\n  items = localMcpFallback();\n} else {\n  items = await listMcpFromOpenworkServer(client, workspaceId, snapshot);\n}","handlingStrategy":"try-catch","validationCode":"const canRead = snapshot.openworkServerCapabilities?.mcp?.read ?? false;\nif (hasOpenworkTarget && !canRead) {\n  console.warn(\"Server cannot read MCP config; skipping server listing.\");\n  return;\n}","typeGuard":"function serverCanReadMcp(s: OpenworkSnapshot | null): boolean {\n  return s?.openworkServerCapabilities?.mcp?.read === true;\n}","tryCatchPattern":"try {\n  items = await listMcpFromOpenworkServer(...);\n} catch (err) {\n  if (err.message.includes(\"cannot read MCP config\")) {\n    items = await listMcpLocally(); // fallback to local config\n  } else throw err;\n}","preventionTips":["Check openworkServerCapabilities.mcp.read before calling server MCP listing","Keep the OpenWork server upgraded to a version with MCP read support","Refresh capability snapshots after server restarts/upgrades","Provide a local-config fallback so MCP features degrade gracefully"],"tags":["mcp","server-capability","workspace","version"],"backgroundTag":"unsupported-server-capability","analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}