OptionalauthOptional external OAuth client provider.
When provided, useMcp will use this provider directly instead of creating BrowserOAuthClientProvider internally. This is useful for headless/testing runtimes where popup/redirect flows are not available.
OptionalautoEnable automatic proxy fallback when direct connection fails When enabled, if a direct connection fails with FastMCP or CORS errors, automatically retries using the proxy configuration
Can be:
true: Enable with proxyConfig.proxyAddressfalse: Disable automatic fallback (default){ enabled: boolean, proxyAddress?: string }: Custom configurationOptionalenabled?: booleanWhether fallback is enabled.
OptionalproxyAddress?: stringProxy endpoint used after a qualifying direct failure.
OptionalautoAuto reconnect if an established connection is lost.
Can be:
boolean: Enable/disable with default 3000ms delay and 10s health checknumber: Reconnect delay in ms (enables health checks with defaults)object: Full configuration for reconnection and health checksOptionalenabled?: booleanWhether to enable automatic reconnection (default: true)
OptionalhealthCheckInterval?: number | falseInterval in ms for health check polling via HEAD requests.
Set to false to disable health checks entirely.
OptionalhealthCheckTimeout?: numberTime in ms without a successful health check before triggering reconnect.
OptionalinitialDelay?: numberDelay in ms before reconnection attempt (default: 3000)
OptionalautoAuto retry connection if initial connection fails, with delay in ms (default: false)
OptionalcallbackCustom callback URL for OAuth redirect (defaults to /oauth/callback on the current origin)
OptionalclientClient information advertised while establishing the MCP connection.
Optionaldescription?: stringOptional human-readable client description.
Optionalicons?: { mimeType?: string; sizes?: string[]; src: string }[]Icons representing the client.
Stable programmatic client name.
Optionaltitle?: stringOptional human-readable client title.
Client version.
OptionalwebsiteUrl?: stringPublic website describing the client.
OptionalclientAdditional client options passed to the underlying MCP SDK Client.
Use capabilities.views: true as shorthand for the MCP Apps UI extension,
or set capabilities.extensions directly.
Optionalcapabilities?: {} & { views?: boolean }MCP capabilities advertised by the underlying SDK client.
OptionalconnectionConnection policy for proxy routing.
auto: start direct and use autoProxyFallback after a qualifying failuredirect: never use proxyConfig and never fall backproxy: use proxyConfig immediately and never fall backWhen omitted, proxyConfig retains its legacy immediate-proxy behavior,
except when autoProxyFallback explicitly requests a direct-first attempt.
OptionaldisplayOptional user-facing alias. server.name always comes from MCP server metadata.
OptionalenabledEnable/disable the connection (similar to TanStack Query). When false, no connection will be attempted (default: true)
OptionalfetchOptional custom fetch function to use for all MCP HTTP requests.
When provided, this replaces the default global fetch for transport-level
requests. Useful for adding custom auth retry logic, logging, or proxying.
Optionalinit: RequestInitOptionalinit: RequestInitOptionalheadersHeaders that can be used to bypass auth
OptionallogLog level for console output.
Set to 'silent' to suppress ALL console logging (the mcp.log state array is still populated).
OptionaloauthOAuth client registration settings.
Use this when the upstream auth server does not support Dynamic Client
Registration — for example, MCP servers running in proxy mode against
Slack, WorkOS, or similar providers. Prefer clientMetadataUrl when the
authorization server advertises CIMD support; the SDK falls back to DCR
when appropriate.
OptionalclientId?: stringPre-registered OAuth client_id.
OptionalclientMetadataUrl?: stringPublic HTTPS OAuth Client ID Metadata Document URL (CIMD). The document must contain a matching client_id and redirect_uris.
Optionalscope?: stringOAuth scope string included in the authorize request.
OptionaloauthOAuth proxy base URL (e.g. https://inspector.example.com/inspector/api/oauth)
used to route OAuth requests (.well-known discovery, DCR, token exchange)
through a transparent server-side proxy — bypassing browser CORS against
third-party identity providers — WITHOUT proxying MCP traffic itself.
The proxy is transparent: it forwards requests and responses unmodified, so
the SDK's authorization-server issuer validation (RFC 8414 §3.3) still
passes. When omitted, the OAuth proxy URL is derived from
proxyConfig.proxyAddress (replacing a trailing /proxy with /oauth),
preserving the existing behavior for fully-proxied connections.
OptionalonOptional callback invoked when the provider queues elicitation.
OptionalonOptional callback invoked when the provider receives a notification.
OptionalonCallback function that is invoked just before the authentication popup window is opened. Only used when useRedirectFlow is false (popup mode).
The URL that will be opened in the popup.
The features string for the popup window.
OptionalonOptional callback invoked when the provider queues sampling.
OptionalpopupPopup window features string (dimensions and behavior) for OAuth
OptionalpreventPrevent automatic authentication popup/redirect on initial connection (default: true) When true, the connection will enter 'pending_auth' state and wait for user to call authenticate() Set to true to show a modal/button before triggering OAuth instead of auto-redirecting
OptionalprotocolProtocol version negotiation mode passed to the underlying SDK Client.
"auto" (default): probe with server/discover to detect modern (2026-07-28)
servers, falling back to the 2025 handshake against legacy servers."legacy": classic 2025 initialize handshake, no probe.{ pin: "2026-07-28" }: modern era only, no fallback.OptionalproxyProxy configuration for routing through a proxy server
OptionalreconnectionSDK-level reconnection options for the streamable HTTP transport
OptionalserverStable identifier supplied to wrapTransport; defaults to url.
OptionalstorageStorage key prefix for OAuth data in localStorage (defaults to "mcp:auth")
OptionaltimeoutConnection timeout in milliseconds for establishing initial connection (default: 30000 / 30 seconds)
OptionalurlThe /sse URL of your remote MCP server
OptionaluseUse full-page redirect for OAuth instead of popup window (default: false) Redirect flow avoids popup blockers and provides better UX on mobile. Set to true to use redirect flow instead of popup.
OptionalwrapOptional callback to wrap the transport before passing it to the Client. Useful for logging, monitoring, or other transport-level interceptors.
Serializable configuration for one server managed by
McpClientProvider. Pass this toaddServer/updateServer.