MCP TypeScript SDK (V2)
    Preparing search index...

    Configuration options for the SSEClientTransport.

    type SSEClientTransportOptions = {
        authProvider?: AuthProvider | OAuthClientProvider;
        eventSourceInit?: EventSourceInit;
        fetch?: FetchLike;
        requestInit?: RequestInit;
    }
    Index

    Properties

    An OAuth client provider to use for authentication.

    token() is called before every request to obtain the bearer token. When the server responds with 401, onUnauthorized() is called (if provided) to refresh credentials, then the request is retried once. If the retry also gets 401, or onUnauthorized is not provided, UnauthorizedError is thrown.

    For simple bearer tokens: { token: async () => myApiKey }.

    For OAuth flows, pass an OAuthClientProvider implementation. Interactive flows: after UnauthorizedError, redirect the user, then call finishAuth with the authorization code before reconnecting.

    eventSourceInit?: EventSourceInit

    Customizes the initial SSE request to the server (the request that begins the stream).

    NOTE: Setting this property will prevent an Authorization header from being automatically attached to the SSE request, if an authProvider is also given. This can be worked around by setting the Authorization header manually.

    fetch?: FetchLike

    Custom fetch implementation used for all network requests.

    requestInit?: RequestInit

    Customizes recurring POST requests to the server.