{"record":{"id":"8db10b5b39800864","repo":"different-ai/openwork","slug":"openwork-managed-oauth-requires-a-remote-mcp-url","errorCode":null,"errorMessage":"OpenWork-managed OAuth requires a remote MCP URL.","messagePattern":"OpenWork-managed OAuth requires a remote MCP URL\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"apps/app/src/react-app/domains/connections/store.ts","lineNumber":802,"sourceCode":"          orgSelected: Boolean(context.orgId.trim()),\n          connecting: false,\n          health: result.health,\n        });\n        setStateField(\"mcpStatus\", `${summary.stageLabel}. ${summary.recommendedAction}`);\n        finishPerf(options.developerMode(), \"mcp.connect\", \"error\", startedAt, {\n          name: entry.name,\n          type: entryType,\n          error: summary.stageLabel,\n        });\n        return { ok: false, error: `${summary.stageLabel}. ${summary.recommendedAction}` };\n      }\n\n      if (entry.managedOAuth) {\n        if (isRemoteWorkspace || !isDesktopRuntime()) {\n          throw new Error(\"OpenWork-managed MCP OAuth is currently available for local desktop workspaces only.\");\n        }\n        if (entryType !== \"remote\" || !entry.url) {\n          throw new Error(\"OpenWork-managed OAuth requires a remote MCP URL.\");\n        }\n        if (!canUseOpenworkServer || !openworkClient || !openworkWorkspaceId) {\n          throw new Error(\"The local OpenWork server is required for managed MCP sign-in.\");\n        }\n        const result = await openworkClient.addManagedMcp(openworkWorkspaceId, {\n          name: slug,\n          url: entry.url,\n          oauth: {\n            applicationType: \"native\",\n            requestedScopes: entry.oauthConfig?.scope?.split(/\\s+/).filter(Boolean),\n            clientId: entry.oauthConfig?.clientId,\n            clientSecret: entry.oauthConfig?.clientSecret,\n          },\n        });\n        const connected = await waitForManagedMcpAuthorization(\n          openworkClient,\n          openworkWorkspaceId,\n          slug,","sourceCodeStart":784,"sourceCodeEnd":820,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/apps/app/src/react-app/domains/connections/store.ts#L784-L820","documentation":"Within the managedOAuth path (after the runtime check), the entry must be of type 'remote' and carry a URL, because managed OAuth is performed against a remote MCP endpoint. If entryType is not 'remote' or entry.url is missing, the store throws 'OpenWork-managed OAuth requires a remote MCP URL.'","triggerScenarios":"Calling connect on a managedOAuth entry whose entryType is 'local'/'stdio' (no remote endpoint) or whose url field is empty/missing in the persisted config.","commonSituations":"A config entry created as a stdio/local MCP server incorrectly flagged managedOAuth; a partially synced entry where the URL field was dropped; hand-edited MCP config missing the url key.","solutions":["Set entryType to 'remote' and provide a valid entry.url for the managed OAuth entry","Remove the managedOAuth flag from local/stdio entries that cannot support it","Re-add/re-sync the MCP entry so the URL metadata is restored","Validate the entry shape before passing it to the connect action"],"exampleFix":"// before\n{ \"name\": \"acme\", \"type\": \"stdio\", \"managedOAuth\": true }\n// after\n{ \"name\": \"acme\", \"type\": \"remote\", \"url\": \"https://mcp.acme.com/sse\", \"managedOAuth\": true }","handlingStrategy":"validation","validationCode":"if (entry.managedOAuth && (entry.type !== \"remote\" || !entry.url)) {\n  showValidationMessage(\"Managed OAuth entries must be remote with a URL.\");\n  return;\n}","typeGuard":"function isManagedRemoteEntry(e: McpEntry): e is McpEntry & { type: \"remote\"; url: string } {\n  return e.managedOAuth === true && e.type === \"remote\" && typeof e.url === \"string\" && e.url.length > 0;\n}","tryCatchPattern":null,"preventionTips":["Validate managed OAuth entries (remote type + URL) on config load","Never set managedOAuth on stdio/local MCP entries","Re-sync or re-add entries whose url field is missing after a failed sync","Schema-validate persisted MCP config with Zod before handing entries to the store"],"tags":["oauth","mcp","url","validation"],"backgroundTag":"missing-mcp-url","analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}