different-ai/openwork · error · EnterpriseMcpOAuthContractError

MCP_OAUTH_CONFIGURATION_REQUIRED

MCP_OAUTH_CONFIGURATION_REQUIRED

Error message

This MCP resource advertises multiple authorization servers; an administrator must select one before connecting.

What it means

Error "This MCP resource advertises multiple authorization servers; an administrator must select one before connecting." thrown in different-ai/openwork.

Source

Thrown at packages/enterprise-mcp-client/src/oauth-provider.ts:165

  get clientMetadata() {
    const scope = this.requestedScopes.join(" ")
    return {
      redirect_uris: [this.redirectUri],
      client_name: this.clientName,
      grant_types: ["authorization_code", "refresh_token"],
      response_types: ["code"],
      token_endpoint_auth_method: "none",
      application_type: this.applicationType,
      ...(scope ? { scope } : {}),
    }
  }

  private assertDiscoveryBinding(state: OAuthDiscoveryState): void {
    const selectedIssuer = this.authorizationServerIssuer
    if (!selectedIssuer) {
      if ((state.resourceMetadata?.authorization_servers?.length ?? 0) > 1) {
        throw new EnterpriseMcpOAuthContractError(
          "MCP_OAUTH_CONFIGURATION_REQUIRED",
          "This MCP resource advertises multiple authorization servers; an administrator must select one before connecting.",
        )
      }
      return
    }
    if (!isAuthorizationServerDiscoveryBound(state, selectedIssuer)) {
      throw new EnterpriseMcpOAuthContractError(
        "MCP_OAUTH_ISSUER_MISMATCH",
        "The OAuth authorization server does not match the issuer selected for this MCP connection.",
      )
    }
  }

  private expectedCredentialIssuer(context?: OAuthClientInformationContext): string | undefined {
    const boundIssuer = this.authorizationServerIssuer
      ?? this.loadedDiscovery?.authorizationServerMetadata?.issuer
      ?? this.loadedDiscovery?.authorizationServerUrl

View on GitHub (pinned to 2b7df46e8a)

When it happens

Trigger: Thrown at packages/enterprise-mcp-client/src/oauth-provider.ts:165 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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