different-ai/openwork · error

OpenWork server cannot read MCP config for this workspace.

Error message

OpenWork server cannot read MCP config for this workspace.

What it means

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.

Source

Thrown at apps/app/src/react-app/domains/connections/store.ts:362

  const listMcpFromOpenworkServer = async (projectDir: string) => {
    const openworkSnapshot = getOpenworkSnapshot();
    const { openworkClient, openworkWorkspaceId, hasOpenworkTarget, canUseOpenworkServer } =
      await resolveMcpOpenworkTarget("read");
    const canTryOpenworkServer = canUseOpenworkServer;

    recordPerfLog(options.developerMode(), "mcp.refresh", "server-path-check", {
      workspaceType: options.workspaceType(),
      projectDir: projectDir || null,
      openworkStatus: openworkSnapshot.openworkServerStatus,
      hasOpenworkClient: Boolean(openworkClient),
      openworkWorkspaceId: openworkWorkspaceId ?? null,
      canReadMcp: openworkSnapshot.openworkServerCapabilities?.mcp?.read ?? null,
      canTryOpenworkServer,
    });

    if (hasOpenworkTarget && !canTryOpenworkServer) {
      throw new Error("OpenWork server cannot read MCP config for this workspace.");
    }

    if (!canTryOpenworkServer || !openworkClient || !openworkWorkspaceId) return null;

    const response = await openworkClient.listMcp(openworkWorkspaceId);
    const next = response.items.map((entry) => ({
      name: entry.name,
      config: entry.config as McpServerEntry["config"],
      source: entry.source,
      managedOAuth: entry.managedOAuth,
    }));
    const engineSync = response.engineSync ?? null;

    let nextStatuses: McpStatusMap = {};
    const activeClient = options.client();
    if (activeClient && projectDir) {
      try {
        const status = unwrap(await activeClient.mcp.status({ directory: projectDir }));

View on GitHub (pinned to 2b7df46e8a)

Solutions

  1. Upgrade the OpenWork server to a version that supports MCP config read
  2. Verify openworkServerCapabilities.mcp.read is true for the workspace (fix server config/workspace setup)
  3. Refresh the capability snapshot after upgrading/restarting the server
  4. If no server read is intended, don't set the OpenWork target/workspace so the function returns null gracefully

Example fix

// before
const items = await listMcpFromOpenworkServer(client, workspaceId, snapshot);
// after
const canRead = snapshot.openworkServerCapabilities?.mcp?.read ?? false;
if (!canRead) {
  console.warn("Server cannot read MCP config; using local MCP config instead.");
  items = localMcpFallback();
} else {
  items = await listMcpFromOpenworkServer(client, workspaceId, snapshot);
}
Defensive patterns

Strategy: try-catch

Validate before calling

const canRead = snapshot.openworkServerCapabilities?.mcp?.read ?? false;
if (hasOpenworkTarget && !canRead) {
  console.warn("Server cannot read MCP config; skipping server listing.");
  return;
}

Type guard

function serverCanReadMcp(s: OpenworkSnapshot | null): boolean {
  return s?.openworkServerCapabilities?.mcp?.read === true;
}

Try / catch

try {
  items = await listMcpFromOpenworkServer(...);
} catch (err) {
  if (err.message.includes("cannot read MCP config")) {
    items = await listMcpLocally(); // fallback to local config
  } else throw err;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of different-ai/openwork@2b7df46e8a (2026-09-01). Data as JSON: /api/errors/c391ea9ae4b6945f. Report an issue: GitHub.