This is the documentation for the v2 beta — looking for the v1 documentation?
Skip to content

MCP TypeScript SDK (V2) / @modelcontextprotocol/client / client/versionNegotiation

client/versionNegotiation

Interfaces

NegotiationDeps

Defined in: packages/client/src/client/versionNegotiation.ts:350

Properties

capabilities

capabilities: object

Defined in: packages/client/src/client/versionNegotiation.ts:353

elicitation?

optional elicitation?: object

Present if the client supports eliciting user input.

Index Signature

[key: string]: string | number | boolean | {[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null; } | string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null[] | null

elicitation.form?

optional form?: object

Index Signature

[key: string]: string | number | boolean | {[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null; } | string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null[] | null

elicitation.form.applyDefaults?

optional applyDefaults?: boolean

elicitation.url?

optional url?: object

Index Signature

[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; } | string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null[] | null

experimental?

optional experimental?: object

Experimental, non-standard capabilities that the client supports.

Index Signature

[key: string]: object

extensions?

optional extensions?: object

Extensions that the client supports. Keys are extension identifiers (vendor-prefix/extension-name).

Index Signature

[key: string]: object

roots?

optional roots?: object

Present if the client supports listing roots.

Deprecated

Deprecated as of protocol version 2026-07-28 (SEP-2577); remains in the specification for at least twelve months. Migrate to passing paths via tool parameters, resource URIs, or configuration.

roots.listChanged?

optional listChanged?: boolean

Whether the client supports issuing notifications for changes to the roots list.

sampling?

optional sampling?: object

Present if the client supports sampling from an LLM.

Deprecated

Deprecated as of protocol version 2026-07-28 (SEP-2577); remains in the specification for at least twelve months. Migrate to calling LLM provider APIs directly.

sampling.context?

optional context?: object

Present if the client supports context inclusion via includeContext parameter. If not declared, servers SHOULD only use includeContext: "none" (or omit it).

Index Signature

[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; } | string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null[] | null

sampling.tools?

optional tools?: object

Present if the client supports tool use via tools and toolChoice parameters.

Index Signature

[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; } | string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null[] | null

tasks?

optional tasks?: object

Present if the client supports task creation.

Index Signature

[key: string]: unknown

Deprecated

2025-11-25 wire vocabulary with no SDK runtime; parsed for interoperability only — servers built on this SDK never advertise it.

tasks.cancel?

optional cancel?: object

Present if the client supports cancelling tasks.

Index Signature

[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; } | string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null[] | null

tasks.list?

optional list?: object

Present if the client supports listing tasks.

Index Signature

[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; } | string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null[] | null

tasks.requests?

optional requests?: object

Capabilities for task creation on specific request types.

Index Signature

[key: string]: unknown

tasks.requests.elicitation?

optional elicitation?: object

Task support for elicitation requests.

Index Signature

[key: string]: unknown

tasks.requests.elicitation.create?

optional create?: object

Index Signature

[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; } | ...[] | null

tasks.requests.sampling?

optional sampling?: object

Task support for sampling requests.

Index Signature

[key: string]: unknown

tasks.requests.sampling.createMessage?

optional createMessage?: object

Index Signature

[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; } | ...[] | null

clientInfo

clientInfo: object

Defined in: packages/client/src/client/versionNegotiation.ts:352

description?

optional description?: string

An optional human-readable description of what this implementation does.

This can be used by clients or servers to provide context about their purpose and capabilities. For example, a server might describe the types of resources or tools it provides, while a client might describe its intended use case.

icons?

optional icons?: object[]

Optional set of sized icons that the client can display in a user interface.

Clients that support rendering icons MUST support at least the following MIME types:

  • image/png - PNG images (safe, universal compatibility)
  • image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)

Clients that support rendering icons SHOULD also support:

  • image/svg+xml - SVG images (scalable but requires security precautions)
  • image/webp - WebP images (modern, efficient format)
name

name: string

Intended for programmatic or logical use, but used as a display name in past specs or fallback

title?

optional title?: string

Intended for UI and end-user contexts — optimized to be human-readable and easily understood, even by those unfamiliar with domain-specific terminology.

If not provided, the name should be used for display (except for Tool, where annotations.title should be given precedence over using name, if present).

version

version: string

websiteUrl?

optional websiteUrl?: string

An optional URL of the website for this implementation.

defaultTimeoutMs

defaultTimeoutMs: number

Defined in: packages/client/src/client/versionNegotiation.ts:358

The standard request timeout for this connect (probe inherits it unless probe.timeoutMs overrides).

environment

environment: ProbeEnvironment

Defined in: packages/client/src/client/versionNegotiation.ts:354

transport

transport: Transport

Defined in: packages/client/src/client/versionNegotiation.ts:351

transportKind

transportKind: ProbeTransportKind

Defined in: packages/client/src/client/versionNegotiation.ts:356

The transport class, for the transport-aware timeout verdict (see ProbeTransportKind).


VersionNegotiationOptions

Defined in: packages/client/src/client/versionNegotiation.ts:85

Opt-in protocol version negotiation, configured on ClientOptions.versionNegotiation.

Properties

mode?

optional mode?: VersionNegotiationMode

Defined in: packages/client/src/client/versionNegotiation.ts:89

Default
ts
'legacy'
probe?

optional probe?: VersionNegotiationProbeOptions

Defined in: packages/client/src/client/versionNegotiation.ts:94

Probe timeout/retry policy (only consulted by the probing modes).


VersionNegotiationProbeOptions

Defined in: packages/client/src/client/versionNegotiation.ts:38

Probe policy for 'auto' and pinned negotiation modes.

There is no special probe timeout opinion: the probe inherits the client's STANDARD request timeout unless timeoutMs overrides it.

Properties

maxRetries?

optional maxRetries?: number

Defined in: packages/client/src/client/versionNegotiation.ts:61

Number of times to re-send the probe after a timeout before reaching the timeout verdict. Governs timeout re-sends only — the spec-mandated -32022 corrective continuation (select-and-continue with a mutual version) is a separate negotiation step and is never counted against maxRetries.

Default
ts
0 (no retries)
timeoutMs?

optional timeoutMs?: number

Defined in: packages/client/src/client/versionNegotiation.ts:50

Timeout for the probe exchange, in milliseconds.

The timeout verdict is transport-aware: on stdio, a probe that gets no response within the timeout indicates a legacy server and falls back to the initialize handshake on the same stream; on HTTP, where a deployed server answers and silence means an outage, connect() rejects with the standard typed timeout error instead.

Default

the standard request timeout (DEFAULT_REQUEST_TIMEOUT_MSEC, or the timeout passed to connect())

Type Aliases

NegotiationResult

NegotiationResult = { discover: DiscoverResult; era: "modern"; version: string; } | { era: "legacy"; }

Defined in: packages/client/src/client/versionNegotiation.ts:361


ResolvedVersionNegotiation

ResolvedVersionNegotiation = { kind: "legacy"; } | { fallbackAvailable: boolean; kind: "auto"; modernVersions: string[]; probe: VersionNegotiationProbeOptions; } | { kind: "pin"; probe: VersionNegotiationProbeOptions; version: string; }

Defined in: packages/client/src/client/versionNegotiation.ts:104

A fully resolved negotiation plan for one connect() call.

Union Members

Type Literal

{ kind: "legacy"; }


Type Literal

{ fallbackAvailable: boolean; kind: "auto"; modernVersions: string[]; probe: VersionNegotiationProbeOptions; }

fallbackAvailable

fallbackAvailable: boolean

Whether this client can fall back to the legacy initialize handshake.

kind

kind: "auto"

modernVersions

modernVersions: string[]

Modern versions this client offers, in preference order (never empty).

probe

probe: VersionNegotiationProbeOptions


Type Literal

{ kind: "pin"; probe: VersionNegotiationProbeOptions; version: string; }


VersionNegotiationMode

VersionNegotiationMode = "legacy" | "auto" | { pin: string; }

Defined in: packages/client/src/client/versionNegotiation.ts:79

Negotiation mode:

  • 'legacy' — no negotiation: the plain 2025 connect sequence, byte-identical to a client without this option.
  • 'auto' — probe with server/discover at connect; conservative fallback to the plain legacy initialize handshake on the same connection unless the outcome is definitive modern evidence. Network outage rejects with a typed connect error; a probe timeout falls back to initialize on stdio (a silent server on a local pipe is a legacy server) and rejects with a typed timeout error on HTTP (silence there is an outage).
  • { pin: '<version>' } — modern era at exactly the pinned revision: the connect-time server/discover must offer it. No fallback — anything else fails loudly with a typed error.

Functions

buildProbeRequest()

buildProbeRequest(id, protocolVersion, clientInfo, capabilities): object

Defined in: packages/client/src/client/versionNegotiation.ts:293

Build the probe request: server/discover carrying the full per-request _meta envelope.

Parameters

id

string

protocolVersion

string

clientInfo
description?

string = ...

An optional human-readable description of what this implementation does.

This can be used by clients or servers to provide context about their purpose and capabilities. For example, a server might describe the types of resources or tools it provides, while a client might describe its intended use case.

icons?

object[] = ...

Optional set of sized icons that the client can display in a user interface.

Clients that support rendering icons MUST support at least the following MIME types:

  • image/png - PNG images (safe, universal compatibility)
  • image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)

Clients that support rendering icons SHOULD also support:

  • image/svg+xml - SVG images (scalable but requires security precautions)
  • image/webp - WebP images (modern, efficient format)
name

string = ...

Intended for programmatic or logical use, but used as a display name in past specs or fallback

title?

string = ...

Intended for UI and end-user contexts — optimized to be human-readable and easily understood, even by those unfamiliar with domain-specific terminology.

If not provided, the name should be used for display (except for Tool, where annotations.title should be given precedence over using name, if present).

version

string = ...

websiteUrl?

string = ...

An optional URL of the website for this implementation.

capabilities
elicitation?

{[key: string]: string | number | boolean | {[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null; } | string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null[] | null; form?: {[key: string]: string | number | boolean | {[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null; } | string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null[] | null; applyDefaults?: boolean; }; url?: {[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; } | string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null[] | null; }; } = ...

Present if the client supports eliciting user input.

elicitation.form?

{[key: string]: string | number | boolean | {[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null; } | string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null[] | null; applyDefaults?: boolean; } = ...

elicitation.form.applyDefaults?

boolean = ...

elicitation.url?

{[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; } | string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null[] | null; } = ...

experimental?

{[key: string]: object; } = ...

Experimental, non-standard capabilities that the client supports.

extensions?

{[key: string]: object; } = ...

Extensions that the client supports. Keys are extension identifiers (vendor-prefix/extension-name).

roots?

{ listChanged?: boolean; } = ...

Present if the client supports listing roots.

Deprecated

Deprecated as of protocol version 2026-07-28 (SEP-2577); remains in the specification for at least twelve months. Migrate to passing paths via tool parameters, resource URIs, or configuration.

roots.listChanged?

boolean = ...

Whether the client supports issuing notifications for changes to the roots list.

sampling?

{ context?: {[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; } | string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null[] | null; }; tools?: {[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; } | string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null[] | null; }; } = ...

Present if the client supports sampling from an LLM.

Deprecated

Deprecated as of protocol version 2026-07-28 (SEP-2577); remains in the specification for at least twelve months. Migrate to calling LLM provider APIs directly.

sampling.context?

{[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; } | string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null[] | null; } = ...

Present if the client supports context inclusion via includeContext parameter. If not declared, servers SHOULD only use includeContext: "none" (or omit it).

sampling.tools?

{[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; } | string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null[] | null; } = ...

Present if the client supports tool use via tools and toolChoice parameters.

tasks?

{[key: string]: unknown; cancel?: {[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; } | string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null[] | null; }; list?: {[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; } | string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null[] | null; }; requests?: {[key: string]: unknown; elicitation?: {[key: string]: unknown; create?: {[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; } | ...[] | null; }; }; sampling?: {[key: string]: unknown; createMessage?: {[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; } | ...[] | null; }; }; }; } = ...

Present if the client supports task creation.

Deprecated

2025-11-25 wire vocabulary with no SDK runtime; parsed for interoperability only — servers built on this SDK never advertise it.

tasks.cancel?

{[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; } | string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null[] | null; } = ...

Present if the client supports cancelling tasks.

tasks.list?

{[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; } | string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null[] | null; } = ...

Present if the client supports listing tasks.

tasks.requests?

{[key: string]: unknown; elicitation?: {[key: string]: unknown; create?: {[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; } | ...[] | null; }; }; sampling?: {[key: string]: unknown; createMessage?: {[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; } | ...[] | null; }; }; } = ...

Capabilities for task creation on specific request types.

tasks.requests.elicitation?

{[key: string]: unknown; create?: {[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; } | ...[] | null; }; } = ...

Task support for elicitation requests.

tasks.requests.elicitation.create?

{[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; } | ...[] | null; } = ...

tasks.requests.sampling?

{[key: string]: unknown; createMessage?: {[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; } | ...[] | null; }; } = ...

Task support for sampling requests.

tasks.requests.sampling.createMessage?

{[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; } | ...[] | null; } = ...

Returns

object

id

id: string | number = RequestIdSchema

jsonrpc

jsonrpc: "2.0"

method

method: string

params?

optional params?: object

Index Signature

[key: string]: unknown

params._meta?

optional _meta?: object

See General fields: _meta for notes on _meta usage.

Index Signature

[key: string]: unknown

optional io.modelcontextprotocol/related-task?: object

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

taskId: string

params._meta.progressToken?

optional progressToken?: 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.


detectProbeEnvironment()

detectProbeEnvironment(): ProbeEnvironment

Defined in: packages/client/src/client/versionNegotiation.ts:146

Detect the probe environment for the network-failure row — see ProbeEnvironment.

Returns

ProbeEnvironment


detectProbeTransportKind()

detectProbeTransportKind(transport): ProbeTransportKind

Defined in: packages/client/src/client/versionNegotiation.ts:157

Detect the transport class for the transport-aware timeout verdict (see ProbeTransportKind). The stdio child-process transport is recognized structurally (stderr/pid accessors, no instanceof — safe across bundles); everything else is treated like HTTP.

Parameters

transport

Transport

Returns

ProbeTransportKind


negotiateEra()

negotiateEra(negotiation, deps): Promise<NegotiationResult>

Defined in: packages/client/src/client/versionNegotiation.ts:370

Run the negotiation probe state machine on a raw (not yet Protocol-connected) transport. Resolves with the negotiated era; throws typed connect errors. On return the probe window has been released: the transport is started, handler-free, and ready for Protocol.connect() handover. On throw the window is detached and the transport's start is left untouched.

Parameters

negotiation

{ fallbackAvailable: boolean; kind: "auto"; modernVersions: string[]; probe: VersionNegotiationProbeOptions; } | { kind: "pin"; probe: VersionNegotiationProbeOptions; version: string; }

Type Literal

{ fallbackAvailable: boolean; kind: "auto"; modernVersions: string[]; probe: VersionNegotiationProbeOptions; }

fallbackAvailable

boolean

Whether this client can fall back to the legacy initialize handshake.

kind

"auto"

modernVersions

string[]

Modern versions this client offers, in preference order (never empty).

probe

VersionNegotiationProbeOptions

deps

NegotiationDeps

Returns

Promise<NegotiationResult>


resolveVersionNegotiation()

resolveVersionNegotiation(options, supportedProtocolVersionsOption): ResolvedVersionNegotiation

Defined in: packages/client/src/client/versionNegotiation.ts:121

Resolve the negotiation options into a per-connect plan. The raw (not defaulted) supportedProtocolVersions option supplies the modern offer list; a list without any legacy version makes this a modern-only client (no fallback).

Parameters

options

VersionNegotiationOptions | undefined

supportedProtocolVersionsOption

readonly string[] | undefined

Returns

ResolvedVersionNegotiation