mcp-use TypeScript API
    Preparing search index...

    Interface HttpServerConfig

    Configures a remote MCP server accessed with streamable HTTP.

    interface HttpServerConfig {
        authProvider?: AuthProvider | OAuthClientProvider;
        authToken?: string;
        clientInfo?: ClientInfo;
        clientOptions?: ClientOptions;
        defaultRequestOptions?: RequestOptions;
        fetch?: {
            (input: URL | RequestInfo, init?: RequestInit): Promise<Response>;
            (input: string | URL | Request, init?: RequestInit): Promise<Response>;
        };
        headers?: Record<string, string>;
        oauth?: false | AutoOAuthOptions;
        onElicitation?: OnElicitationCallback;
        onNotification?: OnNotificationCallback;
        onSampling?: OnSamplingCallback;
        protocolNegotiation?: VersionNegotiationMode;
        roots?: {}[];
        timeout?: number;
        url: string;
    }

    Hierarchy

    • BaseServerConfig
      • HttpServerConfig
    Index
    authProvider?: AuthProvider | OAuthClientProvider

    OAuth provider used when the server requires authorization.

    authToken?: string

    Bearer token added as the Authorization header.

    clientInfo?: ClientInfo

    Client identity advertised to the server.

    clientOptions?: ClientOptions

    Options forwarded to the official MCP SDK Client.

    defaultRequestOptions?: RequestOptions

    Default timeout/cancellation options for requests.

    fetch?: {
        (input: URL | RequestInfo, init?: RequestInit): Promise<Response>;
        (input: string | URL | Request, init?: RequestInit): Promise<Response>;
    }

    Fetch implementation used by the HTTP transport.

    Type Declaration

      • (input: URL | RequestInfo, init?: RequestInit): Promise<Response>
      • Parameters

        • input: URL | RequestInfo
        • Optionalinit: RequestInit

        Returns Promise<Response>

      • (input: string | URL | Request, init?: RequestInit): Promise<Response>
      • Parameters

        • input: string | URL | Request
        • Optionalinit: RequestInit

        Returns Promise<Response>

    headers?: Record<string, string>

    Headers included with MCP transport requests.

    oauth?: false | AutoOAuthOptions

    Auto-OAuth options for HTTP servers.

    • omit / {}: client creates the platform provider on connect
    • false: disable auto-OAuth (e.g. CLI --no-oauth)
    • object: forwarded to createOAuthProvider

    Ignored when authProvider or authToken is set, or when headers already includes Authorization.

    onElicitation?: OnElicitationCallback

    Callback for elicitation requests from servers.

    onNotification?: OnNotificationCallback

    Callback for notifications from servers.

    onSampling?: OnSamplingCallback

    Callback for sampling input.

    Sampling is deprecated by the 2026 protocol. Retained for v1 push requests and the v2 input_required compatibility window.

    protocolNegotiation?: VersionNegotiationMode

    Protocol version negotiation mode. Defaults to "auto" to negotiate both v1 and v2 MCP servers. See HttpConnector.

    roots?: {}[]

    Initial roots advertised to the server.

    timeout?: number

    Connection timeout in milliseconds.

    url: string

    MCP endpoint URL.