Optional
maxOptional
oncloseOptional
onerrorOptional
onmessageOptional
onprogressIf set, requests progress notifications from the remote end (if supported). When progress notifications are received, this callback will be invoked.
Optional
onresumptiontokenA callback that is invoked when the resumption token changes, if supported by the transport.
This allows clients to persist the latest token for potential reconnection.
Optional
relatedIf present, relatedRequestId
is used to indicate to the transport which incoming request to associate this outgoing message with.
Optional
resetIf true, receiving a progress notification will reset the request timeout. This is useful for long-running operations that send periodic progress updates. Default: false
Optional
resumptionThe resumption token used to continue long-running requests that were interrupted.
This allows clients to reconnect and continue from where they left off, if supported by the transport.
Optional
signalCan be used to cancel an in-flight request. This will cause an AbortError to be raised from request().
Optional
timeoutA timeout (in milliseconds) for this request. If exceeded, an McpError with code RequestTimeout
will be raised from request().
If not specified, DEFAULT_REQUEST_TIMEOUT_MSEC
will be used as the timeout.
Maximum total time (in milliseconds) to wait for a response. If exceeded, an McpError with code
RequestTimeout
will be raised, regardless of progress notifications. If not specified, there is no maximum total timeout.