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

MCP TypeScript SDK (V2) / @modelcontextprotocol/server / server/server

server/server

Classes

Server

Defined in: packages/server/src/server/server.ts:249

An MCP server on top of a pluggable transport.

This server will automatically respond to the initialization flow as initiated from the client.

Deprecated

Use McpServer instead for the high-level API. Only use Server for advanced use cases.

Extends

Constructors

Constructor

new Server(_serverInfo, options?): Server

Defined in: packages/server/src/server/server.ts:301

Initializes this server with the given name and version information.

Parameters
_serverInfo
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.

options?

ServerOptions

Returns

Server

Overrides

Protocol.constructor

Properties

_negotiatedProtocolVersion?

protected optional _negotiatedProtocolVersion?: string

Defined in: packages/core-internal/src/shared/protocol.ts:574

The protocol version negotiated for the current connection (undefined before negotiation completes), which determines the wire era this instance speaks. Set by the SDK's negotiation and initialize paths (Client.connect, Server._oninitialize).

Inherited from

Protocol._negotiatedProtocolVersion

_supportedProtocolVersions

protected _supportedProtocolVersions: string[]

Defined in: packages/core-internal/src/shared/protocol.ts:582

Inherited from

Protocol._supportedProtocolVersions

fallbackNotificationHandler?

optional fallbackNotificationHandler?: (notification) => Promise<void>

Defined in: packages/core-internal/src/shared/protocol.ts:606

A handler to invoke for any notification types that do not have their own handler installed.

Parameters
notification
method

string = ...

params?

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

params._meta?

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

See MCP specification for notes on _meta usage.

{ taskId: string; } = ...

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

string = ...

params._meta.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.

Returns

Promise<void>

Inherited from

Protocol.fallbackNotificationHandler

fallbackRequestHandler?

optional fallbackRequestHandler?: (request, ctx) => Promise<{[key: string]: unknown; _meta?: {[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; }; }>

Defined in: packages/core-internal/src/shared/protocol.ts:601

A handler to invoke for any request types that do not have their own handler installed.

Parameters
request
id

string | number = RequestIdSchema

jsonrpc

"2.0" = ...

method

string = ...

params?

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

params._meta?

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

See General fields: _meta for notes on _meta usage.

{ taskId: string; } = ...

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

string = ...

params._meta.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.

ctx

ServerContext

Returns

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

Inherited from

Protocol.fallbackRequestHandler

onclose?

optional onclose?: () => void

Defined in: packages/core-internal/src/shared/protocol.ts:589

Callback for when the connection is closed for any reason.

This is invoked when close() is called as well.

Returns

void

Inherited from

Protocol.onclose

onerror?

optional onerror?: (error) => void

Defined in: packages/core-internal/src/shared/protocol.ts:596

Callback for when an error occurs.

Note that errors are not necessarily fatal; they are used for reporting any kind of exceptional condition out of band.

Parameters
error

Error

Returns

void

Inherited from

Protocol.onerror

oninitialized?

optional oninitialized?: () => void

Defined in: packages/server/src/server/server.ts:296

Callback for when initialization has fully completed (i.e., the client has sent an notifications/initialized notification).

Returns

void

Accessors

transport
Get Signature

get transport(): Transport | undefined

Defined in: packages/core-internal/src/shared/protocol.ts:1217

Returns

Transport | undefined

Inherited from

Protocol.transport

Methods

_getRequestHandler()

protected _getRequestHandler(method): ((request, ctx) => Promise<{[key: string]: unknown; _meta?: {[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; }; }>) | undefined

Defined in: packages/core-internal/src/shared/protocol.ts:721

Protected accessor for a registered request handler. Used by role classes that dispatch synthesized requests through the same stored handler chain (e.g. the Client fulfilling an embedded multi-round-trip input request).

Parameters
method

string

Returns

((request, ctx) => Promise<{[key: string]: unknown; _meta?: {[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; }; }>) | undefined

Inherited from

Protocol._getRequestHandler

_onclose()

protected _onclose(): void

Defined in: packages/core-internal/src/shared/protocol.ts:824

Transport-close hook. Subclass overrides MUST call super._onclose() after their own cleanup — base teardown (response-handler settlement, timeout clearing, in-flight request abort) does not run otherwise.

Returns

void

Inherited from

Protocol._onclose

_onnotification()

protected _onnotification(rawNotification, extra?): void

Defined in: packages/core-internal/src/shared/protocol.ts:865

Inbound-notification dispatch. Subclass overrides MUST delegate unmatched traffic to super._onnotification(rawNotification, extra) — an override that consumes only what it owns and falls through to base dispatch for everything else.

Parameters
rawNotification
jsonrpc

"2.0" = ...

method

string = ...

params?

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

params._meta?

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

See MCP specification for notes on _meta usage.

{ taskId: string; } = ...

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

string = ...

params._meta.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.

extra?

MessageExtraInfo

Returns

void

Inherited from

Protocol._onnotification

_onresponse()

protected _onresponse(response): void

Defined in: packages/core-internal/src/shared/protocol.ts:1196

Inbound-response dispatch. Subclass overrides MUST delegate unmatched traffic to super._onresponse(response) — an override that consumes only what it owns and falls through to base dispatch for everything else.

Parameters
response

JSONRPCResponse

Returns

void

Inherited from

Protocol._onresponse

_outboundMetaEnvelope()

protected _outboundMetaEnvelope(): Readonly<Record<string, unknown>> | undefined

Defined in: packages/core-internal/src/shared/protocol.ts:663

The per-request _meta envelope this instance attaches to every outgoing request and notification, when one applies. The base implementation returns undefined (no envelope — the 2025-era posture, so legacy-era outbound traffic is byte-identical to a build without this seam). Client overrides it on a connection that negotiated a modern (2026-07-28+) era to return the reserved protocol-version / client-info / client-capabilities keys. User-supplied _meta keys take precedence over the auto-attached ones.

Returns

Readonly<Record<string, unknown>> | undefined

Inherited from

Protocol._outboundMetaEnvelope

_requestWithSchema()

protected _requestWithSchema<T>(request, resultSchema, options?): Promise<InferOutput<T>>

Defined in: packages/core-internal/src/shared/protocol.ts:1345

Sends a request and waits for a response, using the provided schema for validation instead of the era registry's method-keyed entry.

This is the internal implementation used by SDK methods whose result schema cannot be expressed as a method-keyed registry entry — the one surviving case is server.createMessage, whose result schema depends on the REQUEST params (tools vs no tools) — and by callers passing explicit compatibility schemas. Spec methods are still era-gated here: an explicit schema never smuggles a deleted method onto the wire.

Type Parameters
T

T extends StandardSchemaV1<unknown, unknown>

Parameters
request
method

string = ...

params?

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

params._meta?

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

See General fields: _meta for notes on _meta usage.

{ taskId: string; } = ...

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

string = ...

params._meta.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.

resultSchema

T

options?

RequestOptions

Returns

Promise<InferOutput<T>>

Inherited from

Protocol._requestWithSchema

_resolveNonCompleteResult()

protected _resolveNonCompleteResult<T>(decoded, flow): Promise<unknown>

Defined in: packages/core-internal/src/shared/protocol.ts:703

Extension point for non-complete decoded results in the response funnel: a result the wire codec discriminated into a kind other than 'complete' or 'invalid' is handed here for the role class to resolve. The base default surfaces it as a typed SdkErrorCode.UnsupportedResultType error (no retry).

Intended consumers (named so the seam stays accountable):

  • the Client's multi-round-trip auto-fulfilment engine, which fulfils 'input_required' results through the registered elicitation/sampling/roots handlers and retries via flow.retry;
  • a future client-side terminal-result handler for subscriptions/listen, when the spec defines one.

Server instances never receive input_required responses on their outbound legs and leave the base behavior in place.

Type Parameters
T

T extends StandardSchemaV1<unknown, unknown>

Parameters
decoded

DecodedResult & object

flow

NonCompleteResultFlow<T>

Returns

Promise<unknown>

Inherited from

Protocol._resolveNonCompleteResult

_shouldDropInbound()

protected _shouldDropInbound(_message): "drop" | undefined

Defined in: packages/core-internal/src/shared/protocol.ts:649

Drop consult for inbound messages whose transport did not classify them at the edge — long-lived channels such as stdio, where a role class may need to decline traffic the negotiated era has no answer for (the client-side inbound-request drop on modern-era connections: the 2026-07-28 era has no server→client request channel, and on stdio the client must never write JSON-RPC responses).

Consulted ONLY when the transport supplied no MessageExtraInfo.classification: edge-classified traffic never reaches the hook. Returning 'drop' discards the message without writing any response (requests are surfaced via onerror). The base implementation returns undefined: unclassified traffic keeps today's dispatch path unchanged. Era selection never happens here — era is instance state, owned by the serving entry that constructed and connected the instance.

Parameters
_message

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

Returns

"drop" | undefined

Inherited from

Protocol._shouldDropInbound

_wireCodec()

protected _wireCodec(): WireCodec

Defined in: packages/core-internal/src/shared/protocol.ts:1297

Protected accessor for the instance's negotiated wire codec, for role classes (Client/Server/McpServer) routing era-dependent behavior through the codec's function-only surface — samplingResultVariant, outboundEnvelope, projectCallToolResult — instead of branching on the protocol version themselves.

Returns

WireCodec

Inherited from

Protocol._wireCodec

_wrapHandler()

protected _wrapHandler(method, handler): (request, ctx) => Promise<{[key: string]: unknown; _meta?: {[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; }; }>

Defined in: packages/server/src/server/server.ts:459

Enforces server-side validation for tools/call results regardless of how the handler was registered, attaches the configured per-operation cache hint (when one exists) so the 2026-07-28 encode seam can fill ttlMs/cacheScope for results that do not provide their own, and owns the multi-round-trip seam: on the methods whose 2026-07-28 result vocabulary includes input_required (tools/call, prompts/get, resources/read) an input-required return skips result-schema validation and is checked against the served era, the at-least-one rule, and the request's own declared client capabilities; on every other method an input-required return is a server bug and fails loudly. The hint rides a symbol-keyed property that is never serialized, so 2025-era responses are unaffected.

Parameters
method

string

handler

(request, ctx) => Promise<{[key: string]: unknown; _meta?: {[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; }; }>

Returns

(request, ctx) => Promise<{[key: string]: unknown; _meta?: {[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; }; }>

Overrides

Protocol._wrapHandler

assertCanSetRequestHandler()

assertCanSetRequestHandler(method): void

Defined in: packages/core-internal/src/shared/protocol.ts:1765

Asserts that a request handler has not already been set for the given method, in preparation for a new one being automatically installed.

Parameters
method

string

Returns

void

Inherited from

Protocol.assertCanSetRequestHandler

assertCapabilityForMethod()

protected assertCapabilityForMethod(method): void

Defined in: packages/server/src/server/server.ts:741

A method to check if a capability is supported by the remote side, for the given method to be called.

This should be implemented by subclasses.

Parameters
method

string

Returns

void

Overrides

Protocol.assertCapabilityForMethod

assertNotificationCapability()

protected assertNotificationCapability(method): void

Defined in: packages/server/src/server/server.ts:774

A method to check if a notification is supported by the local side, for the given method to be sent.

This should be implemented by subclasses.

Parameters
method

string

Returns

void

Overrides

Protocol.assertNotificationCapability

assertRequestHandlerCapability()

protected assertRequestHandlerCapability(method): void

Defined in: packages/server/src/server/server.ts:836

A method to check if a request handler is supported by the local side, for the given method to be handled.

This should be implemented by subclasses.

Parameters
method

string

Returns

void

Overrides

Protocol.assertRequestHandlerCapability

buildContext()

protected buildContext(ctx, transportInfo?): ServerContext

Defined in: packages/server/src/server/server.ts:361

Builds the context object for request handlers. Subclasses must override to return the appropriate context type (e.g., ServerContext adds HTTP request info).

Parameters
ctx

BaseContext

transportInfo?

MessageExtraInfo

Returns

ServerContext

Overrides

Protocol.buildContext

close()

close(): Promise<void>

Defined in: packages/core-internal/src/shared/protocol.ts:1224

Closes the connection.

Returns

Promise<void>

Inherited from

Protocol.close

connect()

connect(transport): Promise<void>

Defined in: packages/core-internal/src/shared/protocol.ts:782

Attaches to the given transport, starts it, and starts listening for messages.

The caller assumes ownership of the Transport, replacing any callbacks that have already been set, and expects that it is the only user of the Transport instance going forward.

Parameters
transport

Transport

Returns

Promise<void>

Inherited from

Protocol.connect

createElicitationCompletionNotifier()

createElicitationCompletionNotifier(elicitationId, options?): () => Promise<void>

Defined in: packages/server/src/server/server.ts:1226

Creates a reusable callback that, when invoked, will send a notifications/elicitation/complete notification for the specified elicitation ID.

The notification (and the elicitationId it references) exists only on protocol revision 2025-11-25 — the 2026-07-28 draft removed both. On a connection negotiated at 2026-07-28 the returned callback rejects with a typed local error before anything reaches the transport (the method is not part of that revision's wire registry).

Parameters
elicitationId

string

The ID of the elicitation to mark as complete.

options?

NotificationOptions

Optional notification options. Useful when the completion notification should be related to a prior request.

Returns

A function that emits the completion notification when awaited.

() => Promise<void>

createMessage()
Call Signature

createMessage(params, options?): Promise<{[key: string]: unknown; _meta?: {[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; }; content: { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; text: string; type: "text"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "image"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "audio"; }; model: string; role: "user" | "assistant"; stopReason?: string; }>

Defined in: packages/server/src/server/server.ts:1019

Request LLM sampling from the client (without tools). Returns single content block for backwards compatibility.

Parameters
params

CreateMessageRequestParamsBase

options?

RequestOptions

Returns

Promise<{[key: string]: unknown; _meta?: {[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; }; content: { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; text: string; type: "text"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "image"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "audio"; }; model: string; role: "user" | "assistant"; stopReason?: string; }>

Deprecated

Deprecated as of protocol version 2026-07-28 (SEP-2577). Throws on a 2026-07-28-era request — use inputRequired (multi-round-trip) instead, or migrate to calling LLM provider APIs directly. The 2025 push-style server-to-client request model is replaced by input_required results in the 2026-07-28 protocol. If your factory serves both eras, this only works on the legacy path.

Call Signature

createMessage(params, options?): Promise<{[key: string]: unknown; _meta?: {[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; }; content: { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; text: string; type: "text"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "image"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "audio"; } | { _meta?: {[key: string]: unknown; }; id: string; input: {[key: string]: unknown; }; name: string; type: "tool_use"; } | { _meta?: {[key: string]: unknown; }; content: ({ _meta?: {[key: string]: unknown; }; annotations?: { audience?: ...[]; lastModified?: string; priority?: number; }; text: string; type: "text"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ...[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "image"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ...[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "audio"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ...[]; lastModified?: string; priority?: number; }; resource: { _meta?: {[key: ...]: ...; }; mimeType?: string; text: string; uri: string; } | { _meta?: {[key: ...]: ...; }; blob: string; mimeType?: string; uri: string; }; type: "resource"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ...[]; lastModified?: string; priority?: number; }; description?: string; icons?: object[]; mimeType?: string; name: string; size?: number; title?: string; type: "resource_link"; uri: string; })[]; isError?: boolean; structuredContent?: unknown; toolUseId: string; type: "tool_result"; } | ({ _meta?: {[key: string]: unknown; }; annotations?: { audience?: (... | ...)[]; lastModified?: string; priority?: number; }; text: string; type: "text"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: (... | ...)[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "image"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: (... | ...)[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "audio"; } | { _meta?: {[key: string]: unknown; }; id: string; input: {[key: string]: unknown; }; name: string; type: "tool_use"; } | { _meta?: {[key: string]: unknown; }; content: ({ _meta?: {[key: ...]: ...; }; annotations?: { audience?: ...; lastModified?: ...; priority?: ...; }; text: string; type: "text"; } | { _meta?: {[key: ...]: ...; }; annotations?: { audience?: ...; lastModified?: ...; priority?: ...; }; data: string; mimeType: string; type: "image"; } | { _meta?: {[key: ...]: ...; }; annotations?: { audience?: ...; lastModified?: ...; priority?: ...; }; data: string; mimeType: string; type: "audio"; } | { _meta?: {[key: ...]: ...; }; annotations?: { audience?: ...; lastModified?: ...; priority?: ...; }; resource: { _meta?: ...; mimeType?: ...; text: ...; uri: ...; } | { _meta?: ...; blob: ...; mimeType?: ...; uri: ...; }; type: "resource"; } | { _meta?: {[key: ...]: ...; }; annotations?: { audience?: ...; lastModified?: ...; priority?: ...; }; description?: string; icons?: ...[]; mimeType?: string; name: string; size?: number; title?: string; type: "resource_link"; uri: string; })[]; isError?: boolean; structuredContent?: unknown; toolUseId: string; type: "tool_result"; })[]; model: string; role: "user" | "assistant"; stopReason?: string; }>

Defined in: packages/server/src/server/server.ts:1031

Request LLM sampling from the client with tool support. Returns content that may be a single block or array (for parallel tool calls).

Parameters
params

CreateMessageRequestParamsWithTools

options?

RequestOptions

Returns

Promise<{[key: string]: unknown; _meta?: {[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; }; content: { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; text: string; type: "text"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "image"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "audio"; } | { _meta?: {[key: string]: unknown; }; id: string; input: {[key: string]: unknown; }; name: string; type: "tool_use"; } | { _meta?: {[key: string]: unknown; }; content: ({ _meta?: {[key: string]: unknown; }; annotations?: { audience?: ...[]; lastModified?: string; priority?: number; }; text: string; type: "text"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ...[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "image"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ...[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "audio"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ...[]; lastModified?: string; priority?: number; }; resource: { _meta?: {[key: ...]: ...; }; mimeType?: string; text: string; uri: string; } | { _meta?: {[key: ...]: ...; }; blob: string; mimeType?: string; uri: string; }; type: "resource"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ...[]; lastModified?: string; priority?: number; }; description?: string; icons?: object[]; mimeType?: string; name: string; size?: number; title?: string; type: "resource_link"; uri: string; })[]; isError?: boolean; structuredContent?: unknown; toolUseId: string; type: "tool_result"; } | ({ _meta?: {[key: string]: unknown; }; annotations?: { audience?: (... | ...)[]; lastModified?: string; priority?: number; }; text: string; type: "text"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: (... | ...)[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "image"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: (... | ...)[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "audio"; } | { _meta?: {[key: string]: unknown; }; id: string; input: {[key: string]: unknown; }; name: string; type: "tool_use"; } | { _meta?: {[key: string]: unknown; }; content: ({ _meta?: {[key: ...]: ...; }; annotations?: { audience?: ...; lastModified?: ...; priority?: ...; }; text: string; type: "text"; } | { _meta?: {[key: ...]: ...; }; annotations?: { audience?: ...; lastModified?: ...; priority?: ...; }; data: string; mimeType: string; type: "image"; } | { _meta?: {[key: ...]: ...; }; annotations?: { audience?: ...; lastModified?: ...; priority?: ...; }; data: string; mimeType: string; type: "audio"; } | { _meta?: {[key: ...]: ...; }; annotations?: { audience?: ...; lastModified?: ...; priority?: ...; }; resource: { _meta?: ...; mimeType?: ...; text: ...; uri: ...; } | { _meta?: ...; blob: ...; mimeType?: ...; uri: ...; }; type: "resource"; } | { _meta?: {[key: ...]: ...; }; annotations?: { audience?: ...; lastModified?: ...; priority?: ...; }; description?: string; icons?: ...[]; mimeType?: string; name: string; size?: number; title?: string; type: "resource_link"; uri: string; })[]; isError?: boolean; structuredContent?: unknown; toolUseId: string; type: "tool_result"; })[]; model: string; role: "user" | "assistant"; stopReason?: string; }>

Deprecated

Deprecated as of protocol version 2026-07-28 (SEP-2577). Throws on a 2026-07-28-era request — use inputRequired (multi-round-trip) instead, or migrate to calling LLM provider APIs directly. The 2025 push-style server-to-client request model is replaced by input_required results in the 2026-07-28 protocol. If your factory serves both eras, this only works on the legacy path.

Call Signature

createMessage(params, options?): Promise<{[key: string]: unknown; _meta?: {[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; }; content: { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; text: string; type: "text"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "image"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "audio"; }; model: string; role: "user" | "assistant"; stopReason?: string; } | {[key: string]: unknown; _meta?: {[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; }; content: { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; text: string; type: "text"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "image"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "audio"; } | { _meta?: {[key: string]: unknown; }; id: string; input: {[key: string]: unknown; }; name: string; type: "tool_use"; } | { _meta?: {[key: string]: unknown; }; content: ({ _meta?: {[key: string]: unknown; }; annotations?: { audience?: ... | ...; lastModified?: ... | ...; priority?: ... | ...; }; text: string; type: "text"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ... | ...; lastModified?: ... | ...; priority?: ... | ...; }; data: string; mimeType: string; type: "image"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ... | ...; lastModified?: ... | ...; priority?: ... | ...; }; data: string; mimeType: string; type: "audio"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ... | ...; lastModified?: ... | ...; priority?: ... | ...; }; resource: { _meta?: ... | ...; mimeType?: ... | ...; text: string; uri: string; } | { _meta?: ... | ...; blob: string; mimeType?: ... | ...; uri: string; }; type: "resource"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ... | ...; lastModified?: ... | ...; priority?: ... | ...; }; description?: string; icons?: object[]; mimeType?: string; name: string; size?: number; title?: string; type: "resource_link"; uri: string; })[]; isError?: boolean; structuredContent?: unknown; toolUseId: string; type: "tool_result"; } | ({ _meta?: {[key: string]: unknown; }; annotations?: { audience?: ...[]; lastModified?: string; priority?: number; }; text: string; type: "text"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ...[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "image"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ...[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "audio"; } | { _meta?: {[key: string]: unknown; }; id: string; input: {[key: string]: unknown; }; name: string; type: "tool_use"; } | { _meta?: {[key: string]: unknown; }; content: ({ _meta?: ... | ...; annotations?: ... | ...; text: string; type: "text"; } | { _meta?: ... | ...; annotations?: ... | ...; data: string; mimeType: string; type: "image"; } | { _meta?: ... | ...; annotations?: ... | ...; data: string; mimeType: string; type: "audio"; } | { _meta?: ... | ...; annotations?: ... | ...; resource: ... | ...; type: "resource"; } | { _meta?: ... | ...; annotations?: ... | ...; description?: ... | ...; icons?: ... | ...; mimeType?: ... | ...; name: string; size?: ... | ...; title?: ... | ...; type: "resource_link"; uri: string; })[]; isError?: boolean; structuredContent?: unknown; toolUseId: string; type: "tool_result"; })[]; model: string; role: "user" | "assistant"; stopReason?: string; }>

Defined in: packages/server/src/server/server.ts:1043

Request LLM sampling from the client. When tools may or may not be present, returns the union type.

Parameters
params
_meta?

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

See General fields: _meta for notes on _meta usage.

{ taskId: string; } = ...

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

string = ...

_meta.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.

includeContext?

"none" | "thisServer" | "allServers" = ...

A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request.

Default is "none". The values "thisServer" and "allServers" are deprecated (SEP-2596): servers SHOULD omit this field or use "none", and SHOULD only use the deprecated values if the client declares ClientCapabilities.sampling.context.

Deprecated

The "thisServer" and "allServers" values are deprecated as of protocol version 2025-11-25 (SEP-2596) and will be removed no later than the Sampling feature itself (SEP-2577). Omit this field or use "none".

maxTokens

number = ...

The requested maximum number of tokens to sample (to prevent runaway completions).

The client MAY choose to sample fewer tokens than the requested maximum.

messages

object[] = ...

metadata?

{[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; } = ...

Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.

modelPreferences?

{ costPriority?: number; hints?: object[]; intelligencePriority?: number; speedPriority?: number; } = ...

The server's preferences for which model to select. The client MAY modify or omit this request.

modelPreferences.costPriority?

number = ...

How much to prioritize cost when selecting a model.

modelPreferences.hints?

object[] = ...

Optional hints to use for model selection.

modelPreferences.intelligencePriority?

number = ...

How much to prioritize intelligence and capabilities when selecting a model.

modelPreferences.speedPriority?

number = ...

How much to prioritize sampling speed (latency) when selecting a model.

stopSequences?

string[] = ...

systemPrompt?

string = ...

An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.

task?

{ ttl?: number; } = ...

If specified, the caller is requesting task-augmented execution for this request. The request will return a CreateTaskResult immediately, and the actual result can be retrieved later via tasks/result.

Task augmentation is subject to capability negotiation - receivers MUST declare support for task augmentation of specific request types in their capabilities.

task.ttl?

number = ...

temperature?

number = ...

toolChoice?

{ mode?: "required" | "auto" | "none"; } = ...

Controls how the model uses tools. The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared. Default is { mode: "auto" }.

toolChoice.mode?

"required" | "auto" | "none" = ...

Controls when tools are used:

  • "auto": Model decides whether to use tools (default)
  • "required": Model MUST use at least one tool before completing
  • "none": Model MUST NOT use any tools
tools?

object[] = ...

Tools that the model may use during generation. The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.

options?

RequestOptions

Returns

Promise<{[key: string]: unknown; _meta?: {[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; }; content: { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; text: string; type: "text"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "image"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "audio"; }; model: string; role: "user" | "assistant"; stopReason?: string; } | {[key: string]: unknown; _meta?: {[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; }; content: { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; text: string; type: "text"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "image"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "audio"; } | { _meta?: {[key: string]: unknown; }; id: string; input: {[key: string]: unknown; }; name: string; type: "tool_use"; } | { _meta?: {[key: string]: unknown; }; content: ({ _meta?: {[key: string]: unknown; }; annotations?: { audience?: ... | ...; lastModified?: ... | ...; priority?: ... | ...; }; text: string; type: "text"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ... | ...; lastModified?: ... | ...; priority?: ... | ...; }; data: string; mimeType: string; type: "image"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ... | ...; lastModified?: ... | ...; priority?: ... | ...; }; data: string; mimeType: string; type: "audio"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ... | ...; lastModified?: ... | ...; priority?: ... | ...; }; resource: { _meta?: ... | ...; mimeType?: ... | ...; text: string; uri: string; } | { _meta?: ... | ...; blob: string; mimeType?: ... | ...; uri: string; }; type: "resource"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ... | ...; lastModified?: ... | ...; priority?: ... | ...; }; description?: string; icons?: object[]; mimeType?: string; name: string; size?: number; title?: string; type: "resource_link"; uri: string; })[]; isError?: boolean; structuredContent?: unknown; toolUseId: string; type: "tool_result"; } | ({ _meta?: {[key: string]: unknown; }; annotations?: { audience?: ...[]; lastModified?: string; priority?: number; }; text: string; type: "text"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ...[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "image"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ...[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "audio"; } | { _meta?: {[key: string]: unknown; }; id: string; input: {[key: string]: unknown; }; name: string; type: "tool_use"; } | { _meta?: {[key: string]: unknown; }; content: ({ _meta?: ... | ...; annotations?: ... | ...; text: string; type: "text"; } | { _meta?: ... | ...; annotations?: ... | ...; data: string; mimeType: string; type: "image"; } | { _meta?: ... | ...; annotations?: ... | ...; data: string; mimeType: string; type: "audio"; } | { _meta?: ... | ...; annotations?: ... | ...; resource: ... | ...; type: "resource"; } | { _meta?: ... | ...; annotations?: ... | ...; description?: ... | ...; icons?: ... | ...; mimeType?: ... | ...; name: string; size?: ... | ...; title?: ... | ...; type: "resource_link"; uri: string; })[]; isError?: boolean; structuredContent?: unknown; toolUseId: string; type: "tool_result"; })[]; model: string; role: "user" | "assistant"; stopReason?: string; }>

Deprecated

Deprecated as of protocol version 2026-07-28 (SEP-2577). Throws on a 2026-07-28-era request — use inputRequired (multi-round-trip) instead, or migrate to calling LLM provider APIs directly. The 2025 push-style server-to-client request model is replaced by input_required results in the 2026-07-28 protocol. If your factory serves both eras, this only works on the legacy path.

elicitInput()

elicitInput(params, options?): Promise<{[key: string]: unknown; _meta?: {[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; }; action: "cancel" | "accept" | "decline"; content?: {[key: string]: string | number | boolean | string[]; }; }>

Defined in: packages/server/src/server/server.ts:1136

Creates an elicitation request for the given parameters. For backwards compatibility, mode may be omitted for form requests and will default to "form".

Parameters
params

{ _meta?: {[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; }; message: string; mode?: "form"; requestedSchema: {[key: string]: unknown; properties: {[key: string]: { default?: boolean; description?: string; title?: string; type: "boolean"; } | { default?: string; description?: string; format?: "date" | "uri" | "email" | "date-time"; maxLength?: number; minLength?: number; title?: string; type: "string"; } | { default?: number; description?: string; maximum?: number; minimum?: number; title?: string; type: "number" | "integer"; } | { default?: string; description?: string; enum: string[]; enumNames?: string[]; title?: string; type: "string"; } | { default?: string; description?: string; enum: string[]; title?: string; type: "string"; } | { default?: string; description?: string; oneOf: object[]; title?: string; type: "string"; } | { default?: string[]; description?: string; items: { enum: string[]; type: "string"; }; maxItems?: number; minItems?: number; title?: string; type: "array"; } | { default?: string[]; description?: string; items: { anyOf: object[]; }; maxItems?: number; minItems?: number; title?: string; type: "array"; }; }; required?: string[]; type: "object"; }; task?: { ttl?: number; }; } | { _meta?: {[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; }; elicitationId: string; message: string; mode: "url"; task?: { ttl?: number; }; url: string; }

The parameters for the elicitation request.

Type Literal

{ _meta?: {[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; }; message: string; mode?: "form"; requestedSchema: {[key: string]: unknown; properties: {[key: string]: { default?: boolean; description?: string; title?: string; type: "boolean"; } | { default?: string; description?: string; format?: "date" | "uri" | "email" | "date-time"; maxLength?: number; minLength?: number; title?: string; type: "string"; } | { default?: number; description?: string; maximum?: number; minimum?: number; title?: string; type: "number" | "integer"; } | { default?: string; description?: string; enum: string[]; enumNames?: string[]; title?: string; type: "string"; } | { default?: string; description?: string; enum: string[]; title?: string; type: "string"; } | { default?: string; description?: string; oneOf: object[]; title?: string; type: "string"; } | { default?: string[]; description?: string; items: { enum: string[]; type: "string"; }; maxItems?: number; minItems?: number; title?: string; type: "array"; } | { default?: string[]; description?: string; items: { anyOf: object[]; }; maxItems?: number; minItems?: number; title?: string; type: "array"; }; }; required?: string[]; type: "object"; }; task?: { ttl?: number; }; }

The parameters for the elicitation request.

_meta?

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

See General fields: _meta for notes on _meta usage.

{ taskId: string; } = ...

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

string = ...

_meta.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.

message

string = ...

The message to present to the user describing what information is being requested.

mode?

"form" = ...

The elicitation mode.

Optional for backward compatibility. Clients MUST treat missing mode as "form".

requestedSchema

{[key: string]: unknown; properties: {[key: string]: { default?: boolean; description?: string; title?: string; type: "boolean"; } | { default?: string; description?: string; format?: "date" | "uri" | "email" | "date-time"; maxLength?: number; minLength?: number; title?: string; type: "string"; } | { default?: number; description?: string; maximum?: number; minimum?: number; title?: string; type: "number" | "integer"; } | { default?: string; description?: string; enum: string[]; enumNames?: string[]; title?: string; type: "string"; } | { default?: string; description?: string; enum: string[]; title?: string; type: "string"; } | { default?: string; description?: string; oneOf: object[]; title?: string; type: "string"; } | { default?: string[]; description?: string; items: { enum: string[]; type: "string"; }; maxItems?: number; minItems?: number; title?: string; type: "array"; } | { default?: string[]; description?: string; items: { anyOf: object[]; }; maxItems?: number; minItems?: number; title?: string; type: "array"; }; }; required?: string[]; type: "object"; } = ...

A restricted subset of JSON Schema. Only top-level properties are allowed, without nesting.

requestedSchema.properties

{[key: string]: { default?: boolean; description?: string; title?: string; type: "boolean"; } | { default?: string; description?: string; format?: "date" | "uri" | "email" | "date-time"; maxLength?: number; minLength?: number; title?: string; type: "string"; } | { default?: number; description?: string; maximum?: number; minimum?: number; title?: string; type: "number" | "integer"; } | { default?: string; description?: string; enum: string[]; enumNames?: string[]; title?: string; type: "string"; } | { default?: string; description?: string; enum: string[]; title?: string; type: "string"; } | { default?: string; description?: string; oneOf: object[]; title?: string; type: "string"; } | { default?: string[]; description?: string; items: { enum: string[]; type: "string"; }; maxItems?: number; minItems?: number; title?: string; type: "array"; } | { default?: string[]; description?: string; items: { anyOf: object[]; }; maxItems?: number; minItems?: number; title?: string; type: "array"; }; } = ...

requestedSchema.required?

string[] = ...

requestedSchema.type

"object" = ...

task?

{ ttl?: number; } = ...

If specified, the caller is requesting task-augmented execution for this request. The request will return a CreateTaskResult immediately, and the actual result can be retrieved later via tasks/result.

Task augmentation is subject to capability negotiation - receivers MUST declare support for task augmentation of specific request types in their capabilities.

task.ttl?

number = ...


Type Literal

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

The parameters for the elicitation request.

_meta?

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

See General fields: _meta for notes on _meta usage.

{ taskId: string; } = ...

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

string = ...

_meta.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.

elicitationId

string = ...

The ID of the elicitation, which must be unique within the context of the server. The client MUST treat this ID as an opaque value.

Deprecated

Removed from the spec by #2891 (2026-07-28). The client learns the outcome of an out-of-band interaction by retrying the original request; no server-initiated completion signal exists in the 2026-07-28 revision. Kept here for the 2025-era URL-mode flow only.

message

string = ...

The message to present to the user explaining why the interaction is needed.

mode

"url" = ...

The elicitation mode.

task?

{ ttl?: number; } = ...

If specified, the caller is requesting task-augmented execution for this request. The request will return a CreateTaskResult immediately, and the actual result can be retrieved later via tasks/result.

Task augmentation is subject to capability negotiation - receivers MUST declare support for task augmentation of specific request types in their capabilities.

task.ttl?

number = ...

url

string = ...

The URL that the user should navigate to.

options?

RequestOptions

Optional request options.

Returns

Promise<{[key: string]: unknown; _meta?: {[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; }; action: "cancel" | "accept" | "decline"; content?: {[key: string]: string | number | boolean | string[]; }; }>

The result of the elicitation request.

Deprecated

Throws on a 2026-07-28-era request — use inputRequired (multi-round-trip) instead. The 2025 push-style server-to-client request model is replaced by input_required results in the 2026-07-28 protocol. If your factory serves both eras, this only works on the legacy path.

getCapabilities()

getCapabilities(): object

Defined in: packages/server/src/server/server.ts:994

Returns the current server capabilities.

Returns
completions?

optional completions?: object

Present if the server supports sending completions to the client.

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 server supports.

Index Signature

[key: string]: object

extensions?

optional extensions?: object

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

Index Signature

[key: string]: object

logging?

optional logging?: object

Present if the server supports sending log messages to the client.

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

Deprecated

Deprecated as of protocol version 2026-07-28 (SEP-2577); remains in the specification for at least twelve months. Migrate to stderr logging (STDIO servers) or OpenTelemetry.

prompts?

optional prompts?: object

Present if the server offers any prompt templates.

prompts.listChanged?

optional listChanged?: boolean

Whether this server supports issuing notifications for changes to the prompt list.

resources?

optional resources?: object

Present if the server offers any resources to read.

resources.listChanged?

optional listChanged?: boolean

Whether this server supports issuing notifications for changes to the resource list.

resources.subscribe?

optional subscribe?: boolean

Whether this server supports clients subscribing to resource updates.

tasks?

optional tasks?: object

Present if the server 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 server 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 server 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.tools?

optional tools?: object

Task support for tool requests.

Index Signature

[key: string]: unknown

tasks.requests.tools.call?

optional call?: 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

tools?

optional tools?: object

Present if the server offers any tools to call.

tools.listChanged?

optional listChanged?: boolean

Whether this server supports issuing notifications for changes to the tool list.

getClientCapabilities()

getClientCapabilities(): { 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; }; }; experimental?: {[key: string]: object; }; extensions?: {[key: string]: object; }; roots?: { listChanged?: boolean; }; 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; }; }; 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]: ... | ... | ... | ... | ... | ... | ...; }; }; sampling?: {[key: string]: unknown; createMessage?: {[key: string]: ... | ... | ... | ... | ... | ... | ...; }; }; }; }; } | undefined

Defined in: packages/server/src/server/server.ts:937

After initialization has completed, this will be populated with the client's reported capabilities.

Returns
Type Literal

{ 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; }; }; experimental?: {[key: string]: object; }; extensions?: {[key: string]: object; }; roots?: { listChanged?: boolean; }; 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; }; }; 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]: ... | ... | ... | ... | ... | ... | ...; }; }; sampling?: {[key: string]: unknown; createMessage?: {[key: string]: ... | ... | ... | ... | ... | ... | ...; }; }; }; }; }

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]: ... | ... | ... | ... | ... | ... | ...

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]: ... | ... | ... | ... | ... | ... | ...


undefined

Deprecated

Read client identity from the per-request handler context instead: on 2026-07-28 (per-request envelope) requests ctx.mcpReq.envelope carries the client's declared capabilities, while on 2025-era connections this accessor keeps returning the initialize-scoped value. The accessor remains functional — instances serving the 2026-07-28 era are backfilled per request from the validated envelope.

getClientVersion()

getClientVersion(): { description?: string; icons?: object[]; name: string; title?: string; version: string; websiteUrl?: string; } | undefined

Defined in: packages/server/src/server/server.ts:950

After initialization has completed, this will be populated with information about the client's name and version.

Returns
Type Literal

{ description?: string; icons?: object[]; name: string; title?: string; version: string; websiteUrl?: string; }

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.


undefined

Deprecated

Read client identity from the per-request handler context instead: on 2026-07-28 (per-request envelope) requests ctx.mcpReq.envelope carries the client's name and version, while on 2025-era connections this accessor keeps returning the initialize-scoped value. The accessor remains functional — instances serving the 2026-07-28 era are backfilled per request from the validated envelope.

getNegotiatedProtocolVersion()

getNegotiatedProtocolVersion(): string | undefined

Defined in: packages/server/src/server/server.ts:965

After initialization has completed, this will be populated with the protocol version negotiated with the client (the version the server responded with during the initialize handshake), or undefined before initialization.

Returns

string | undefined

Deprecated

Read the protocol revision from the per-request handler context instead: on 2026-07-28 (per-request envelope) requests ctx.mcpReq.envelope names the revision the request was sent for, while on 2025-era connections this accessor keeps returning the initialize-negotiated version. The accessor remains functional — instances serving the 2026-07-28 era report that revision.

listRoots()

listRoots(params?, options?): Promise<{[key: string]: unknown; _meta?: {[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; }; roots: object[]; }>

Defined in: packages/server/src/server/server.ts:1255

Requests the list of roots from the client.

Parameters
params?
_meta?

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

See General fields: _meta for notes on _meta usage.

{ taskId: string; } = ...

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

string = ...

_meta.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.

options?

RequestOptions

Returns

Promise<{[key: string]: unknown; _meta?: {[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; }; roots: object[]; }>

Deprecated

Deprecated as of protocol version 2026-07-28 (SEP-2577). Throws on a 2026-07-28-era request — use inputRequired (multi-round-trip) instead, or migrate to passing paths via tool parameters, resource URIs, or configuration. The 2025 push-style server-to-client request model is replaced by input_required results in the 2026-07-28 protocol. If your factory serves both eras, this only works on the legacy path.

notification()

notification(notification, options?): Promise<void>

Defined in: packages/core-internal/src/shared/protocol.ts:1582

Emits a notification, which is a one-way message that does not expect a response.

Parameters
notification
method

string = ...

params?

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

params._meta?

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

See MCP specification for notes on _meta usage.

{ taskId: string; } = ...

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

string = ...

params._meta.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.

options?

NotificationOptions

Returns

Promise<void>

Inherited from

Protocol.notification

ping()

ping(): Promise<{ _meta?: {[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; }; }>

Defined in: packages/server/src/server/server.ts:1004

Sends a ping request to the connected client.

Returns

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

Deprecated

The 2026-07-28 protocol removed ping; it throws on a 2026-07-28-era instance. If your factory serves both eras, this only works on the legacy path.

projectCallToolResult()

projectCallToolResult(result, advertisedOutputSchema): object

Defined in: packages/server/src/server/server.ts:984

Project a tools/call result through this instance's negotiated wire codec — the era-agnostic SEP-2106 §4.3 TextContent auto-append, plus on the 2025 era the {result:…} wrap when structuredContent is a non-object value or the advertised outputSchema had a non-object root. Identity for object-shaped structuredContent on the 2026 era.

McpServer's built-in tools/call handler routes through this method. Low-level setRequestHandler('tools/call', …) authors call it themselves so the projection lives in one place (the codec) and the server-side handler stays era-blind.

This is the only codec function exposed on Server — the full WireCodec is intentionally not part of the public surface.

Parameters
result
_meta?

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

See MCP specification for notes on _meta usage.

{ taskId: string; } = ...

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

string = ...

_meta.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.

content

({ _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; text: string; type: "text"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "image"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "audio"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; resource: { _meta?: {[key: string]: unknown; }; mimeType?: string; text: string; uri: string; } | { _meta?: {[key: string]: unknown; }; blob: string; mimeType?: string; uri: string; }; type: "resource"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; description?: string; icons?: object[]; mimeType?: string; name: string; size?: number; title?: string; type: "resource_link"; uri: string; })[] = ...

A list of content objects that represent the result of the tool call.

If the Tool does not define an outputSchema, this field MUST be present in the result. Required on the wire per the specification (it may be an empty array).

Parse-tolerant: absent content defaults to [] (v1 parity — deployed servers omit it alongside structuredContent).

isError?

boolean = ...

Whether the tool call ended in an error.

If not set, this is assumed to be false (the call was successful).

Any errors that originate from the tool SHOULD be reported inside the result object, with isError set to true, not as an MCP protocol-level error response. Otherwise, the LLM would not be able to see that an error occurred and self-correct.

However, any errors in finding the tool, an error indicating that the server does not support tool calls, or any other exceptional conditions, should be reported as an MCP error response.

structuredContent?

unknown = ...

Structured tool output.

If the Tool defines an outputSchema, this field MUST be present in the result and contain a JSON value that matches the schema.

SEP-2106: any JSON value is permitted (arrays, primitives, null). Narrow before property access. The 2025-11-25 wire parse retains the object-only constraint via the frozen schema in wire/rev2025-11-25/schemas.ts; this neutral/public schema widens.

advertisedOutputSchema

Readonly<Record<string, unknown>> | undefined

Returns
_meta?

optional _meta?: object

See MCP specification 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

_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.

content

content: ({ _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; text: string; type: "text"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "image"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "audio"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; resource: { _meta?: {[key: string]: unknown; }; mimeType?: string; text: string; uri: string; } | { _meta?: {[key: string]: unknown; }; blob: string; mimeType?: string; uri: string; }; type: "resource"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; description?: string; icons?: object[]; mimeType?: string; name: string; size?: number; title?: string; type: "resource_link"; uri: string; })[]

A list of content objects that represent the result of the tool call.

If the Tool does not define an outputSchema, this field MUST be present in the result. Required on the wire per the specification (it may be an empty array).

Parse-tolerant: absent content defaults to [] (v1 parity — deployed servers omit it alongside structuredContent).

isError?

optional isError?: boolean

Whether the tool call ended in an error.

If not set, this is assumed to be false (the call was successful).

Any errors that originate from the tool SHOULD be reported inside the result object, with isError set to true, not as an MCP protocol-level error response. Otherwise, the LLM would not be able to see that an error occurred and self-correct.

However, any errors in finding the tool, an error indicating that the server does not support tool calls, or any other exceptional conditions, should be reported as an MCP error response.

structuredContent?

optional structuredContent?: unknown

Structured tool output.

If the Tool defines an outputSchema, this field MUST be present in the result and contain a JSON value that matches the schema.

SEP-2106: any JSON value is permitted (arrays, primitives, null). Narrow before property access. The 2025-11-25 wire parse retains the object-only constraint via the frozen schema in wire/rev2025-11-25/schemas.ts; this neutral/public schema widens.

registerCapabilities()

registerCapabilities(capabilities): void

Defined in: packages/server/src/server/server.ts:435

Registers new capabilities. This can only be called before connecting to a transport.

The new capabilities will be merged with any existing capabilities previously given (e.g., at initialization).

Parameters
capabilities
completions?

{[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 server supports sending completions to the client.

experimental?

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

Experimental, non-standard capabilities that the server supports.

extensions?

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

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

logging?

{[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 server supports sending log messages to the client.

Deprecated

Deprecated as of protocol version 2026-07-28 (SEP-2577); remains in the specification for at least twelve months. Migrate to stderr logging (STDIO servers) or OpenTelemetry.

prompts?

{ listChanged?: boolean; } = ...

Present if the server offers any prompt templates.

prompts.listChanged?

boolean = ...

Whether this server supports issuing notifications for changes to the prompt list.

resources?

{ listChanged?: boolean; subscribe?: boolean; } = ...

Present if the server offers any resources to read.

resources.listChanged?

boolean = ...

Whether this server supports issuing notifications for changes to the resource list.

resources.subscribe?

boolean = ...

Whether this server supports clients subscribing to resource updates.

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; tools?: {[key: string]: unknown; call?: {[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 server 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 server 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 server supports listing tasks.

tasks.requests?

{[key: string]: unknown; tools?: {[key: string]: unknown; call?: {[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.tools?

{[key: string]: unknown; call?: {[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 tool requests.

tasks.requests.tools.call?

{[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; } = ...

tools?

{ listChanged?: boolean; } = ...

Present if the server offers any tools to call.

tools.listChanged?

boolean = ...

Whether this server supports issuing notifications for changes to the tool list.

Returns

void

removeNotificationHandler()

removeNotificationHandler(method): void

Defined in: packages/core-internal/src/shared/protocol.ts:1841

Removes the notification handler for the given method.

Parameters
method

string

Returns

void

Inherited from

Protocol.removeNotificationHandler

removeRequestHandler()

removeRequestHandler(method): void

Defined in: packages/core-internal/src/shared/protocol.ts:1758

Removes the request handler for the given method.

Parameters
method

string

Returns

void

Inherited from

Protocol.removeRequestHandler

request()
Call Signature

request<M>(request, options?): Promise<ResultTypeMap[M]>

Defined in: packages/core-internal/src/shared/protocol.ts:1259

Sends a request and waits for a response.

For spec methods the result schema is resolved automatically from the method name and the return type is method-keyed. For custom (non-spec) methods, pass a resultSchema as the second argument; the response is validated against it and the return type is inferred from the schema.

Do not use this method to emit notifications! Use notification() instead.

Type Parameters
M

M extends RequestMethod

Parameters
request
method

M

params?

Record<string, unknown>

options?

RequestOptions

Returns

Promise<ResultTypeMap[M]>

Inherited from

Protocol.request

Call Signature

request<T>(request, resultSchema, options?): Promise<InferOutput<T>>

Defined in: packages/core-internal/src/shared/protocol.ts:1263

Sends a request and waits for a response.

For spec methods the result schema is resolved automatically from the method name and the return type is method-keyed. For custom (non-spec) methods, pass a resultSchema as the second argument; the response is validated against it and the return type is inferred from the schema.

Do not use this method to emit notifications! Use notification() instead.

Type Parameters
T

T extends StandardSchemaV1<unknown, unknown>

Parameters
request
method

string = ...

params?

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

params._meta?

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

See General fields: _meta for notes on _meta usage.

{ taskId: string; } = ...

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

string = ...

params._meta.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.

resultSchema

T

options?

RequestOptions

Returns

Promise<InferOutput<T>>

Inherited from

Protocol.request

sendLoggingMessage()

sendLoggingMessage(params, sessionId?): Promise<void>

Defined in: packages/server/src/server/server.ts:1271

Sends a logging message to the client, if connected. Note: You only need to send the parameters object, not the entire JSON-RPC message.

Parameters
params
_meta?

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

See MCP specification for notes on _meta usage.

{ taskId: string; } = ...

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

string = ...

_meta.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.

data

unknown = ...

The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here.

level

"debug" | "error" | "info" | "notice" | "warning" | "critical" | "alert" | "emergency" = LoggingLevelSchema

The severity of this log message.

logger?

string = ...

An optional name of the logger issuing this message.

sessionId?

string

Optional for stateless transports and backward compatibility.

Returns

Promise<void>

See

LoggingMessageNotification

Deprecated

Deprecated as of protocol version 2026-07-28 (SEP-2577). Remains functional during the deprecation window (at least twelve months). Migrate to stderr logging (STDIO servers) or OpenTelemetry.

sendPromptListChanged()

sendPromptListChanged(): Promise<void>

Defined in: packages/server/src/server/server.ts:1294

Returns

Promise<void>

sendResourceListChanged()

sendResourceListChanged(): Promise<void>

Defined in: packages/server/src/server/server.ts:1284

Returns

Promise<void>

sendResourceUpdated()

sendResourceUpdated(params): Promise<void>

Defined in: packages/server/src/server/server.ts:1277

Parameters
params
_meta?

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

See MCP specification for notes on _meta usage.

{ taskId: string; } = ...

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

string = ...

_meta.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.

uri

string = ...

The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.

Returns

Promise<void>

sendToolListChanged()

sendToolListChanged(): Promise<void>

Defined in: packages/server/src/server/server.ts:1290

Returns

Promise<void>

setNotificationHandler()
Call Signature

setNotificationHandler<M>(method, handler): void

Defined in: packages/core-internal/src/shared/protocol.ts:1784

Registers a handler to invoke when this protocol object receives a notification with the given method.

Note that this will replace any previous notification handler for the same method.

For spec methods, pass (method, handler); the notification is parsed with the spec schema. For custom (non-spec) methods, pass (method, schemas, handler); params are validated against schemas.params and the handler receives the parsed params object directly. The raw notification is passed as the second argument; _meta is recoverable via notification.params?._meta (minus the reserved io.modelcontextprotocol/* envelope keys, which the protocol layer lifts out before dispatch).

Type Parameters
M

M extends NotificationMethod

Parameters
method

M

handler

(notification) => void | Promise<void>

Returns

void

Inherited from

Protocol.setNotificationHandler

Call Signature

setNotificationHandler<P>(method, schemas, handler): void

Defined in: packages/core-internal/src/shared/protocol.ts:1788

Registers a handler to invoke when this protocol object receives a notification with the given method.

Note that this will replace any previous notification handler for the same method.

For spec methods, pass (method, handler); the notification is parsed with the spec schema. For custom (non-spec) methods, pass (method, schemas, handler); params are validated against schemas.params and the handler receives the parsed params object directly. The raw notification is passed as the second argument; _meta is recoverable via notification.params?._meta (minus the reserved io.modelcontextprotocol/* envelope keys, which the protocol layer lifts out before dispatch).

Type Parameters
P

P extends StandardSchemaV1<unknown, unknown>

Parameters
method

string

schemas
params

P

handler

(params, notification) => void | Promise<void>

Returns

void

Inherited from

Protocol.setNotificationHandler

setRequestHandler()
Call Signature

setRequestHandler<M>(method, handler): void

Defined in: packages/core-internal/src/shared/protocol.ts:1668

Registers a handler to invoke when this protocol object receives a request with the given method.

Note that this will replace any previous request handler for the same method.

For spec methods, pass (method, handler); the request is parsed with the spec schema and the handler receives the typed Request. For custom (non-spec) methods, pass (method, schemas, handler); params are validated against schemas.params and the handler receives the parsed params object directly. Supplying schemas.result types the handler's return value.

Type Parameters
M

M extends RequestMethod

Parameters
method

M

handler

(request, ctx) => HandlerResultTypeMap[M] | Promise<HandlerResultTypeMap[M]>

Returns

void

Example

Custom request method

ts
const SearchParams = z.object({ query: z.string(), limit: z.number().optional() });
const SearchResult = z.object({ hits: z.array(z.string()) });

protocol.setRequestHandler('acme/search', { params: SearchParams, result: SearchResult }, async (params, _ctx) => {
    return { hits: [`result for ${params.query}`] };
});
Inherited from

Protocol.setRequestHandler

Call Signature

setRequestHandler<P, R>(method, schemas, handler): void

Defined in: packages/core-internal/src/shared/protocol.ts:1672

Registers a handler to invoke when this protocol object receives a request with the given method.

Note that this will replace any previous request handler for the same method.

For spec methods, pass (method, handler); the request is parsed with the spec schema and the handler receives the typed Request. For custom (non-spec) methods, pass (method, schemas, handler); params are validated against schemas.params and the handler receives the parsed params object directly. Supplying schemas.result types the handler's return value.

Type Parameters
P

P extends StandardSchemaV1<unknown, unknown>

R

R extends StandardSchemaV1<unknown, unknown> | undefined = undefined

Parameters
method

string

schemas
params

P

result?

R

handler

(params, ctx) => InferHandlerResult<R> | Promise<InferHandlerResult<R>>

Returns

void

Example

Custom request method

ts
const SearchParams = z.object({ query: z.string(), limit: z.number().optional() });
const SearchResult = z.object({ hits: z.array(z.string()) });

protocol.setRequestHandler('acme/search', { params: SearchParams, result: SearchResult }, async (params, _ctx) => {
    return { hits: [`result for ${params.query}`] };
});
Inherited from

Protocol.setRequestHandler

Interfaces

PerRequestClientIdentity

Defined in: packages/server/src/server/server.ts:211

Connection-scoped client-identity fields backfilled per request from a validated _meta envelope.

Properties

clientCapabilities?

optional clientCapabilities?: object

Defined in: packages/server/src/server/server.ts:215

The client's declared capabilities, when the envelope carried them.

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]: ... | ... | ... | ... | ... | ... | ...

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]: ... | ... | ... | ... | ... | ... | ...

clientInfo?

optional clientInfo?: object

Defined in: packages/server/src/server/server.ts:213

The client's name/version information, when the envelope carried it.

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.

Type Aliases

ServerOptions

ServerOptions = ProtocolOptions & object

Defined in: packages/server/src/server/server.ts:75

Type Declaration

cacheHints?

optional cacheHints?: Partial<Record<CacheableResultMethod, CacheHint>>

Cache hints for the cacheable results of the 2026-07-28 protocol revision (ttlMs / cacheScope), keyed by operation. The cacheable operations are tools/list, prompts/list, resources/list, resources/templates/list, resources/read and server/discover. The hint is used when the result for that operation does not provide its own cache fields — most useful for the list results and server/discover, which the SDK builds itself. A hint registered with an individual resource (registerResource(..., { cacheHint })) takes precedence for that resource's resources/read results, field by field: a field the per-resource hint leaves unset still falls back to the per-operation hint configured here.

Absent hints (or omitting this option entirely) keep today's behavior: cacheable 2026-07-28 results are emitted with ttlMs: 0 and cacheScope: 'private'. Responses to 2025-era requests are never affected. Invalid values throw a RangeError at construction time.

capabilities?

optional capabilities?: ServerCapabilities

Capabilities to advertise as being supported by this server.

Note: per the MCP spec, a server that declares a capability MUST respond to that capability's requests (e.g. tools/list for tools) — potentially with an empty result — rather than with a "Method not found" error. McpServer handles this automatically for capabilities declared here; when using the low-level Server directly, you are responsible for registering a request handler for every capability you declare.

inputRequired?

optional inputRequired?: object

Multi-round-trip serving knobs. On 2026-era requests the client fulfils input_required returns; on 2025-era connections the SDK's legacy shim fulfils them server-side (real server→client requests + handler re-entry), so handlers are written once and serve both eras.

inputRequired.legacyShim?

optional legacyShim?: boolean

false disables the shim: an input_required return on a 2025-era request fails loudly (the pre-shim behavior).

Default
ts
true
inputRequired.maxRounds?

optional maxRounds?: number

Handler re-entries per originating request before the shim fails (tools/call: isError result; prompts/resources: JSON-RPC error).

Default
ts
8
inputRequired.roundTimeoutMs?

optional roundTimeoutMs?: number

Per-leg timeout (ms) for the shim's embedded server→client requests, sent with resetTimeoutOnProgress: true. Human-paced — deliberately far above the 60s protocol default.

Default
ts
600_000
instructions?

optional instructions?: string

Optional instructions describing how to use the server and its features.

jsonSchemaValidator?

optional jsonSchemaValidator?: jsonSchemaValidator

JSON Schema validator for elicitation response validation.

The validator is used to validate user input returned from elicitation requests against the requested schema.

Default

Runtime-selected validator (AJV-backed on Node.js, @cfworker/json-schema-backed on browser/workerd runtimes)

requestState?

optional requestState?: object

Multi-round-trip requestState integrity hook (protocol revision 2026-07-28).

requestState.verify?

optional verify?: (state, ctx) => unknown | Promise<unknown>

Called on every multi-round-trip request round whose echoed requestState is a string (i.e. whenever ctx.mcpReq.requestState() would return one), BEFORE the handler runs — including the legacy shim's in-process rounds. Throw or reject to refuse the request: the seam answers with a wire-level -32602 Invalid Params error whose message is frozen to "Invalid or expired requestState" and whose data.reason is 'invalid_request_state' — the thrown reason is surfaced via the server's onerror callback only and never reaches the wire.

This is the place to put HMAC or AEAD verification of requestState. The spec MUST for integrity-protecting state that influences authorization, resource access, or business logic is on the server author (basic/patterns/mrtr, server requirements 4–5); the SDK provides NO default verification — createRequestStateCodec is the SDK-provided HMAC helper whose verify drops in here directly. Leaving this option unconfigured keeps the passthrough behavior — ctx.mcpReq.requestState() returns the raw wire string, which MUST be treated as attacker-controlled input.

The resolved value is LOAD-BEARING: when the hook resolves with a non-undefined value — as RequestStateCodec.verify does (the decoded payload) — the seam hands THAT value to the handler via the typed ctx.mcpReq.requestState<T>() accessor, so a codec-using handler reads its verified state with no second decode call. A verifier that is not also the decoder should resolve undefined (return nothing) to keep the accessor on the raw wire string — resolving an incidental value (e.g. a boolean verification flag) would replace what the handler reads.

Parameters
state

string

ctx

ServerContext

Returns

unknown | Promise<unknown>

Functions

discoverAdvertisedCapabilities()

discoverAdvertisedCapabilities(capabilities): object

Defined in: packages/server/src/server/server.ts:1308

The capability set a server advertises on server/discover. Pure — never mutates the input; the legacy initialize advertisement is untouched.

The serving entries serve subscriptions/listen themselves, so the listChanged and resources.subscribe capability bits are advertised as-is: a modern-era client uses them to decide which notification types to request on its listen filter.

Parameters

capabilities
completions?

{[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 server supports sending completions to the client.

experimental?

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

Experimental, non-standard capabilities that the server supports.

extensions?

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

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

logging?

{[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 server supports sending log messages to the client.

Deprecated

Deprecated as of protocol version 2026-07-28 (SEP-2577); remains in the specification for at least twelve months. Migrate to stderr logging (STDIO servers) or OpenTelemetry.

prompts?

{ listChanged?: boolean; } = ...

Present if the server offers any prompt templates.

prompts.listChanged?

boolean = ...

Whether this server supports issuing notifications for changes to the prompt list.

resources?

{ listChanged?: boolean; subscribe?: boolean; } = ...

Present if the server offers any resources to read.

resources.listChanged?

boolean = ...

Whether this server supports issuing notifications for changes to the resource list.

resources.subscribe?

boolean = ...

Whether this server supports clients subscribing to resource updates.

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; tools?: {[key: string]: unknown; call?: {[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 server 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 server 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 server supports listing tasks.

tasks.requests?

{[key: string]: unknown; tools?: {[key: string]: unknown; call?: {[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.tools?

{[key: string]: unknown; call?: {[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 tool requests.

tasks.requests.tools.call?

{[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; } = ...

tools?

{ listChanged?: boolean; } = ...

Present if the server offers any tools to call.

tools.listChanged?

boolean = ...

Whether this server supports issuing notifications for changes to the tool list.

Returns

completions?

optional completions?: object

Present if the server supports sending completions to the client.

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 server supports.

Index Signature

[key: string]: object

extensions?

optional extensions?: object

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

Index Signature

[key: string]: object

logging?

optional logging?: object

Present if the server supports sending log messages to the client.

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

Deprecated

Deprecated as of protocol version 2026-07-28 (SEP-2577); remains in the specification for at least twelve months. Migrate to stderr logging (STDIO servers) or OpenTelemetry.

prompts?

optional prompts?: object

Present if the server offers any prompt templates.

prompts.listChanged?

optional listChanged?: boolean

Whether this server supports issuing notifications for changes to the prompt list.

resources?

optional resources?: object

Present if the server offers any resources to read.

resources.listChanged?

optional listChanged?: boolean

Whether this server supports issuing notifications for changes to the resource list.

resources.subscribe?

optional subscribe?: boolean

Whether this server supports clients subscribing to resource updates.

tasks?

optional tasks?: object

Present if the server 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 server 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 server 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.tools?

optional tools?: object

Task support for tool requests.

Index Signature

[key: string]: unknown

tasks.requests.tools.call?

optional call?: 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

tools?

optional tools?: object

Present if the server offers any tools to call.

tools.listChanged?

optional listChanged?: boolean

Whether this server supports issuing notifications for changes to the tool list.


installModernOnlyHandlers()

installModernOnlyHandlers(server, servedModernVersions): void

Defined in: packages/server/src/server/server.ts:238

Package-internal: installs the modern-only server/discover handler on an instance the HTTP entry has marked as serving the 2026-07-28 era, and makes sure the modern revisions the entry serves appear in the instance's supported-versions list (so the discover advertisement and version-mismatch errors name them). Idempotent. Hand-constructed instances are unaffected: nothing else calls this, so they keep answering -32601 unless their own supported-versions list opts into a modern revision. Not public API.

Parameters

server

Server

servedModernVersions

readonly string[]

Returns

void


seedClientIdentityFromEnvelope()

seedClientIdentityFromEnvelope(server, identity): void

Defined in: packages/server/src/server/server.ts:225

Package-internal: backfills the connection-scoped client-identity fields of a per-request server instance from the request's validated _meta envelope, so the (deprecated) Server.getClientCapabilities / Server.getClientVersion accessors keep answering on instances that never see an initialize handshake. Not public API.

Parameters

server

Server

identity

PerRequestClientIdentity

Returns

void