mcp-use TypeScript API
    Preparing search index...

    Function oauthBetterAuthProvider

    • Creates a provider for Better Auth's OAuth 2.1 Provider plugin.

      Better Auth owns registration, authorization, consent, and token issuance. mcp-use advertises those endpoints and verifies the resulting access-token JWTs against Better Auth's JWKS endpoint.

      Parameters

      Returns OAuthProvider<BetterAuthOAuthUser>

      A provider that rejects tokens not issued for the resolved MCP resource.

      A TypeError if authURL is not a valid HTTP or HTTPS URL.

      import { oauthBetterAuthProvider } from "mcp-use/oauth/better-auth";

      const oauth = oauthBetterAuthProvider({
      authURL: "https://auth.example.com/api/auth",
      });