MCP TypeScript SDK
    Preparing search index...

    Interface TaskRequestHandlerExtraExperimental

    Extended handler extra with task ID and store for task operations.

    interface TaskRequestHandlerExtra {
        _meta?: {
            "io.modelcontextprotocol/related-task"?: { taskId: string };
            progressToken?: string | number;
            [key: string]: unknown;
        };
        authInfo?: AuthInfo;
        closeSSEStream?: () => void;
        closeStandaloneSSEStream?: () => void;
        requestId: RequestId;
        requestInfo?: RequestInfo;
        sendNotification: (notification: ServerNotification) => Promise<void>;
        sendRequest: <U extends AnySchema>(
            request: ServerRequest,
            resultSchema: U,
            options?: TaskRequestOptions,
        ) => Promise<SchemaOutput<U>>;
        sessionId?: string;
        signal: AbortSignal;
        taskId: string;
        taskRequestedTtl?: number | null;
        taskStore: RequestTaskStore;
    }

    Hierarchy (View Summary)

    Index

    Properties

    _meta?: {
        "io.modelcontextprotocol/related-task"?: { taskId: string };
        progressToken?: string | number;
        [key: string]: unknown;
    }

    Metadata from the original request.

    Type Declaration

    • [key: string]: unknown
    • Optionalio.modelcontextprotocol/related-task?: { taskId: string }

      If specified, this request is related to the provided task.

    • OptionalprogressToken?: string | number

      If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.

    authInfo?: AuthInfo

    Information about a validated access token, provided to request handlers.

    closeSSEStream?: () => void

    Closes the SSE stream for this request, triggering client reconnection. Only available when using StreamableHTTPServerTransport with eventStore configured. Use this to implement polling behavior during long-running operations.

    closeStandaloneSSEStream?: () => void

    Closes the standalone GET SSE stream, triggering client reconnection. Only available when using StreamableHTTPServerTransport with eventStore configured. Use this to implement polling behavior for server-initiated notifications.

    requestId: RequestId

    The JSON-RPC ID of the request being handled. This can be useful for tracking or logging purposes.

    requestInfo?: RequestInfo

    The original HTTP request.

    sendNotification: (notification: ServerNotification) => Promise<void>

    Sends a notification that relates to the current request being handled.

    This is used by certain transports to correctly associate related messages.

    sendRequest: <U extends AnySchema>(
        request: ServerRequest,
        resultSchema: U,
        options?: TaskRequestOptions,
    ) => Promise<SchemaOutput<U>>

    Sends a request that relates to the current request being handled.

    This is used by certain transports to correctly associate related messages.

    sessionId?: string

    The session ID from the transport, if available.

    signal: AbortSignal

    An abort signal used to communicate if the request was cancelled from the sender's side.

    taskId: string
    taskRequestedTtl?: number | null
    taskStore: RequestTaskStore