ReadonlyportReserved localhost callback port.
ReadonlyserverProtected MCP server URL associated with this provider.
Local callback port, useful for status output and tests.
OAuth client metadata presented during registration.
OAuth Client ID Metadata Document URL, when configured.
True if redirectToAuthorization() has been called and we're awaiting
a callback (loopback bound, browser opened). Lets orchestrators detect
when the SDK transport has already kicked off the flow on a 401, so they
can skip straight to getAuthorizationCode() instead of calling auth()
again (which would throw "already in progress").
Loopback redirect URL registered for this provider.
Stable hash of the protected server URL used to namespace storage.
Prefix used for persisted OAuth session keys.
Loads saved OAuth client registration information.
Optionalctx: OAuthClientInformationContext
Optional registration context.
Saved registration information, or undefined.
Loads the saved PKCE code verifier.
The saved verifier.
Returns previously saved OAuth discovery state.
Saved discovery state, or undefined.
Cancel an in-progress flow (timeout, SIGINT, etc.) and close the loopback.
Pending calls to NodeOAuthClientProvider.getAuthorizationResponse
reject with an OAuthFlowError whose code is "cancelled".
Resolves with the authorization code captured by the loopback callback.
The authorization code received by the loopback callback.
This compatibility method omits the RFC 9207 issuer. OAuth flow
orchestrators should use getAuthorizationResponse when available.
Must be called after redirectToAuthorization(). Returns the same
promise whether the callback has fired or not — callers may subscribe
before or after.
Resolves with the authorization code and RFC 9207 issuer captured by the loopback callback.
The loopback authorization response.
When called before NodeOAuthClientProvider.redirectToAuthorization.
Bind the loopback server, set up the pending-code deferred, and ask the
platform to open the user's browser. Does NOT await the code; the
orchestrator awaits via getAuthorizationCode().
Authorization URL generated by the SDK.
A promise that resolves once the loopback listener is ready and the browser-open attempt completes.
Persists OAuth client registration information.
Client information to save.
Optionalctx: OAuthClientInformationContext
Optional registration context.
Persists a PKCE code verifier.
Verifier to save.
Persists OAuth discovery state.
Discovery state to save.
Persists OAuth tokens.
Tokens to save.
Optionalctx: OAuthClientInformationContext
Optional client registration context.
Loads saved OAuth tokens.
Optionalctx: OAuthClientInformationContext
Optional client registration context.
Saved tokens, or undefined when none exist.
StaticcreateCreates a Node OAuth provider and reserves a localhost callback port.
Protected MCP server URL.
OAuth metadata, storage, loopback, and browser options.
A provider ready to participate in the SDK OAuth flow.
Node/CLI OAuth client provider for MCP. Owns a localhost loopback callback server, opens the user's browser, and resolves the authorization code via
getAuthorizationCode()— designed for the orchestrator pattern inuseMcp.ts:1121-1145.Use the static
create()factory; the constructor is internal because port reservation is async.