@modelcontextprotocol/sdk
    Preparing search index...

    Type Alias StreamableHTTPClientTransportOptions

    Configuration options for the StreamableHTTPClientTransport.

    type StreamableHTTPClientTransportOptions = {
        authProvider?: OAuthClientProvider;
        fetch?: FetchLike;
        reconnectionOptions?: StreamableHTTPReconnectionOptions;
        requestInit?: RequestInit;
        sessionId?: string;
    }
    Index

    Properties

    authProvider?: OAuthClientProvider

    An OAuth client provider to use for authentication.

    When an authProvider is specified and the connection is started:

    1. The connection is attempted with any existing access token from the authProvider.
    2. If the access token has expired, the authProvider is used to refresh the token.
    3. If token refresh fails or no access token exists, and auth is required, OAuthClientProvider.redirectToAuthorization is called, and an UnauthorizedError will be thrown from connect/start.

    After the user has finished authorizing via their user agent, and is redirected back to the MCP client application, call StreamableHTTPClientTransport.finishAuth with the authorization code before retrying the connection.

    If an authProvider is not provided, and auth is required, an UnauthorizedError will be thrown.

    UnauthorizedError might also be thrown when sending any message over the transport, indicating that the session has expired, and needs to be re-authed and reconnected.

    fetch?: FetchLike

    Custom fetch implementation used for all network requests.

    reconnectionOptions?: StreamableHTTPReconnectionOptions

    Options to configure the reconnection behavior.

    requestInit?: RequestInit

    Customizes HTTP requests to the server.

    sessionId?: string

    Session ID for the connection. This is used to identify the session on the server. When not provided and connecting to a server that supports session IDs, the server will generate a new session ID.