OptionalauthOAuth client provider for automatic authentication
OptionalclientOptions forwarded to the underlying MCP Client instance.
By default, all connectors (HTTP and stdio) use DialectJsonSchemaValidator
to support common $schema dialects (draft-04, draft-07, 2019-09, 2020-12)
for cross-version compatibility with v1-era servers. Override with
clientOptions.jsonSchemaValidator if stricter validation is needed.
OptionaldefaultArbitrary request options (timeouts, cancellation, etc.) used by helper methods when they issue SDK requests. Can be overridden per‑call.
OptionalonOptional callback function to handle elicitation requests from servers.
When provided, the client will declare elicitation capability and handle
elicitation/create requests by calling this callback.
Elicitation allows servers to request additional information from users:
OptionalonOptional callback for server notifications. When provided, registered as initial notification handler.
OptionalonOptional callback function to handle sampling requests from servers.
When provided, the client will declare sampling capability and handle
sampling/createMessage requests by calling this callback.
OptionalreconnectionReconnection options for streamable HTTP transport.
Controls retry behavior of the underlying StreamableHTTPClientTransport.
OptionalinitialReconnectionDelay?: numberDelay before the first reconnection attempt in milliseconds.
OptionalmaxReconnectionDelay?: numberMaximum delay between reconnection attempts in milliseconds.
OptionalmaxRetries?: numberMaximum number of reconnection attempts.
OptionalreconnectionDelayGrowFactor?: numberMultiplier applied to the delay after each failed attempt.
OptionalrootsInitial roots to provide to the server. Roots allow the server to know which directories/files the client has access to.
OptionalwrapOptional callback to wrap the transport before passing it to the Client. Useful for logging, monitoring, or other transport-level interceptors.
Shared initialization options for all connector transports.