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

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

server/legacyInputRequiredShim ​

Classes ​

LegacyInputRequiredShim ​

Defined in: packages/server/src/server/legacyInputRequiredShim.ts:160

The fulfilment loop — see the module doc for the contract.

Constructors ​

Constructor ​

new LegacyInputRequiredShim(_host): LegacyInputRequiredShim

Defined in: packages/server/src/server/legacyInputRequiredShim.ts:161

Parameters ​
_host ​

LegacyInputRequiredShimHost

Returns ​

LegacyInputRequiredShim

Methods ​

fulfill() ​

fulfill(method, handler, request, ctx, firstResult): Promise<{[key: string]: unknown; _meta?: {[key: string]: unknown; io.modelcontextprotocol/serverInfo?: { description?: string; icons?: object[]; name: string; title?: string; version: string; websiteUrl?: string; }; }; }>

Defined in: packages/server/src/server/legacyInputRequiredShim.ts:163

Parameters ​
method ​

string

handler ​

(request, ctx) => Promise<{[key: string]: unknown; _meta?: {[key: string]: unknown; io.modelcontextprotocol/serverInfo?: { description?: string; icons?: object[]; name: string; title?: string; version: string; websiteUrl?: string; }; }; }>

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

firstResult ​
_meta? ​

{[key: string]: unknown; io.modelcontextprotocol/serverInfo?: { description?: string; icons?: object[]; name: string; title?: string; version: string; websiteUrl?: string; }; } = ...

See MCP specification for notes on _meta usage.

_meta.io.modelcontextprotocol/serverInfo? ​

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

_meta.io.modelcontextprotocol/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.

_meta.io.modelcontextprotocol/serverInfo.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)
_meta.io.modelcontextprotocol/serverInfo.name ​

string = ...

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

_meta.io.modelcontextprotocol/serverInfo.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).

_meta.io.modelcontextprotocol/serverInfo.version ​

string = ...

_meta.io.modelcontextprotocol/serverInfo.websiteUrl? ​

string = ...

An optional URL of the website for this implementation.

Returns ​

Promise<{[key: string]: unknown; _meta?: {[key: string]: unknown; io.modelcontextprotocol/serverInfo?: { description?: string; icons?: object[]; name: string; title?: string; version: string; websiteUrl?: string; }; }; }>

Interfaces ​

CoercedEmbeddedInputRequest ​

Defined in: packages/server/src/server/legacyInputRequiredShim.ts:81

A coerced inputRequests entry: the kind-narrowed embedded request.

Properties ​

method ​

method: EmbeddedInputRequestMethod

Defined in: packages/server/src/server/legacyInputRequiredShim.ts:82

params? ​

optional params?: Record<string, unknown>

Defined in: packages/server/src/server/legacyInputRequiredShim.ts:83


LegacyInputRequiredShimHost ​

Defined in: packages/server/src/server/legacyInputRequiredShim.ts:149

Everything the shim needs from Server: the knobs, the per-request resolved capability view (initialize state on sessionful legacy; empty on per-request stateless instances), the requestState verify runner (deny-on-error → the frozen -32602), and the 2025-era senders. The shim's own gate is authoritative; elicitation accepted content passes through UNVALIDATED for parity with the modern client driver.

Properties ​

maxRounds ​

readonly maxRounds: number

Defined in: packages/server/src/server/legacyInputRequiredShim.ts:150

roundTimeoutMs ​

readonly roundTimeoutMs: number

Defined in: packages/server/src/server/legacyInputRequiredShim.ts:151

Methods ​

listRoots() ​

listRoots(params, options): Promise<unknown>

Defined in: packages/server/src/server/legacyInputRequiredShim.ts:156

Parameters ​
params ​

Record<string, unknown> | undefined

options ​

RequestOptions

Returns ​

Promise<unknown>

resolvedClientCapabilities() ​

resolvedClientCapabilities(ctx): { 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/legacyInputRequiredShim.ts:152

Parameters ​
ctx ​

ServerContext

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

sendElicitation() ​

sendElicitation(params, options): Promise<unknown>

Defined in: packages/server/src/server/legacyInputRequiredShim.ts:154

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; }

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; }; }

_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; }

_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

Returns ​

Promise<unknown>

sendSampling() ​

sendSampling(params, options): Promise<unknown>

Defined in: packages/server/src/server/legacyInputRequiredShim.ts:155

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<unknown>

verifyRequestState() ​

verifyRequestState(state, ctx, method): Promise<unknown>

Defined in: packages/server/src/server/legacyInputRequiredShim.ts:153

Parameters ​
state ​

string

ctx ​

ServerContext

method ​

string

Returns ​

Promise<unknown>


ResolvedLegacyShimOptions ​

Defined in: packages/server/src/server/legacyInputRequiredShim.ts:54

The ServerOptions.inputRequired bag with defaults applied.

Properties ​

legacyShim ​

legacyShim: boolean

Defined in: packages/server/src/server/legacyInputRequiredShim.ts:57

maxRounds ​

maxRounds: number

Defined in: packages/server/src/server/legacyInputRequiredShim.ts:55

roundTimeoutMs ​

roundTimeoutMs: number

Defined in: packages/server/src/server/legacyInputRequiredShim.ts:56

Type Aliases ​

EmbeddedInputRequestMethod ​

EmbeddedInputRequestMethod = "elicitation/create" | "sampling/createMessage" | "roots/list"

Defined in: packages/server/src/server/legacyInputRequiredShim.ts:78

The embedded input-request kinds the 2026-07-28 revision defines.

Functions ​

coerceEmbeddedInputRequest() ​

coerceEmbeddedInputRequest(method, key, entry): object

Defined in: packages/server/src/server/legacyInputRequiredShim.ts:91

Validates one inputRequests entry: malformed or unknown kinds are server bugs and fail loudly on both eras. Shared by the modern seam's capability check and the shim's gate.

Parameters ​

method ​

string

key ​

string

entry ​

unknown

Returns ​

object

embedded ​

embedded: CoercedEmbeddedInputRequest

required ​

required: object

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

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

required.elicitation.form.applyDefaults? ​

optional applyDefaults?: boolean

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

required.experimental? ​

optional experimental?: object

Experimental, non-standard capabilities that the client supports.

Index Signature ​

[key: string]: object

required.extensions? ​

optional extensions?: object

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

Index Signature ​

[key: string]: object

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

required.roots.listChanged? ​

optional listChanged?: boolean

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

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

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

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

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

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

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

required.tasks.requests? ​

optional requests?: object

Capabilities for task creation on specific request types.

Index Signature ​

[key: string]: unknown

required.tasks.requests.elicitation? ​

optional elicitation?: object

Task support for elicitation requests.

Index Signature ​

[key: string]: unknown

required.tasks.requests.elicitation.create? ​

optional create?: object

Index Signature ​

[key: string]: ... | ... | ... | ... | ... | ... | ...

required.tasks.requests.sampling? ​

optional sampling?: object

Task support for sampling requests.

Index Signature ​

[key: string]: unknown

required.tasks.requests.sampling.createMessage? ​

optional createMessage?: object

Index Signature ​

[key: string]: ... | ... | ... | ... | ... | ... | ...


resolveLegacyShimOptions() ​

resolveLegacyShimOptions(options): ResolvedLegacyShimOptions

Defined in: packages/server/src/server/legacyInputRequiredShim.ts:61

Resolves and validates ServerOptions.inputRequired, failing loudly at construction time.

Parameters ​

options ​

{ legacyShim?: boolean; maxRounds?: number; roundTimeoutMs?: number; } | undefined

Returns ​

ResolvedLegacyShimOptions