mcp-use TypeScript API
    Preparing search index...

    Function bearerAuth

    • Fetch middleware that requires a bearer token for a canonical resource.

      Type Parameters

      • TUser

        Application user type carried by the provider.

      Parameters

      • provider: OAuthProvider<TUser>

        OAuth provider that verifies the bearer token.

      • resource: URL

        Canonical public MCP endpoint URL.

      Returns FetchMiddleware