{"record":{"id":"edb0553f0b6708b9","repo":"nexu-io/open-design","slug":"auth-server-authserver-issuer-does-not-advertis","errorCode":null,"errorMessage":"auth server ${authServer.issuer} does not advertise a registration_endpoint and no client is pre-registered","messagePattern":"auth server (.+?) does not advertise a registration_endpoint and no client is pre-registered","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/daemon/src/mcp-oauth.ts","lineNumber":299,"sourceCode":"\n/**\n * Cached version of `registerClient`. Looks up `(authServerIssuer, redirectUri)`\n * in the cache file and re-uses the existing client; falls back to a fresh\n * DCR call when nothing is cached.\n */\nexport async function getOrRegisterClient(\n  dataDir: string,\n  authServer: AuthorizationServerMetadata,\n  redirectUri: string,\n  fetchImpl: typeof fetch = fetch,\n): Promise<RegisteredClient> {\n  const cache = await readClientCache(dataDir);\n  const cached = cache.clients.find(\n    (c) => c.authServerIssuer === authServer.issuer && c.redirectUri === redirectUri,\n  );\n  if (cached) return cached;\n  if (!authServer.registration_endpoint) {\n    throw new Error(\n      `auth server ${authServer.issuer} does not advertise a registration_endpoint and no client is pre-registered`,\n    );\n  }\n  const reg = await registerClient(\n    authServer.registration_endpoint,\n    redirectUri,\n    fetchImpl,\n  );\n  const next: RegisteredClient = {\n    authServerIssuer: authServer.issuer,\n    redirectUri,\n    clientId: reg.clientId,\n    registeredAt: Date.now(),\n  };\n  if (reg.clientSecret) next.clientSecret = reg.clientSecret;\n  cache.clients.push(next);\n  await writeClientCache(dataDir, cache);\n  return next;","sourceCodeStart":281,"sourceCodeEnd":317,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/apps/daemon/src/mcp-oauth.ts#L281-L317","documentation":"getOrRegisterClient looks up a cached client by (authServerIssuer, redirectUri); on cache miss it requires authServer.registration_endpoint. If the auth server metadata omits registration_endpoint and nothing is cached, there is no way to obtain a client_id and the flow stops.","triggerScenarios":"First connection to an MCP provider whose auth server does not support DCR; the client cache file was cleared or is corrupt; redirectUri changed so the cached client no longer matches.","commonSituations":"A provider that requires static client registration; the user pointed at a different redirectUri than the one pre-registered.","solutions":["Pre-register a client with the provider and seed the client cache file for that issuer and redirectUri.","Confirm the auth server metadata truly lacks registration_endpoint (it may live under a different issuer).","Use the redirectUri that matches a cached or pre-registered client."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const meta = await discoverAuthServer(issuer);\nconst cached = await hasCachedClient(dataDir, issuer, redirectUri);\nif (!meta?.registration_endpoint && !cached) {\n  throw new Error('pre-register a client for this issuer; it advertises no registration_endpoint');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the client cache populated for non-DCR providers.","Pin redirectUri to the pre-registered value.","Re-validate after changing redirectUri."],"tags":["oauth","dcr","config"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}