import { type AuthInfo } from "@modelcontextprotocol/server"; import { type FetchMiddleware } from "../fetch-app.js"; import type { OAuthMetadataSource, OAuthProvider } from "./provider.js"; /** * Fetch middleware that requires a bearer token for a canonical resource. * * @typeParam TUser - Application user type carried by the provider. * @param provider - OAuth provider that verifies the bearer token. * @param resource - Canonical public MCP endpoint URL. */ export declare function bearerAuth(provider: OAuthProvider, resource: URL): FetchMiddleware; /** * Fetch middleware that serves OAuth discovery metadata. * * @typeParam TUser - Application user type carried by the provider. * @param provider - OAuth provider that supplies authorization-server metadata. * @param resource - Canonical public MCP endpoint URL. */ export declare function oauthMetadata(provider: OAuthProvider, resource: URL): FetchMiddleware; /** * Read verified {@link AuthInfo} from the request bag after {@link bearerAuth}. * * @param request - Request that passed through bearer auth middleware. */ export declare function authInfoFromRequest(request: Request): AuthInfo | undefined;