nexu-io/open-design · error · Error

auth server ${authServer.issuer} does not advertise a regist

Error message

auth server ${authServer.issuer} does not advertise a registration_endpoint and no client is pre-registered

What it means

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.

Source

Thrown at apps/daemon/src/mcp-oauth.ts:299

/**
 * Cached version of `registerClient`. Looks up `(authServerIssuer, redirectUri)`
 * in the cache file and re-uses the existing client; falls back to a fresh
 * DCR call when nothing is cached.
 */
export async function getOrRegisterClient(
  dataDir: string,
  authServer: AuthorizationServerMetadata,
  redirectUri: string,
  fetchImpl: typeof fetch = fetch,
): Promise<RegisteredClient> {
  const cache = await readClientCache(dataDir);
  const cached = cache.clients.find(
    (c) => c.authServerIssuer === authServer.issuer && c.redirectUri === redirectUri,
  );
  if (cached) return cached;
  if (!authServer.registration_endpoint) {
    throw new Error(
      `auth server ${authServer.issuer} does not advertise a registration_endpoint and no client is pre-registered`,
    );
  }
  const reg = await registerClient(
    authServer.registration_endpoint,
    redirectUri,
    fetchImpl,
  );
  const next: RegisteredClient = {
    authServerIssuer: authServer.issuer,
    redirectUri,
    clientId: reg.clientId,
    registeredAt: Date.now(),
  };
  if (reg.clientSecret) next.clientSecret = reg.clientSecret;
  cache.clients.push(next);
  await writeClientCache(dataDir, cache);
  return next;

View on GitHub (pinned to 5be4028344)

Solutions

  1. Pre-register a client with the provider and seed the client cache file for that issuer and redirectUri.
  2. Confirm the auth server metadata truly lacks registration_endpoint (it may live under a different issuer).
  3. Use the redirectUri that matches a cached or pre-registered client.
Defensive patterns

Strategy: validation

Validate before calling

const meta = await discoverAuthServer(issuer);
const cached = await hasCachedClient(dataDir, issuer, redirectUri);
if (!meta?.registration_endpoint && !cached) {
  throw new Error('pre-register a client for this issuer; it advertises no registration_endpoint');
}

Prevention

When it happens

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

Common situations: A provider that requires static client registration; the user pointed at a different redirectUri than the one pre-registered.

Related errors


AI-assisted analysis of nexu-io/open-design@5be4028344 (2026-08-12). Data as JSON: /api/errors/edb0553f0b6708b9. Report an issue: GitHub.