different-ai/openwork · error

OpenWork-managed MCP OAuth is currently available for local

Error message

OpenWork-managed MCP OAuth is currently available for local desktop workspaces only.

What it means

For entries with managedOAuth, the connect action only proceeds when the workspace is local (not remote) and the runtime is the desktop app. Otherwise it throws 'OpenWork-managed MCP OAuth is currently available for local desktop workspaces only.' Managed OAuth performs a desktop-browser OAuth dance mediated by the local OpenWork server, which remote/web runtimes cannot do.

Source

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

        }
        const summary = cloudMcpDisplaySummary({
          signedIn: Boolean(context.denAuthToken?.trim()),
          orgSelected: Boolean(context.orgId.trim()),
          connecting: false,
          health: result.health,
        });
        setStateField("mcpStatus", `${summary.stageLabel}. ${summary.recommendedAction}`);
        finishPerf(options.developerMode(), "mcp.connect", "error", startedAt, {
          name: entry.name,
          type: entryType,
          error: summary.stageLabel,
        });
        return { ok: false, error: `${summary.stageLabel}. ${summary.recommendedAction}` };
      }

      if (entry.managedOAuth) {
        if (isRemoteWorkspace || !isDesktopRuntime()) {
          throw new Error("OpenWork-managed MCP OAuth is currently available for local desktop workspaces only.");
        }
        if (entryType !== "remote" || !entry.url) {
          throw new Error("OpenWork-managed OAuth requires a remote MCP URL.");
        }
        if (!canUseOpenworkServer || !openworkClient || !openworkWorkspaceId) {
          throw new Error("The local OpenWork server is required for managed MCP sign-in.");
        }
        const result = await openworkClient.addManagedMcp(openworkWorkspaceId, {
          name: slug,
          url: entry.url,
          oauth: {
            applicationType: "native",
            requestedScopes: entry.oauthConfig?.scope?.split(/\s+/).filter(Boolean),
            clientId: entry.oauthConfig?.clientId,
            clientSecret: entry.oauthConfig?.clientSecret,
          },
        });
        const connected = await waitForManagedMcpAuthorization(

View on GitHub (pinned to 2b7df46e8a)

Solutions

  1. Use the OpenWork desktop app on a local workspace for managed OAuth sign-in
  2. Move the work to a local (non-remote) workspace before connecting the managed service
  3. For remote/headless environments, connect the service via API keys instead of managed OAuth
  4. If this is a legitimate desktop+local case, verify isDesktopRuntime() detection isn't misfiring

Example fix

// before
await connect(entry); // managedOAuth entry, running in headless web
// after
if (entry.managedOAuth && (!isDesktopRuntime() || isRemoteWorkspace)) {
  throwIfNoKeyFallback(entry); // or instruct: open the desktop app
} else {
  await connect(entry);
}
Defensive patterns

Strategy: validation

Validate before calling

if (entry.managedOAuth && (!isDesktopRuntime() || isRemoteWorkspace)) {
  showNotice("Managed OAuth requires the OpenWork desktop app on a local workspace.");
  return;
}

Type guard

function supportsManagedOAuth(e: McpEntry, runtime: { isDesktop: boolean; isRemote: boolean }): boolean {
  return !e.managedOAuth || (runtime.isDesktop && !runtime.isRemote);
}

Try / catch

try {
  await connectionsStore.connect(entry);
} catch (err) {
  if (err.message.includes("local desktop workspaces only")) {
    offerApiKeyFallback(entry); // or deep-link to desktop app
  } else throw err;
}

Prevention

When it happens

Trigger: Calling connect on an entry with managedOAuth from a remote workspace (isRemoteWorkspace true) or from a non-desktop runtime (isDesktopRuntime() false), e.g. headless web UI or CI.

Common situations: Trying to connect an OAuth-managed service from the headless web dev environment; connecting from a cloud/remote workspace; running the app in a browser tab instead of the Electron desktop app.

Related errors


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