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

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

index ​

Namespaces ​

Enumerations ​

OAuthErrorCode ​

Defined in: packages/core-internal/src/auth/errors.ts:8

OAuth error codes as defined by RFC 6749 and extensions.

Enumeration Members ​

AccessDenied ​

AccessDenied: "access_denied"

Defined in: packages/core-internal/src/auth/errors.ts:45

The resource owner or authorization server denied the request.

InsufficientScope ​

InsufficientScope: "insufficient_scope"

Defined in: packages/core-internal/src/auth/errors.ts:95

The request requires higher privileges than provided by the access token.

InvalidClient ​

InvalidClient: "invalid_client"

Defined in: packages/core-internal/src/auth/errors.ts:19

Client authentication failed (e.g., unknown client, no client authentication included, or unsupported authentication method).

InvalidClientMetadata ​

InvalidClientMetadata: "invalid_client_metadata"

Defined in: packages/core-internal/src/auth/errors.ts:85

The client metadata is invalid. (Custom error for dynamic client registration - RFC 7591)

InvalidDpopProof ​

InvalidDpopProof: "invalid_dpop_proof"

Defined in: packages/core-internal/src/auth/errors.ts:106

The DPoP proof accompanying the request is invalid, or does not match the key the grant (e.g. a refresh token) is bound to. (RFC 9449 §5 / §7.1)

InvalidGrant ​

InvalidGrant: "invalid_grant"

Defined in: packages/core-internal/src/auth/errors.ts:25

The provided authorization grant or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client.

InvalidRedirectUri ​

InvalidRedirectUri: "invalid_redirect_uri"

Defined in: packages/core-internal/src/auth/errors.ts:90

The value of one or more redirection URIs is invalid. (Dynamic client registration - RFC 7591 §3.2.2)

InvalidRequest ​

InvalidRequest: "invalid_request"

Defined in: packages/core-internal/src/auth/errors.ts:13

The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed.

InvalidScope ​

InvalidScope: "invalid_scope"

Defined in: packages/core-internal/src/auth/errors.ts:40

The requested scope is invalid, unknown, malformed, or exceeds the scope granted by the resource owner.

InvalidTarget ​

InvalidTarget: "invalid_target"

Defined in: packages/core-internal/src/auth/errors.ts:100

The requested resource is invalid, missing, unknown, or malformed. (Custom error for resource indicators - RFC 8707)

InvalidToken ​

InvalidToken: "invalid_token"

Defined in: packages/core-internal/src/auth/errors.ts:70

The access token provided is expired, revoked, malformed, or invalid for other reasons.

MethodNotAllowed ​

MethodNotAllowed: "method_not_allowed"

Defined in: packages/core-internal/src/auth/errors.ts:75

The HTTP method used is not allowed for this endpoint. (Custom, non-standard error)

ServerError ​

ServerError: "server_error"

Defined in: packages/core-internal/src/auth/errors.ts:50

The authorization server encountered an unexpected condition that prevented it from fulfilling the request.

TemporarilyUnavailable ​

TemporarilyUnavailable: "temporarily_unavailable"

Defined in: packages/core-internal/src/auth/errors.ts:55

The authorization server is currently unable to handle the request due to temporary overloading or maintenance.

TooManyRequests ​

TooManyRequests: "too_many_requests"

Defined in: packages/core-internal/src/auth/errors.ts:80

Rate limit exceeded. (Custom, non-standard error based on RFC 6585)

UnauthorizedClient ​

UnauthorizedClient: "unauthorized_client"

Defined in: packages/core-internal/src/auth/errors.ts:30

The authenticated client is not authorized to use this authorization grant type.

UnsupportedGrantType ​

UnsupportedGrantType: "unsupported_grant_type"

Defined in: packages/core-internal/src/auth/errors.ts:35

The authorization grant type is not supported by the authorization server.

UnsupportedResponseType ​

UnsupportedResponseType: "unsupported_response_type"

Defined in: packages/core-internal/src/auth/errors.ts:60

The authorization server does not support obtaining an authorization code using this method.

UnsupportedTokenType ​

UnsupportedTokenType: "unsupported_token_type"

Defined in: packages/core-internal/src/auth/errors.ts:65

The authorization server does not support the requested token type.

UseDpopNonce ​

UseDpopNonce: "use_dpop_nonce"

Defined in: packages/core-internal/src/auth/errors.ts:112

The server requires a server-supplied nonce in the DPoP proof; retry with the DPoP-Nonce it returned. (RFC 9449 §8 / §9)


ProtocolErrorCode ​

Defined in: packages/core-internal/src/types/enums.ts:5

Error codes for protocol errors that cross the wire as JSON-RPC error responses. These follow the JSON-RPC specification and MCP-specific extensions.

Enumeration Members ​

InternalError ​

InternalError: -32603

Defined in: packages/core-internal/src/types/enums.ts:11

InvalidParams ​

InvalidParams: -32602

Defined in: packages/core-internal/src/types/enums.ts:10

InvalidRequest ​

InvalidRequest: -32600

Defined in: packages/core-internal/src/types/enums.ts:8

MethodNotFound ​

MethodNotFound: -32601

Defined in: packages/core-internal/src/types/enums.ts:9

MissingRequiredClientCapability ​

MissingRequiredClientCapability: -32021

Defined in: packages/core-internal/src/types/enums.ts:30

Processing the request requires a capability the client did not declare in the request's clientCapabilities (protocol revision 2026-07-28).

ParseError ​

ParseError: -32700

Defined in: packages/core-internal/src/types/enums.ts:7

ResourceNotFound ​

ResourceNotFound: -32002

Defined in: packages/core-internal/src/types/enums.ts:25

Resource not found.

Receive-tolerated only: the SDK never EMITS -32002 — resources/read misses answer -32602 (Invalid Params) on every protocol revision per the 2026-07-28 spec MUST, and a handler-thrown -32002 is mapped to -32602 at the era encode seam. The member stays importable so clients can recognise -32002 from peers built on earlier SDK releases (the spec's "clients SHOULD also accept -32002" backwards-compatibility clause). Throw ResourceNotFoundError instead.

UnsupportedProtocolVersion ​

UnsupportedProtocolVersion: -32022

Defined in: packages/core-internal/src/types/enums.ts:35

The request's protocol version is unknown to the server or unsupported by it (protocol revision 2026-07-28).

UrlElicitationRequired ​

UrlElicitationRequired: -32042

Defined in: packages/core-internal/src/types/enums.ts:36


SdkErrorCode ​

Defined in: packages/core-internal/src/errors/sdkErrors.ts:11

Error codes for SDK errors (local errors that never cross the wire). Unlike ProtocolErrorCode which uses numeric JSON-RPC codes, SdkErrorCode uses descriptive string values for better developer experience.

These errors are thrown locally by the SDK and are never serialized as JSON-RPC error responses.

Enumeration Members ​

AlreadyConnected ​

AlreadyConnected: "ALREADY_CONNECTED"

Defined in: packages/core-internal/src/errors/sdkErrors.ts:16

Transport is already connected

CapabilityNotSupported ​

CapabilityNotSupported: "CAPABILITY_NOT_SUPPORTED"

Defined in: packages/core-internal/src/errors/sdkErrors.ts:22

Required capability is not supported by the remote side

ClientHttpAuthentication ​

ClientHttpAuthentication: "CLIENT_HTTP_AUTHENTICATION"

Defined in: packages/core-internal/src/errors/sdkErrors.ts:89

HTTP 401 authentication failure: the transport's re-auth retry still got 401 (Server returned 401 after re-authentication), or the version negotiation probe was rejected 401 with no authProvider configured (Version negotiation failed: the server requires authorization (HTTP 401)). Carried on an SdkHttpError with status: 401.

ClientHttpFailedToOpenStream ​

ClientHttpFailedToOpenStream: "CLIENT_HTTP_FAILED_TO_OPEN_STREAM"

Defined in: packages/core-internal/src/errors/sdkErrors.ts:98

ClientHttpFailedToTerminateSession ​

ClientHttpFailedToTerminateSession: "CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION"

Defined in: packages/core-internal/src/errors/sdkErrors.ts:99

ClientHttpForbidden ​

ClientHttpForbidden: "CLIENT_HTTP_FORBIDDEN"

Defined in: packages/core-internal/src/errors/sdkErrors.ts:96

HTTP 403 denial: the step-up re-authorization retry limit was reached, or the version negotiation probe was rejected 403 (Version negotiation failed: the server denied access (HTTP 403)). Carried on an SdkHttpError with status: 403.

ClientHttpNotImplemented ​

ClientHttpNotImplemented: "CLIENT_HTTP_NOT_IMPLEMENTED"

Defined in: packages/core-internal/src/errors/sdkErrors.ts:81

ClientHttpUnexpectedContent ​

ClientHttpUnexpectedContent: "CLIENT_HTTP_UNEXPECTED_CONTENT"

Defined in: packages/core-internal/src/errors/sdkErrors.ts:97

ConnectionClosed ​

ConnectionClosed: "CONNECTION_CLOSED"

Defined in: packages/core-internal/src/errors/sdkErrors.ts:28

Connection was closed

EraNegotiationFailed ​

EraNegotiationFailed: "ERA_NEGOTIATION_FAILED"

Defined in: packages/core-internal/src/errors/sdkErrors.ts:78

Protocol-era negotiation at connect time failed without producing either a usable modern (2026-07-28+) era or a definitive legacy fallback signal — e.g. the negotiation mode forbids falling back (pin), the probe hit a network failure, or the server answered the probe with a 5xx (a typed connect error, never an era verdict).

Negotiation-phase only: this code is never used once an era is established. Auth walls never carry it: a 401/403 rejecting the probe uses ClientHttpAuthentication / ClientHttpForbidden instead, so era-recovery flows keyed on this code (e.g. cached-verdict gateways) can never persist a verdict for an unauthorized exchange.

InputRequiredRoundsExceeded ​

InputRequiredRoundsExceeded: "INPUT_REQUIRED_ROUNDS_EXCEEDED"

Defined in: packages/core-internal/src/errors/sdkErrors.ts:47

The multi-round-trip auto-fulfilment driver exhausted its round cap (inputRequired.maxRounds) without the server returning a complete result. data.rounds carries the cap that was hit and data.lastResult carries the last input_required payload received ({ inputRequests, requestState? }), so callers can inspect or resume the flow manually.

InvalidResult ​

InvalidResult: "INVALID_RESULT"

Defined in: packages/core-internal/src/errors/sdkErrors.ts:32

Response result failed local schema validation

ListPaginationExceeded ​

ListPaginationExceeded: "LIST_PAGINATION_EXCEEDED"

Defined in: packages/core-internal/src/errors/sdkErrors.ts:56

The auto-aggregating no-cursor listTools() / listPrompts() / listResources() / listResourceTemplates() walk hit the ClientOptions.listMaxPages cap without the server's pagination converging. data.method carries the list verb and data.listMaxPages the cap that was hit; raise the cap or fall back to explicit per-page { cursor } calls.

MethodNotSupportedByProtocolVersion ​

MethodNotSupportedByProtocolVersion: "METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION"

Defined in: packages/core-internal/src/errors/sdkErrors.ts:64

The spec method being sent does not exist on the negotiated protocol version's wire era (e.g. tasks/get toward a 2026-07-28 peer, or server/discover toward a 2025-era peer). Raised locally, before anything reaches the transport. The method and era are carried in data.method / data.era.

NotConnected ​

NotConnected: "NOT_CONNECTED"

Defined in: packages/core-internal/src/errors/sdkErrors.ts:14

Transport is not connected

NotInitialized ​

NotInitialized: "NOT_INITIALIZED"

Defined in: packages/core-internal/src/errors/sdkErrors.ts:18

Protocol is not initialized

RequestTimeout ​

RequestTimeout: "REQUEST_TIMEOUT"

Defined in: packages/core-internal/src/errors/sdkErrors.ts:26

Request timed out waiting for response

SendFailed ​

SendFailed: "SEND_FAILED"

Defined in: packages/core-internal/src/errors/sdkErrors.ts:30

Failed to send message

UnsupportedResultType ​

UnsupportedResultType: "UNSUPPORTED_RESULT_TYPE"

Defined in: packages/core-internal/src/errors/sdkErrors.ts:38

The response carried a resultType discriminator (protocol revision 2026-07-28) naming a result kind this client cannot consume yet, e.g. input_required. The kind is carried in data.resultType.

Classes ​

InMemoryTransport ​

Defined in: packages/core-internal/src/util/inMemory.ts:16

In-memory transport for creating clients and servers that talk to each other within the same process.

Intended for testing and development. For production in-process connections, use StreamableHTTPClientTransport against a local server URL.

Implements ​

Constructors ​

Constructor ​

new InMemoryTransport(): InMemoryTransport

Returns ​

InMemoryTransport

Properties ​

onclose? ​

optional onclose?: () => void

Defined in: packages/core-internal/src/util/inMemory.ts:21

Callback for when the connection is closed for any reason.

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

Returns ​

void

Implementation of ​

Transport.onclose

onerror? ​

optional onerror?: (error) => void

Defined in: packages/core-internal/src/util/inMemory.ts:22

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

Implementation of ​

Transport.onerror

onmessage? ​

optional onmessage?: (message, extra?) => void

Defined in: packages/core-internal/src/util/inMemory.ts:23

Callback for when a message (request or response) is received over the connection.

Includes the request and authInfo if the transport is authenticated.

The request can be used to get the original request information (headers, etc.)

Parameters ​
message ​

JSONRPCMessage

extra? ​
authInfo? ​

AuthInfo

Returns ​

void

Implementation of ​

Transport.onmessage

sessionId? ​

optional sessionId?: string

Defined in: packages/core-internal/src/util/inMemory.ts:24

The session ID generated for this connection.

Implementation of ​

Transport.sessionId

Methods ​

close() ​

close(): Promise<void>

Defined in: packages/core-internal/src/util/inMemory.ts:45

Closes the connection.

Returns ​

Promise<void>

Implementation of ​

Transport.close

send() ​

send(message, options?): Promise<void>

Defined in: packages/core-internal/src/util/inMemory.ts:62

Sends a message with optional auth info. This is useful for testing authentication scenarios.

Parameters ​
message ​

JSONRPCMessage

options? ​
authInfo? ​

AuthInfo

relatedRequestId? ​

RequestId

Returns ​

Promise<void>

Implementation of ​

Transport.send

start() ​

start(): Promise<void>

Defined in: packages/core-internal/src/util/inMemory.ts:37

Starts processing messages on the transport, including any connection steps that might need to be taken.

This method should only be called after callbacks are installed, or else messages may be lost.

NOTE: This method should not be called explicitly when using Client or Server classes, as they will implicitly call start().

Returns ​

Promise<void>

Implementation of ​

Transport.start

createLinkedPair() ​

static createLinkedPair(): [InMemoryTransport, InMemoryTransport]

Defined in: packages/core-internal/src/util/inMemory.ts:29

Creates a pair of linked in-memory transports that can communicate with each other. One should be passed to a Client and one to a Server.

Returns ​

[InMemoryTransport, InMemoryTransport]


MissingRequiredClientCapabilityError ​

Defined in: packages/core-internal/src/types/errors.ts:207

Error type for the -32021 MissingRequiredClientCapability protocol error (protocol revision 2026-07-28): processing the request requires a capability the client did not declare in the request's clientCapabilities.

The error data lists the missing capabilities (requiredCapabilities) in the ClientCapabilities shape, so the client can see exactly what it would have to declare for the request to be served. On HTTP, the response status is 400 Bad Request.

Recognize this error by its code and data.requiredCapabilities, or by instanceof — checks are brand-matched and work across separately bundled copies of the SDK.

Extends ​

Constructors ​

Constructor ​

new MissingRequiredClientCapabilityError(data, message?): MissingRequiredClientCapabilityError

Defined in: packages/core-internal/src/types/errors.ts:212

Parameters ​
data ​

MissingRequiredClientCapabilityErrorData

message? ​

string = ...

Returns ​

MissingRequiredClientCapabilityError

Overrides ​

ProtocolError.constructor

Properties ​

cause? ​

optional cause?: unknown

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26

Inherited from ​

ProtocolError.cause

code ​

readonly code: number

Defined in: packages/core-internal/src/types/errors.ts:47

Inherited from ​

ProtocolError.code

data? ​

readonly optional data?: unknown

Defined in: packages/core-internal/src/types/errors.ts:49

Inherited from ​

ProtocolError.data

message ​

message: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from ​

ProtocolError.message

name ​

name: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from ​

ProtocolError.name

stack? ​

optional stack?: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from ​

ProtocolError.stack

stackTraceLimit ​

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from ​

ProtocolError.stackTraceLimit

Accessors ​

requiredCapabilities ​
Get Signature ​

get requiredCapabilities(): object

Defined in: packages/core-internal/src/types/errors.ts:223

The capabilities the server requires from the client to process the request (only the missing capabilities are listed).

Returns ​
elicitation? ​

optional elicitation?: object

Present if the client supports eliciting user input.

Index Signature ​

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

elicitation.form? ​

optional form?: object

Index Signature ​

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

elicitation.form.applyDefaults? ​

optional applyDefaults?: boolean

elicitation.url? ​

optional url?: object

Index Signature ​

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

experimental? ​

optional experimental?: object

Experimental, non-standard capabilities that the client supports.

Index Signature ​

[key: string]: object

extensions? ​

optional extensions?: object

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

Index Signature ​

[key: string]: object

roots? ​

optional roots?: object

Present if the client supports listing roots.

Deprecated ​

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

roots.listChanged? ​

optional listChanged?: boolean

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

sampling? ​

optional sampling?: object

Present if the client supports sampling from an LLM.

Deprecated ​

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

sampling.context? ​

optional context?: object

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

Index Signature ​

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

sampling.tools? ​

optional tools?: object

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

Index Signature ​

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

tasks? ​

optional tasks?: object

Present if the client supports task creation.

Index Signature ​

[key: string]: unknown

Deprecated ​

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

tasks.cancel? ​

optional cancel?: object

Present if the client supports cancelling tasks.

Index Signature ​

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

tasks.list? ​

optional list?: object

Present if the client supports listing tasks.

Index Signature ​

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

tasks.requests? ​

optional requests?: object

Capabilities for task creation on specific request types.

Index Signature ​

[key: string]: unknown

tasks.requests.elicitation? ​

optional elicitation?: object

Task support for elicitation requests.

Index Signature ​

[key: string]: unknown

tasks.requests.elicitation.create? ​

optional create?: object

Index Signature ​

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

tasks.requests.sampling? ​

optional sampling?: object

Task support for sampling requests.

Index Signature ​

[key: string]: unknown

tasks.requests.sampling.createMessage? ​

optional createMessage?: object

Index Signature ​

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

Methods ​

[hasInstance]() ​

static [hasInstance](value): boolean

Defined in: packages/core-internal/src/types/errors.ts:24

Parameters ​
value ​

unknown

Returns ​

boolean

Inherited from ​

ProtocolError.[hasInstance]

captureStackTrace() ​

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

js
function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
Parameters ​
targetObject ​

object

constructorOpt? ​

Function

Returns ​

void

Inherited from ​

ProtocolError.captureStackTrace

fromError() ​

static fromError(code, message, data?): ProtocolError

Defined in: packages/core-internal/src/types/errors.ts:59

Factory method to create the appropriate error type based on the error code and data

Parameters ​
code ​

number

message ​

string

data? ​

unknown

Returns ​

ProtocolError

Inherited from ​

ProtocolError.fromError

isError() ​

static isError(error): error is Error

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.error.d.ts:23

Indicates whether the argument provided is a built-in Error instance or not.

Parameters ​
error ​

unknown

Returns ​

error is Error

Inherited from ​

ProtocolError.isError

isInstance() ​

static isInstance<T>(this, value): value is InstanceType<T>

Defined in: packages/core-internal/src/types/errors.ts:37

Brand-based type guard: equivalent to value instanceof this, as an explicit static predicate (the axios/AWS-SDK isInstance style). Reads the caller's own brand via this, so every branded subclass gets a correctly-scoped guard by inheritance. Must be invoked on the class — in callback position write v => SdkError.isInstance(v), not .filter(SdkError.isInstance) (detached calls throw rather than silently matching nothing).

Type Parameters ​
T ​

T extends (...args) => unknown

Parameters ​
this ​

T

value ​

unknown

Returns ​

value is InstanceType<T>

Inherited from ​

ProtocolError.isInstance

prepareStackTrace() ​

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:56

Parameters ​
err ​

Error

stackTraces ​

CallSite[]

Returns ​

any

See ​

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from ​

ProtocolError.prepareStackTrace


OAuthError ​

Defined in: packages/core-internal/src/auth/errors.ts:118

OAuth error class for all OAuth-related errors.

Extends ​

  • Error

Constructors ​

Constructor ​

new OAuthError(code, message, errorUri?): OAuthError

Defined in: packages/core-internal/src/auth/errors.ts:145

Parameters ​
code ​

string

message ​

string

errorUri? ​

string

Returns ​

OAuthError

Overrides ​

Error.constructor

Properties ​

cause? ​

optional cause?: unknown

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26

Inherited from ​

Error.cause

code ​

readonly code: string

Defined in: packages/core-internal/src/auth/errors.ts:146

errorUri? ​

readonly optional errorUri?: string

Defined in: packages/core-internal/src/auth/errors.ts:148

message ​

message: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from ​

Error.message

name ​

name: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from ​

Error.name

stack? ​

optional stack?: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from ​

Error.stack

stackTraceLimit ​

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from ​

Error.stackTraceLimit

Methods ​

toResponseObject() ​

toResponseObject(): object

Defined in: packages/core-internal/src/auth/errors.ts:158

Converts the error to a standard OAuth error response object.

Returns ​

object

error ​

error: string

error_description? ​

optional error_description?: string

error_uri? ​

optional error_uri?: string

[hasInstance]() ​

static [hasInstance](value): boolean

Defined in: packages/core-internal/src/auth/errors.ts:123

Parameters ​
value ​

unknown

Returns ​

boolean

captureStackTrace() ​

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

js
function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
Parameters ​
targetObject ​

object

constructorOpt? ​

Function

Returns ​

void

Inherited from ​

Error.captureStackTrace

fromResponse() ​

static fromResponse(response): OAuthError

Defined in: packages/core-internal/src/auth/errors.ts:174

Creates an OAuthError from an OAuth error response.

Parameters ​
response ​
error ​

string = ...

error_description? ​

string = ...

error_uri? ​

string = ...

Returns ​

OAuthError

isError() ​

static isError(error): error is Error

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.error.d.ts:23

Indicates whether the argument provided is a built-in Error instance or not.

Parameters ​
error ​

unknown

Returns ​

error is Error

Inherited from ​

Error.isError

isInstance() ​

static isInstance<T>(this, value): value is InstanceType<T>

Defined in: packages/core-internal/src/auth/errors.ts:136

Brand-based type guard: equivalent to value instanceof this, as an explicit static predicate (the axios/AWS-SDK isInstance style). Reads the caller's own brand via this, so every branded subclass gets a correctly-scoped guard by inheritance. Must be invoked on the class — in callback position write v => SdkError.isInstance(v), not .filter(SdkError.isInstance) (detached calls throw rather than silently matching nothing).

Type Parameters ​
T ​

T extends (...args) => unknown

Parameters ​
this ​

T

value ​

unknown

Returns ​

value is InstanceType<T>

prepareStackTrace() ​

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:56

Parameters ​
err ​

Error

stackTraces ​

CallSite[]

Returns ​

any

See ​

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from ​

Error.prepareStackTrace


abstract Protocol ​

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

Implements MCP protocol framing on top of a pluggable transport, including features like request/response linking, notifications, and progress.

Protocol is abstract; Client and Server are the concrete role-specific implementations most code should use.

Extended by ​

Type Parameters ​

ContextT ​

ContextT extends BaseContext

Constructors ​

Constructor ​

new Protocol<ContextT>(_options?): Protocol<ContextT>

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

Parameters ​
_options? ​

ProtocolOptions

Returns ​

Protocol<ContextT>

Properties ​

_negotiatedProtocolVersion? ​

protected optional _negotiatedProtocolVersion?: string

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

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

_supportedProtocolVersions ​

protected _supportedProtocolVersions: string[]

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

fallbackNotificationHandler? ​

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

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

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>

fallbackRequestHandler? ​

optional fallbackRequestHandler?: (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; }; }; }>

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

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 ​

ContextT

Returns ​

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

onclose? ​

optional onclose?: () => void

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

Callback for when the connection is closed for any reason.

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

Returns ​

void

onerror? ​

optional onerror?: (error) => void

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

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

Accessors ​

transport ​
Get Signature ​

get transport(): Transport | undefined

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

Returns ​

Transport | undefined

Methods ​

_getRequestHandler() ​

protected _getRequestHandler(method): ((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; }; }; }>) | undefined

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

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/serverInfo?: { description?: string; icons?: object[]; name: string; title?: string; version: string; websiteUrl?: string; }; }; }>) | undefined

_onclose() ​

protected _onclose(): void

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

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

_onnotification() ​

protected _onnotification(rawNotification, extra?): void

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

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

_onresponse() ​

protected _onresponse(response): void

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

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

_outboundMetaEnvelope() ​

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

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

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

_outboundServerInfo() ​

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

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

Hook for subclasses to supply the implementation identity the 2026-era encode seam stamps into outbound result _meta under io.modelcontextprotocol/serverInfo (spec PR #3002: servers SHOULD identify themselves on every response). The default is undefined — no stamp. Only Server overrides this: the key identifies the software producing a response, and the 2025-era codec never stamps anything regardless (the never-stamp guarantee).

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

_requestWithSchema() ​

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

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

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

_resolveNonCompleteResult() ​

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

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

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>

_shouldDropInbound() ​

protected _shouldDropInbound(_message): "drop" | undefined

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

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

_wireCodec() ​

protected _wireCodec(): WireCodec

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

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

_wrapHandler() ​

protected _wrapHandler(_method, 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; }; }; }>

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

Hook for subclasses to wrap a registered request handler with role-specific validation or behavior (e.g. Server validates tools/call results, Client validates elicitation/create mode and result). Runs for both the 2-arg and 3-arg registration paths. The default implementation is identity.

Subclasses overriding this hook avoid redeclaring setRequestHandler's overload set.

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

Returns ​

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

assertCanSetRequestHandler() ​

assertCanSetRequestHandler(method): void

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

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

assertCapabilityForMethod() ​

abstract protected assertCapabilityForMethod(method): void

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

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

assertNotificationCapability() ​

abstract protected assertNotificationCapability(method): void

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

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

assertRequestHandlerCapability() ​

abstract protected assertRequestHandlerCapability(method): void

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

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

buildContext() ​

abstract protected buildContext(ctx, transportInfo?): ContextT

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

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 ​

ContextT

close() ​

close(): Promise<void>

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

Closes the connection.

Returns ​

Promise<void>

connect() ​

connect(transport): Promise<void>

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

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>

notification() ​

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

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

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>

removeNotificationHandler() ​

removeNotificationHandler(method): void

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

Removes the notification handler for the given method.

Parameters ​
method ​

string

Returns ​

void

removeRequestHandler() ​

removeRequestHandler(method): void

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

Removes the request handler for the given method.

Parameters ​
method ​

string

Returns ​

void

request() ​
Call Signature ​

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

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

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

Call Signature ​

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

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

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

setNotificationHandler() ​
Call Signature ​

setNotificationHandler<M>(method, handler): void

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

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

Call Signature ​

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

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

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

setRequestHandler() ​
Call Signature ​

setRequestHandler<M>(method, handler): void

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

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}`] };
});
Call Signature ​

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

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

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}`] };
});

ProtocolError ​

Defined in: packages/core-internal/src/types/errors.ts:19

Protocol errors are JSON-RPC errors that cross the wire as error responses. They use numeric error codes from the ProtocolErrorCode enum.

instanceof on this class (and its subclasses) is brand-matched, so it works across separately bundled copies of the SDK — e.g. an error constructed by @modelcontextprotocol/client matches the class re-exported by @modelcontextprotocol/server in the same process.

Extends ​

  • Error

Extended by ​

Constructors ​

Constructor ​

new ProtocolError(code, message, data?): ProtocolError

Defined in: packages/core-internal/src/types/errors.ts:46

Parameters ​
code ​

number

message ​

string

data? ​

unknown

Returns ​

ProtocolError

Overrides ​

Error.constructor

Properties ​

cause? ​

optional cause?: unknown

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26

Inherited from ​

Error.cause

code ​

readonly code: number

Defined in: packages/core-internal/src/types/errors.ts:47

data? ​

readonly optional data?: unknown

Defined in: packages/core-internal/src/types/errors.ts:49

message ​

message: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from ​

Error.message

name ​

name: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from ​

Error.name

stack? ​

optional stack?: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from ​

Error.stack

stackTraceLimit ​

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from ​

Error.stackTraceLimit

Methods ​

[hasInstance]() ​

static [hasInstance](value): boolean

Defined in: packages/core-internal/src/types/errors.ts:24

Parameters ​
value ​

unknown

Returns ​

boolean

captureStackTrace() ​

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

js
function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
Parameters ​
targetObject ​

object

constructorOpt? ​

Function

Returns ​

void

Inherited from ​

Error.captureStackTrace

fromError() ​

static fromError(code, message, data?): ProtocolError

Defined in: packages/core-internal/src/types/errors.ts:59

Factory method to create the appropriate error type based on the error code and data

Parameters ​
code ​

number

message ​

string

data? ​

unknown

Returns ​

ProtocolError

isError() ​

static isError(error): error is Error

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.error.d.ts:23

Indicates whether the argument provided is a built-in Error instance or not.

Parameters ​
error ​

unknown

Returns ​

error is Error

Inherited from ​

Error.isError

isInstance() ​

static isInstance<T>(this, value): value is InstanceType<T>

Defined in: packages/core-internal/src/types/errors.ts:37

Brand-based type guard: equivalent to value instanceof this, as an explicit static predicate (the axios/AWS-SDK isInstance style). Reads the caller's own brand via this, so every branded subclass gets a correctly-scoped guard by inheritance. Must be invoked on the class — in callback position write v => SdkError.isInstance(v), not .filter(SdkError.isInstance) (detached calls throw rather than silently matching nothing).

Type Parameters ​
T ​

T extends (...args) => unknown

Parameters ​
this ​

T

value ​

unknown

Returns ​

value is InstanceType<T>

prepareStackTrace() ​

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:56

Parameters ​
err ​

Error

stackTraces ​

CallSite[]

Returns ​

any

See ​

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from ​

Error.prepareStackTrace


ReadBuffer ​

Defined in: packages/core-internal/src/shared/stdio.ts:9

Buffers a continuous stdio stream into discrete JSON-RPC messages.

Constructors ​

Constructor ​

new ReadBuffer(options?): ReadBuffer

Defined in: packages/core-internal/src/shared/stdio.ts:13

Parameters ​
options? ​
maxBufferSize? ​

number

Returns ​

ReadBuffer

Methods ​

append() ​

append(chunk): void

Defined in: packages/core-internal/src/shared/stdio.ts:17

Parameters ​
chunk ​

Buffer

Returns ​

void

clear() ​

clear(): void

Defined in: packages/core-internal/src/shared/stdio.ts:51

Returns ​

void

readMessage() ​

readMessage(): JSONRPCMessage | null

Defined in: packages/core-internal/src/shared/stdio.ts:26

Returns ​

JSONRPCMessage | null


ResourceNotFoundError ​

Defined in: packages/core-internal/src/types/errors.ts:125

Error type for a resources/read miss: the requested resource does not exist. The wire code is -32602 (Invalid Params) on every protocol revision — the spec MUST for revision 2026-07-28, and the value the v1.x SDK has always emitted on earlier revisions. The error data echoes the requested URI.

Recognise this error by checking error.data is exactly { uri: string } (a -32602 whose data carries uri and nothing else is resource-not-found; any other -32602 is an ordinary Invalid Params). For backwards compatibility, clients should also accept -32002 as resource not found — earlier SDK builds emitted that code, and ProtocolError.fromError reconstructs this class for either code when error.data carries uri (a bare -32002 without data.uri stays a generic ProtocolError). instanceof checks are brand-matched and work across separately bundled copies of the SDK.

Extends ​

Constructors ​

Constructor ​

new ResourceNotFoundError(uri, message?): ResourceNotFoundError

Defined in: packages/core-internal/src/types/errors.ts:130

Parameters ​
uri ​

string

message? ​

string = ...

Returns ​

ResourceNotFoundError

Overrides ​

ProtocolError.constructor

Properties ​

cause? ​

optional cause?: unknown

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26

Inherited from ​

ProtocolError.cause

code ​

readonly code: number

Defined in: packages/core-internal/src/types/errors.ts:47

Inherited from ​

ProtocolError.code

data? ​

readonly optional data?: unknown

Defined in: packages/core-internal/src/types/errors.ts:49

Inherited from ​

ProtocolError.data

message ​

message: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from ​

ProtocolError.message

name ​

name: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from ​

ProtocolError.name

stack? ​

optional stack?: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from ​

ProtocolError.stack

stackTraceLimit ​

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from ​

ProtocolError.stackTraceLimit

Accessors ​

uri ​
Get Signature ​

get uri(): string

Defined in: packages/core-internal/src/types/errors.ts:135

The URI that was requested and not found.

Returns ​

string

Methods ​

[hasInstance]() ​

static [hasInstance](value): boolean

Defined in: packages/core-internal/src/types/errors.ts:24

Parameters ​
value ​

unknown

Returns ​

boolean

Inherited from ​

ProtocolError.[hasInstance]

captureStackTrace() ​

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

js
function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
Parameters ​
targetObject ​

object

constructorOpt? ​

Function

Returns ​

void

Inherited from ​

ProtocolError.captureStackTrace

fromError() ​

static fromError(code, message, data?): ProtocolError

Defined in: packages/core-internal/src/types/errors.ts:59

Factory method to create the appropriate error type based on the error code and data

Parameters ​
code ​

number

message ​

string

data? ​

unknown

Returns ​

ProtocolError

Inherited from ​

ProtocolError.fromError

isError() ​

static isError(error): error is Error

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.error.d.ts:23

Indicates whether the argument provided is a built-in Error instance or not.

Parameters ​
error ​

unknown

Returns ​

error is Error

Inherited from ​

ProtocolError.isError

isInstance() ​

static isInstance<T>(this, value): value is InstanceType<T>

Defined in: packages/core-internal/src/types/errors.ts:37

Brand-based type guard: equivalent to value instanceof this, as an explicit static predicate (the axios/AWS-SDK isInstance style). Reads the caller's own brand via this, so every branded subclass gets a correctly-scoped guard by inheritance. Must be invoked on the class — in callback position write v => SdkError.isInstance(v), not .filter(SdkError.isInstance) (detached calls throw rather than silently matching nothing).

Type Parameters ​
T ​

T extends (...args) => unknown

Parameters ​
this ​

T

value ​

unknown

Returns ​

value is InstanceType<T>

Inherited from ​

ProtocolError.isInstance

prepareStackTrace() ​

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:56

Parameters ​
err ​

Error

stackTraces ​

CallSite[]

Returns ​

any

See ​

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from ​

ProtocolError.prepareStackTrace


SdkError ​

Defined in: packages/core-internal/src/errors/sdkErrors.ts:120

SDK errors are local errors that never cross the wire. They are distinct from ProtocolError which represents JSON-RPC protocol errors that are serialized and sent as error responses.

Example ​

ts
try {
    // Throwing an SDK error
    throw new SdkError(SdkErrorCode.NotConnected, 'Transport is not connected');
} catch (error) {
    // Checking error type by code
    if (error instanceof SdkError && error.code === SdkErrorCode.RequestTimeout) {
        // Handle timeout
    }
}

Extends ​

  • Error

Extended by ​

Constructors ​

Constructor ​

new SdkError(code, message, data?, options?): SdkError

Defined in: packages/core-internal/src/errors/sdkErrors.ts:157

Parameters ​
code ​

SdkErrorCode

Stable string code identifying the failure (SdkErrorCode).

message ​

string

Human-readable description.

data? ​

unknown

Optional structured payload (for example the HTTP status carried by SdkHttpError). Opaque to the SDK: a cause key inside data is not promoted to Error.cause.

options? ​

ErrorOptions

Standard ErrorOptions, forwarded to Error. Pass the underlying failure as { cause } so it is reachable through the Error.cause chain that loggers and error trackers walk.

Returns ​

SdkError

Overrides ​

Error.constructor

Properties ​

cause? ​

optional cause?: unknown

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26

Inherited from ​

Error.cause

code ​

readonly code: SdkErrorCode

Defined in: packages/core-internal/src/errors/sdkErrors.ts:158

Stable string code identifying the failure (SdkErrorCode).

data? ​

readonly optional data?: unknown

Defined in: packages/core-internal/src/errors/sdkErrors.ts:160

Optional structured payload (for example the HTTP status carried by SdkHttpError). Opaque to the SDK: a cause key inside data is not promoted to Error.cause.

message ​

message: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from ​

Error.message

name ​

name: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from ​

Error.name

stack? ​

optional stack?: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from ​

Error.stack

stackTraceLimit ​

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from ​

Error.stackTraceLimit

Methods ​

[hasInstance]() ​

static [hasInstance](value): boolean

Defined in: packages/core-internal/src/errors/sdkErrors.ts:125

Parameters ​
value ​

unknown

Returns ​

boolean

captureStackTrace() ​

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

js
function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
Parameters ​
targetObject ​

object

constructorOpt? ​

Function

Returns ​

void

Inherited from ​

Error.captureStackTrace

isError() ​

static isError(error): error is Error

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.error.d.ts:23

Indicates whether the argument provided is a built-in Error instance or not.

Parameters ​
error ​

unknown

Returns ​

error is Error

Inherited from ​

Error.isError

isInstance() ​

static isInstance<T>(this, value): value is InstanceType<T>

Defined in: packages/core-internal/src/errors/sdkErrors.ts:138

Brand-based type guard: equivalent to value instanceof this, as an explicit static predicate (the axios/AWS-SDK isInstance style). Reads the caller's own brand via this, so every branded subclass gets a correctly-scoped guard by inheritance. Must be invoked on the class — in callback position write v => SdkError.isInstance(v), not .filter(SdkError.isInstance) (detached calls throw rather than silently matching nothing).

Type Parameters ​
T ​

T extends (...args) => unknown

Parameters ​
this ​

T

value ​

unknown

Returns ​

value is InstanceType<T>

prepareStackTrace() ​

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:56

Parameters ​
err ​

Error

stackTraces ​

CallSite[]

Returns ​

any

See ​

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from ​

Error.prepareStackTrace


SdkHttpError ​

Defined in: packages/core-internal/src/errors/sdkErrors.ts:194

An SdkError subclass for HTTP transport failures.

Thrown by the streamable HTTP transport when the server responds with a non-OK status code. Narrows data to SdkHttpErrorData so consumers can inspect the HTTP status without unsafe casting.

Example ​

ts
if (error instanceof SdkHttpError) {
    console.log(error.status); // number
    console.log(error.statusText); // string | undefined
}

Extends ​

Constructors ​

Constructor ​

new SdkHttpError(code, message, data, options?): SdkHttpError

Defined in: packages/core-internal/src/errors/sdkErrors.ts:204

Parameters ​
code ​

SdkErrorCode

message ​

string

data ​

SdkHttpErrorData

options? ​

ErrorOptions

Standard ErrorOptions, forwarded to Error (see SdkError).

Returns ​

SdkHttpError

Overrides ​

SdkError.constructor

Properties ​

cause? ​

optional cause?: unknown

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26

Inherited from ​

SdkError.cause

code ​

readonly code: SdkErrorCode

Defined in: packages/core-internal/src/errors/sdkErrors.ts:158

Stable string code identifying the failure (SdkErrorCode).

Inherited from ​

SdkError.code

data ​

readonly data: SdkHttpErrorData

Defined in: packages/core-internal/src/errors/sdkErrors.ts:199

Optional structured payload (for example the HTTP status carried by SdkHttpError). Opaque to the SDK: a cause key inside data is not promoted to Error.cause.

Overrides ​

SdkError.data

message ​

message: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from ​

SdkError.message

name ​

name: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from ​

SdkError.name

stack? ​

optional stack?: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from ​

SdkError.stack

stackTraceLimit ​

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from ​

SdkError.stackTraceLimit

Accessors ​

status ​
Get Signature ​

get status(): number

Defined in: packages/core-internal/src/errors/sdkErrors.ts:209

Returns ​

number

statusText ​
Get Signature ​

get statusText(): string | undefined

Defined in: packages/core-internal/src/errors/sdkErrors.ts:213

Returns ​

string | undefined

Methods ​

[hasInstance]() ​

static [hasInstance](value): boolean

Defined in: packages/core-internal/src/errors/sdkErrors.ts:125

Parameters ​
value ​

unknown

Returns ​

boolean

Inherited from ​

SdkError.[hasInstance]

captureStackTrace() ​

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

js
function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
Parameters ​
targetObject ​

object

constructorOpt? ​

Function

Returns ​

void

Inherited from ​

SdkError.captureStackTrace

isError() ​

static isError(error): error is Error

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.error.d.ts:23

Indicates whether the argument provided is a built-in Error instance or not.

Parameters ​
error ​

unknown

Returns ​

error is Error

Inherited from ​

SdkError.isError

isInstance() ​

static isInstance<T>(this, value): value is InstanceType<T>

Defined in: packages/core-internal/src/errors/sdkErrors.ts:138

Brand-based type guard: equivalent to value instanceof this, as an explicit static predicate (the axios/AWS-SDK isInstance style). Reads the caller's own brand via this, so every branded subclass gets a correctly-scoped guard by inheritance. Must be invoked on the class — in callback position write v => SdkError.isInstance(v), not .filter(SdkError.isInstance) (detached calls throw rather than silently matching nothing).

Type Parameters ​
T ​

T extends (...args) => unknown

Parameters ​
this ​

T

value ​

unknown

Returns ​

value is InstanceType<T>

Inherited from ​

SdkError.isInstance

prepareStackTrace() ​

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:56

Parameters ​
err ​

Error

stackTraces ​

CallSite[]

Returns ​

any

See ​

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from ​

SdkError.prepareStackTrace


UnsupportedProtocolVersionError ​

Defined in: packages/core-internal/src/types/errors.ts:169

Error type for the -32022 UnsupportedProtocolVersion protocol error (protocol revision 2026-07-28): the request's protocol version is unknown to the server or unsupported by it.

The error data lists the protocol versions the receiver supports (supported), so the sender can choose a mutually supported version and retry, and echoes the version that was requested (requested).

Extends ​

Constructors ​

Constructor ​

new UnsupportedProtocolVersionError(data, message?): UnsupportedProtocolVersionError

Defined in: packages/core-internal/src/types/errors.ts:174

Parameters ​
data ​

UnsupportedProtocolVersionErrorData

message? ​

string = ...

Returns ​

UnsupportedProtocolVersionError

Overrides ​

ProtocolError.constructor

Properties ​

cause? ​

optional cause?: unknown

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26

Inherited from ​

ProtocolError.cause

code ​

readonly code: number

Defined in: packages/core-internal/src/types/errors.ts:47

Inherited from ​

ProtocolError.code

data? ​

readonly optional data?: unknown

Defined in: packages/core-internal/src/types/errors.ts:49

Inherited from ​

ProtocolError.data

message ​

message: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from ​

ProtocolError.message

name ​

name: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from ​

ProtocolError.name

stack? ​

optional stack?: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from ​

ProtocolError.stack

stackTraceLimit ​

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from ​

ProtocolError.stackTraceLimit

Accessors ​

requested ​
Get Signature ​

get requested(): string

Defined in: packages/core-internal/src/types/errors.ts:188

The protocol version that was requested.

Returns ​

string

supported ​
Get Signature ​

get supported(): string[]

Defined in: packages/core-internal/src/types/errors.ts:181

Protocol versions the receiver supports.

Returns ​

string[]

Methods ​

[hasInstance]() ​

static [hasInstance](value): boolean

Defined in: packages/core-internal/src/types/errors.ts:24

Parameters ​
value ​

unknown

Returns ​

boolean

Inherited from ​

ProtocolError.[hasInstance]

captureStackTrace() ​

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

js
function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
Parameters ​
targetObject ​

object

constructorOpt? ​

Function

Returns ​

void

Inherited from ​

ProtocolError.captureStackTrace

fromError() ​

static fromError(code, message, data?): ProtocolError

Defined in: packages/core-internal/src/types/errors.ts:59

Factory method to create the appropriate error type based on the error code and data

Parameters ​
code ​

number

message ​

string

data? ​

unknown

Returns ​

ProtocolError

Inherited from ​

ProtocolError.fromError

isError() ​

static isError(error): error is Error

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.error.d.ts:23

Indicates whether the argument provided is a built-in Error instance or not.

Parameters ​
error ​

unknown

Returns ​

error is Error

Inherited from ​

ProtocolError.isError

isInstance() ​

static isInstance<T>(this, value): value is InstanceType<T>

Defined in: packages/core-internal/src/types/errors.ts:37

Brand-based type guard: equivalent to value instanceof this, as an explicit static predicate (the axios/AWS-SDK isInstance style). Reads the caller's own brand via this, so every branded subclass gets a correctly-scoped guard by inheritance. Must be invoked on the class — in callback position write v => SdkError.isInstance(v), not .filter(SdkError.isInstance) (detached calls throw rather than silently matching nothing).

Type Parameters ​
T ​

T extends (...args) => unknown

Parameters ​
this ​

T

value ​

unknown

Returns ​

value is InstanceType<T>

Inherited from ​

ProtocolError.isInstance

prepareStackTrace() ​

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:56

Parameters ​
err ​

Error

stackTraces ​

CallSite[]

Returns ​

any

See ​

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from ​

ProtocolError.prepareStackTrace


UriTemplate ​

Defined in: packages/core-internal/src/shared/uriTemplate.ts:10

Constructors ​

Constructor ​

new UriTemplate(template): UriTemplate

Defined in: packages/core-internal/src/shared/uriTemplate.ts:34

Parameters ​
template ​

string

Returns ​

UriTemplate

Accessors ​

variableNames ​
Get Signature ​

get variableNames(): string[]

Defined in: packages/core-internal/src/shared/uriTemplate.ts:30

Returns ​

string[]

Methods ​

expand() ​

expand(variables): string

Defined in: packages/core-internal/src/shared/uriTemplate.ts:172

Parameters ​
variables ​

Variables

Returns ​

string

match() ​

match(uri): Variables | null

Defined in: packages/core-internal/src/shared/uriTemplate.ts:255

Parameters ​
uri ​

string

Returns ​

Variables | null

toString() ​

toString(): string

Defined in: packages/core-internal/src/shared/uriTemplate.ts:40

Returns ​

string

isTemplate() ​

static isTemplate(str): boolean

Defined in: packages/core-internal/src/shared/uriTemplate.ts:16

Returns true if the given string contains any URI template expressions. A template expression is a sequence of characters enclosed in curly braces, like {foo} or {?bar}.

Parameters ​
str ​

string

Returns ​

boolean


UrlElicitationRequiredError ​

Defined in: packages/core-internal/src/types/errors.ts:144

Specialized error type when a tool requires a URL mode elicitation. This makes it nicer for the client to handle since there is specific data to work with instead of just a code to check against.

Extends ​

Constructors ​

Constructor ​

new UrlElicitationRequiredError(elicitations, message?): UrlElicitationRequiredError

Defined in: packages/core-internal/src/types/errors.ts:149

Parameters ​
elicitations ​

object[]

message? ​

string = ...

Returns ​

UrlElicitationRequiredError

Overrides ​

ProtocolError.constructor

Properties ​

cause? ​

optional cause?: unknown

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26

Inherited from ​

ProtocolError.cause

code ​

readonly code: number

Defined in: packages/core-internal/src/types/errors.ts:47

Inherited from ​

ProtocolError.code

data? ​

readonly optional data?: unknown

Defined in: packages/core-internal/src/types/errors.ts:49

Inherited from ​

ProtocolError.data

message ​

message: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from ​

ProtocolError.message

name ​

name: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from ​

ProtocolError.name

stack? ​

optional stack?: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from ​

ProtocolError.stack

stackTraceLimit ​

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from ​

ProtocolError.stackTraceLimit

Accessors ​

elicitations ​
Get Signature ​

get elicitations(): object[]

Defined in: packages/core-internal/src/types/errors.ts:155

Returns ​

Methods ​

[hasInstance]() ​

static [hasInstance](value): boolean

Defined in: packages/core-internal/src/types/errors.ts:24

Parameters ​
value ​

unknown

Returns ​

boolean

Inherited from ​

ProtocolError.[hasInstance]

captureStackTrace() ​

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

js
function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
Parameters ​
targetObject ​

object

constructorOpt? ​

Function

Returns ​

void

Inherited from ​

ProtocolError.captureStackTrace

fromError() ​

static fromError(code, message, data?): ProtocolError

Defined in: packages/core-internal/src/types/errors.ts:59

Factory method to create the appropriate error type based on the error code and data

Parameters ​
code ​

number

message ​

string

data? ​

unknown

Returns ​

ProtocolError

Inherited from ​

ProtocolError.fromError

isError() ​

static isError(error): error is Error

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.error.d.ts:23

Indicates whether the argument provided is a built-in Error instance or not.

Parameters ​
error ​

unknown

Returns ​

error is Error

Inherited from ​

ProtocolError.isError

isInstance() ​

static isInstance<T>(this, value): value is InstanceType<T>

Defined in: packages/core-internal/src/types/errors.ts:37

Brand-based type guard: equivalent to value instanceof this, as an explicit static predicate (the axios/AWS-SDK isInstance style). Reads the caller's own brand via this, so every branded subclass gets a correctly-scoped guard by inheritance. Must be invoked on the class — in callback position write v => SdkError.isInstance(v), not .filter(SdkError.isInstance) (detached calls throw rather than silently matching nothing).

Type Parameters ​
T ​

T extends (...args) => unknown

Parameters ​
this ​

T

value ​

unknown

Returns ​

value is InstanceType<T>

Inherited from ​

ProtocolError.isInstance

prepareStackTrace() ​

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:56

Parameters ​
err ​

Error

stackTraces ​

CallSite[]

Returns ​

any

See ​

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from ​

ProtocolError.prepareStackTrace

Interfaces ​

AuthInfo ​

Defined in: packages/core-internal/src/types/types.ts:727

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

Properties ​

clientId ​

clientId: string

Defined in: packages/core-internal/src/types/types.ts:736

The client ID associated with this token.

expiresAt? ​

optional expiresAt?: number

Defined in: packages/core-internal/src/types/types.ts:746

When the token expires (in seconds since epoch).

extra? ​

optional extra?: Record<string, unknown>

Defined in: packages/core-internal/src/types/types.ts:771

Additional data associated with the token. This field should be used for any additional data that needs to be attached to the auth info.

resource? ​

optional resource?: URL

Defined in: packages/core-internal/src/types/types.ts:752

The RFC 8707 resource server identifier for which this token is valid. If set, this MUST match the MCP server's resource identifier (minus hash fragment).

resourceMetadataUrl? ​

optional resourceMetadataUrl?: string

Defined in: packages/core-internal/src/types/types.ts:765

URL of the RFC 9728 Protected Resource Metadata document for the resource server that accepted this token.

The bearer-auth helpers stamp their configured resourceMetadataUrl here when verification succeeds, so challenge responses built after authentication (for example per-operation insufficient_scope scope challenges) can advertise the same document as the authentication gate's own challenges without separate configuration. Verifiers may also populate it directly; a verifier-set value wins.

scopes ​

scopes: string[]

Defined in: packages/core-internal/src/types/types.ts:741

Scopes associated with this token.

token ​

token: string

Defined in: packages/core-internal/src/types/types.ts:731

The access token.


CreateMessageRequestParamsWithTools ​

Defined in: packages/core-internal/src/types/types.ts:960

CreateMessageRequestParams with required tools - for tool-enabled overload.

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.

Extends ​

Properties ​

_meta? ​

optional _meta?: object

Defined in: packages/core/src/schemas.ts:54

See General fields: _meta for notes on _meta usage.

Index Signature ​

[key: string]: unknown

optional io.modelcontextprotocol/related-task?: object

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

taskId: string

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.

Inherited from ​

CreateMessageRequestParams._meta

includeContext? ​

optional includeContext?: "none" | "thisServer" | "allServers"

Defined in: packages/core/src/schemas.ts:1729

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

Inherited from ​

CreateMessageRequestParams.includeContext

maxTokens ​

maxTokens: number

Defined in: packages/core/src/schemas.ts:1736

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

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

Inherited from ​

CreateMessageRequestParams.maxTokens

messages ​

messages: object[]

Defined in: packages/core/src/schemas.ts:1709

_meta? ​

optional _meta?: object

See MCP specification for notes on _meta usage.

Index Signature ​

[key: string]: unknown

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; }; 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"; })[]

Union Members ​
Type Literal ​

{ _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; text: string; type: "text"; }

_meta? ​

optional _meta?: object

See MCP specification for notes on _meta usage.

Index Signature ​

[key: string]: unknown

annotations? ​

optional annotations?: object

Optional annotations for the client.

annotations.audience? ​

optional audience?: ("user" | "assistant")[]

Intended audience(s) for the resource.

annotations.lastModified? ​

optional lastModified?: string

ISO 8601 timestamp for the most recent modification.

annotations.priority? ​

optional priority?: number

Importance hint for the resource, from 0 (least) to 1 (most).

text ​

text: string

The text content of the message.

type ​

type: "text"


Type Literal ​

{ _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "image"; }

_meta? ​

optional _meta?: object

See MCP specification for notes on _meta usage.

Index Signature ​

[key: string]: unknown

annotations? ​

optional annotations?: object

Optional annotations for the client.

annotations.audience? ​

optional audience?: ("user" | "assistant")[]

Intended audience(s) for the resource.

annotations.lastModified? ​

optional lastModified?: string

ISO 8601 timestamp for the most recent modification.

annotations.priority? ​

optional priority?: number

Importance hint for the resource, from 0 (least) to 1 (most).

data ​

data: string = Base64Schema

The base64-encoded image data.

mimeType ​

mimeType: string

The MIME type of the image. Different providers may support different image types.

type ​

type: "image"


Type Literal ​

{ _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "audio"; }

_meta? ​

optional _meta?: object

See MCP specification for notes on _meta usage.

Index Signature ​

[key: string]: unknown

annotations? ​

optional annotations?: object

Optional annotations for the client.

annotations.audience? ​

optional audience?: ("user" | "assistant")[]

Intended audience(s) for the resource.

annotations.lastModified? ​

optional lastModified?: string

ISO 8601 timestamp for the most recent modification.

annotations.priority? ​

optional priority?: number

Importance hint for the resource, from 0 (least) to 1 (most).

data ​

data: string = Base64Schema

The base64-encoded audio data.

mimeType ​

mimeType: string

The MIME type of the audio. Different providers may support different audio types.

type ​

type: "audio"


Type Literal ​

{ _meta?: {[key: string]: unknown; }; id: string; input: {[key: string]: unknown; }; name: string; type: "tool_use"; }

_meta? ​

optional _meta?: object

See MCP specification for notes on _meta usage.

Index Signature ​

[key: string]: unknown

id ​

id: string

Unique identifier for this tool call. Used to correlate with ToolResultContent in subsequent messages.

input ​

input: object

Arguments to pass to the tool. Must conform to the tool's inputSchema.

Index Signature ​

[key: string]: unknown

name ​

name: string

The name of the tool to invoke. Must match a tool name from the request's tools array.

type ​

type: "tool_use"


Type Literal ​

{ _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? ​

optional _meta?: object

See MCP specification for notes on _meta usage.

Index Signature ​

[key: string]: unknown

content ​

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? ​

optional isError?: boolean

structuredContent? ​

optional structuredContent?: unknown

SEP-2106: any JSON value is permitted. The 2025-11-25 wire parse retains the object-only constraint via the frozen schema in wire/rev2025-11-25/schemas.ts.

toolUseId ​

toolUseId: string

type ​

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"; })[]

role ​

role: "user" | "assistant" = RoleSchema

Inherited from ​

CreateMessageRequestParams.messages

metadata? ​

optional metadata?: object

Defined in: packages/core/src/schemas.ts:1741

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

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

Inherited from ​

CreateMessageRequestParams.metadata

modelPreferences? ​

optional modelPreferences?: object

Defined in: packages/core/src/schemas.ts:1713

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

costPriority? ​

optional costPriority?: number

How much to prioritize cost when selecting a model.

hints? ​

optional hints?: object[]

Optional hints to use for model selection.

intelligencePriority? ​

optional intelligencePriority?: number

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

speedPriority? ​

optional speedPriority?: number

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

Inherited from ​

CreateMessageRequestParams.modelPreferences

stopSequences? ​

optional stopSequences?: string[]

Defined in: packages/core/src/schemas.ts:1737

Inherited from ​

CreateMessageRequestParams.stopSequences

systemPrompt? ​

optional systemPrompt?: string

Defined in: packages/core/src/schemas.ts:1717

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

Inherited from ​

CreateMessageRequestParams.systemPrompt

task? ​

optional task?: object

Defined in: packages/core/src/schemas.ts:71

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.

ttl? ​

optional ttl?: number

Inherited from ​

CreateMessageRequestParams.task

temperature? ​

optional temperature?: number

Defined in: packages/core/src/schemas.ts:1730

Inherited from ​

CreateMessageRequestParams.temperature

toolChoice? ​

optional toolChoice?: object

Defined in: packages/core/src/schemas.ts:1752

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" }.

mode? ​

optional 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
Inherited from ​

CreateMessageRequestParams.toolChoice

tools ​

tools: object[]

Defined in: packages/core-internal/src/types/types.ts:961

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.

_meta? ​

optional _meta?: object

See MCP specification for notes on _meta usage.

Index Signature ​

[key: string]: unknown

annotations? ​

optional annotations?: object

Optional additional tool information.

annotations.destructiveHint? ​

optional destructiveHint?: boolean

If true, the tool may perform destructive updates to its environment. If false, the tool performs only additive updates.

(This property is meaningful only when readOnlyHint == false)

Default: true

annotations.idempotentHint? ​

optional idempotentHint?: boolean

If true, calling the tool repeatedly with the same arguments will have no additional effect on its environment.

(This property is meaningful only when readOnlyHint == false)

Default: false

annotations.openWorldHint? ​

optional openWorldHint?: boolean

If true, this tool may interact with an "open world" of external entities. If false, the tool's domain of interaction is closed. For example, the world of a web search tool is open, whereas that of a memory tool is not.

Default: true

annotations.readOnlyHint? ​

optional readOnlyHint?: boolean

If true, the tool does not modify its environment.

Default: false

annotations.title? ​

optional title?: string

A human-readable title for the tool.

description? ​

optional description?: string

A human-readable description of the tool.

execution? ​

optional execution?: object

Execution-related properties for this tool.

execution.taskSupport? ​

optional taskSupport?: "optional" | "required" | "forbidden"

Indicates the tool's preference for task-augmented execution.

  • "required": Clients MUST invoke the tool as a task
  • "optional": Clients MAY invoke the tool as a task or normal request
  • "forbidden": Clients MUST NOT attempt to invoke the tool as a task

If not present, defaults to "forbidden".

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)
inputSchema ​

inputSchema: object

A JSON Schema 2020-12 object defining the expected parameters for the tool. Must have type: 'object' at the root level per MCP spec.

Index Signature ​

[key: string]: unknown

inputSchema.properties? ​

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

inputSchema.required? ​

optional required?: string[]

inputSchema.type ​

type: "object"

name ​

name: string

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

outputSchema? ​

optional outputSchema?: object

An optional JSON Schema 2020-12 document describing the structure of the tool's output returned in the structuredContent field of a CallToolResult.

SEP-2106: any JSON Schema root is permitted (e.g. type:'array', oneOf, $ref). The 2025-11-25 wire parse retains the type:'object' constraint via the frozen schema in wire/rev2025-11-25/schemas.ts; this neutral/public schema widens.

Index Signature ​

[key: string]: unknown

outputSchema.$schema? ​

optional $schema?: string

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

Overrides ​

CreateMessageRequestParams.tools


InputRequests ​

Defined in: packages/core-internal/src/types/types.ts:608

A map of embedded input requests, keyed by server-assigned identifiers that are unique within the scope of the request.

Indexable ​

[key: string]: InputRequest


InputRequiredOptions ​

Defined in: packages/core-internal/src/shared/inputRequiredDriver.ts:48

Multi-round-trip driver options (inputRequired on the client options bag).

Properties ​

autoFulfill? ​

optional autoFulfill?: boolean

Defined in: packages/core-internal/src/shared/inputRequiredDriver.ts:60

Fulfil input_required results automatically by dispatching the embedded requests to the registered handlers and retrying.

Set to false for manual mode: an input_required response then surfaces as a typed error unless the individual call opts in with allowInputRequired: true (and, for typed results on the explicit schema path, withInputRequired()).

Default ​
ts
true
maxRounds? ​

optional maxRounds?: number

Defined in: packages/core-internal/src/shared/inputRequiredDriver.ts:69

Maximum number of rounds (retries) the driver performs for a single call before failing with a typed SdkErrorCode.InputRequiredRoundsExceeded error.

Default ​
ts
10

InputRequiredResult ​

Defined in: packages/core-internal/src/types/types.ts:647

The input-required result a handler for a multi-round-trip method (tools/call, prompts/get, resources/read) returns to request more input from the client (protocol revision 2026-07-28). Build it with the inputRequired() builder; hand-built literals are equally legal — resultType: 'input_required' is the discriminator, and the SDK re-checks the at-least-one rule at the seam.

This is the one place the wire discriminator resultType appears on the neutral surface: the handler authors it, the 2026-07-28 codec passes it through to the wire, and consumers receiving results never see it (complete results are lifted).

At least one of inputRequests or requestState must be present.

requestState is an opaque, server-minted string echoed back verbatim by the client on retry. It travels through the client and MUST be treated by the server as attacker-controlled input on re-entry: if it influences authorization, resource access, or business logic, the server MUST protect its integrity (e.g. HMAC or AEAD) and MUST reject state that fails verification (spec: basic/patterns/mrtr §Server Requirements). The SDK applies no integrity protection by default — without a configured ServerOptions.requestState.verify hook, ctx.mcpReq.requestState() returns the raw, unverified string; with one, the seam rejects state the hook refuses and the accessor returns the hook's decoded payload.

Extends ​

Indexable ​

[key: string]: unknown

Properties ​

_meta? ​

optional _meta?: object

Defined in: packages/core/src/schemas.ts:119

See MCP specification for notes on _meta usage.

Index Signature ​

[key: string]: unknown

io.modelcontextprotocol/serverInfo? ​

optional io.modelcontextprotocol/serverInfo?: object

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

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

name: string

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

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

io.modelcontextprotocol/serverInfo.version ​

version: string

io.modelcontextprotocol/serverInfo.websiteUrl? ​

optional websiteUrl?: string

An optional URL of the website for this implementation.

Inherited from ​

Result._meta

inputRequests? ​

optional inputRequests?: InputRequests

Defined in: packages/core-internal/src/types/types.ts:650

Embedded requests the client must fulfil before retrying.

requestState? ​

optional requestState?: string

Defined in: packages/core-internal/src/types/types.ts:652

Opaque server state the client echoes back verbatim on retry.

resultType ​

resultType: "input_required"

Defined in: packages/core-internal/src/types/types.ts:648


InputResponses ​

Defined in: packages/core-internal/src/types/types.ts:617

A map of embedded input responses. Keys correspond to the keys of the InputRequests map the server sent; values are the client's bare result for each request.

Indexable ​

[key: string]: InputResponse


InternalError ​

Defined in: packages/core-internal/src/types/types.ts:788

Extends ​

  • JSONRPCErrorObject

Properties ​

code ​

code: -32603

Defined in: packages/core-internal/src/types/types.ts:789

Overrides ​

JSONRPCErrorObject.code

data? ​

optional data?: unknown

Defined in: packages/core-internal/src/types/types.ts:774

Inherited from ​

JSONRPCErrorObject.data

message ​

message: string

Defined in: packages/core-internal/src/types/types.ts:774

Inherited from ​

JSONRPCErrorObject.message


InvalidParamsError ​

Defined in: packages/core-internal/src/types/types.ts:785

Extends ​

  • JSONRPCErrorObject

Properties ​

code ​

code: -32602

Defined in: packages/core-internal/src/types/types.ts:786

Overrides ​

JSONRPCErrorObject.code

data? ​

optional data?: unknown

Defined in: packages/core-internal/src/types/types.ts:774

Inherited from ​

JSONRPCErrorObject.data

message ​

message: string

Defined in: packages/core-internal/src/types/types.ts:774

Inherited from ​

JSONRPCErrorObject.message


InvalidRequestError ​

Defined in: packages/core-internal/src/types/types.ts:779

Extends ​

  • JSONRPCErrorObject

Properties ​

code ​

code: -32600

Defined in: packages/core-internal/src/types/types.ts:780

Overrides ​

JSONRPCErrorObject.code

data? ​

optional data?: unknown

Defined in: packages/core-internal/src/types/types.ts:774

Inherited from ​

JSONRPCErrorObject.data

message ​

message: string

Defined in: packages/core-internal/src/types/types.ts:774

Inherited from ​

JSONRPCErrorObject.message


jsonSchemaValidator ​

Defined in: packages/core-internal/src/validators/types.ts:51

Provider interface for creating validators from JSON Schemas

This is the main extension point for custom validator implementations. Implementations should:

  • Support JSON Schema Draft 2020-12 (or be compatible with it)
  • Return validator functions that can be called multiple times
  • Handle schema compilation/caching internally
  • Provide clear error messages on validation failure

Example ​

ts
class MyValidatorProvider implements jsonSchemaValidator {
    getValidator<T>(schema: JsonSchemaType): JsonSchemaValidator<T> {
        // Compile/cache validator from schema
        return (input: unknown) =>
            isValid(schema, input)
                ? { valid: true, data: input as T, errorMessage: undefined }
                : { valid: false, data: undefined, errorMessage: 'Error details' };
    }
}

Methods ​

getValidator() ​

getValidator<T>(schema): JsonSchemaValidator<T>

Defined in: packages/core-internal/src/validators/types.ts:58

Create a validator for the given JSON Schema

Type Parameters ​
T ​

T

Parameters ​
schema ​

JsonSchemaType

Standard JSON Schema object

Returns ​

JsonSchemaValidator<T>

A validator function that can be called multiple times


MessageClassification ​

Defined in: packages/core-internal/src/types/types.ts:887

Protocol-era classification of an inbound message.

Populated by transports that classify messages at the edge (e.g. an HTTP entry distinguishing 2025-era from 2026-era traffic). The wire era itself is connection state (the negotiated protocol version held by the Client/Server instance); the protocol layer validates a classified message against that instance era at dispatch — a mismatch is treated as an entry/routing error, never a per-message era switch. Unclassified traffic is dispatched on the instance era unchanged.

Properties ​

era ​

era: "legacy" | "modern"

Defined in: packages/core-internal/src/types/types.ts:892

The wire era the message was classified into: legacy for the 2025-11-25 family of revisions, modern for 2026-07-28 and later.

revision? ​

optional revision?: string

Defined in: packages/core-internal/src/types/types.ts:897

The exact protocol revision, when the classifier derived one.


MessageExtraInfo ​

Defined in: packages/core-internal/src/types/types.ts:903

Extra information about a message.

Properties ​

authInfo? ​

optional authInfo?: AuthInfo

Defined in: packages/core-internal/src/types/types.ts:920

The authentication information.

classification? ​

optional classification?: MessageClassification

Defined in: packages/core-internal/src/types/types.ts:915

Protocol-era classification of the message, when the transport classified it at the edge. Validated by the protocol layer against the instance's negotiated era at dispatch (the edge→instance handoff check); it does not select the era itself.

closeSSEStream? ​

optional closeSSEStream?: () => void

Defined in: packages/core-internal/src/types/types.ts:926

Callback to close the SSE stream for this request, triggering client reconnection. Only available when using NodeStreamableHTTPServerTransport with eventStore configured.

Returns ​

void

closeStandaloneSSEStream? ​

optional closeStandaloneSSEStream?: () => void

Defined in: packages/core-internal/src/types/types.ts:932

Callback to close the standalone GET SSE stream, triggering client reconnection. Only available when using NodeStreamableHTTPServerTransport with eventStore configured.

Returns ​

void

request? ​

optional request?: Request

Defined in: packages/core-internal/src/types/types.ts:907

The original HTTP request.


MethodNotFoundError ​

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

Extends ​

  • JSONRPCErrorObject

Properties ​

code ​

code: -32601

Defined in: packages/core-internal/src/types/types.ts:783

Overrides ​

JSONRPCErrorObject.code

data? ​

optional data?: unknown

Defined in: packages/core-internal/src/types/types.ts:774

Inherited from ​

JSONRPCErrorObject.data

message ​

message: string

Defined in: packages/core-internal/src/types/types.ts:774

Inherited from ​

JSONRPCErrorObject.message


MissingRequiredClientCapabilityErrorData ​

Defined in: packages/core-internal/src/types/types.ts:796

Data carried by a -32021 MissingRequiredClientCapability protocol error (protocol revision 2026-07-28).

Properties ​

requiredCapabilities ​

requiredCapabilities: object

Defined in: packages/core-internal/src/types/types.ts:802

The capabilities the server requires from the client to process the request, in the ClientCapabilities shape (only the missing capabilities are listed).

elicitation? ​

optional elicitation?: object

Present if the client supports eliciting user input.

Index Signature ​

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

elicitation.form? ​

optional form?: object

Index Signature ​

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

elicitation.form.applyDefaults? ​

optional applyDefaults?: boolean

elicitation.url? ​

optional url?: object

Index Signature ​

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

experimental? ​

optional experimental?: object

Experimental, non-standard capabilities that the client supports.

Index Signature ​

[key: string]: object

extensions? ​

optional extensions?: object

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

Index Signature ​

[key: string]: object

roots? ​

optional roots?: object

Present if the client supports listing roots.

Deprecated ​

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

roots.listChanged? ​

optional listChanged?: boolean

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

sampling? ​

optional sampling?: object

Present if the client supports sampling from an LLM.

Deprecated ​

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

sampling.context? ​

optional context?: object

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

Index Signature ​

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

sampling.tools? ​

optional tools?: object

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

Index Signature ​

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

tasks? ​

optional tasks?: object

Present if the client supports task creation.

Index Signature ​

[key: string]: unknown

Deprecated ​

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

tasks.cancel? ​

optional cancel?: object

Present if the client supports cancelling tasks.

Index Signature ​

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

tasks.list? ​

optional list?: object

Present if the client supports listing tasks.

Index Signature ​

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

tasks.requests? ​

optional requests?: object

Capabilities for task creation on specific request types.

Index Signature ​

[key: string]: unknown

tasks.requests.elicitation? ​

optional elicitation?: object

Task support for elicitation requests.

Index Signature ​

[key: string]: unknown

tasks.requests.elicitation.create? ​

optional create?: object

Index Signature ​

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

tasks.requests.sampling? ​

optional sampling?: object

Task support for sampling requests.

Index Signature ​

[key: string]: unknown

tasks.requests.sampling.createMessage? ​

optional createMessage?: object

Index Signature ​

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


ParseError ​

Defined in: packages/core-internal/src/types/types.ts:776

Extends ​

  • JSONRPCErrorObject

Properties ​

code ​

code: -32700

Defined in: packages/core-internal/src/types/types.ts:777

Overrides ​

JSONRPCErrorObject.code

data? ​

optional data?: unknown

Defined in: packages/core-internal/src/types/types.ts:774

Inherited from ​

JSONRPCErrorObject.data

message ​

message: string

Defined in: packages/core-internal/src/types/types.ts:774

Inherited from ​

JSONRPCErrorObject.message


RequestHandlerSchemas ​

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

Schema bundle accepted by setRequestHandler's 3-arg form.

params is required and validates the inbound request.params. result is optional; when supplied it types the handler's return value (no runtime validation is performed on the result).

Type Parameters ​

P ​

P extends StandardSchemaV1 = StandardSchemaV1

R ​

R extends StandardSchemaV1 | undefined = StandardSchemaV1 | undefined

Properties ​

params ​

params: P

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

result? ​

optional result?: R

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


SdkHttpErrorData ​

Defined in: packages/core-internal/src/errors/sdkErrors.ts:172

Typed shape for HTTP error data carried by SdkHttpError.

Indexable ​

[key: string]: unknown

Properties ​

status ​

status: number

Defined in: packages/core-internal/src/errors/sdkErrors.ts:173

statusText? ​

optional statusText?: string

Defined in: packages/core-internal/src/errors/sdkErrors.ts:174


StandardSchemaV1 ​

Defined in: packages/core-internal/src/util/standardSchema.ts:35

Extended by ​

Type Parameters ​

Input ​

Input = unknown

Output ​

Output = Input

Properties ​

~standard ​

readonly ~standard: Props<Input, Output>

Defined in: packages/core-internal/src/util/standardSchema.ts:36


StandardSchemaV1Sync ​

Defined in: packages/core-internal/src/util/standardSchema.ts:128

Narrowing of StandardSchemaV1 whose validate is guaranteed synchronous.

The Zod schemas backing specTypeSchemas contain no async refinements or transforms, so every entry satisfies this interface. Consumers can call validate() and access .issues / .value on the result without await.

StandardSchemaV1Sync is assignable to StandardSchemaV1 — it is a strict subtype.

Extends ​

Type Parameters ​

Input ​

Input = unknown

Output ​

Output = Input

Properties ​

~standard ​

readonly ~standard: Props<Input, Output>

Defined in: packages/core-internal/src/util/standardSchema.ts:129

Overrides ​

StandardSchemaV1.~standard


StandardSchemaWithJSON ​

Defined in: packages/core-internal/src/util/standardSchema.ts:110

Combined interface for schemas with both validation and JSON Schema conversion — the intersection of StandardSchemaV1 and StandardJSONSchemaV1.

This is the type accepted by registerTool / registerPrompt. The SDK needs ~standard.jsonSchema to advertise the tool's argument shape in tools/list, and ~standard.validate to check incoming arguments when a tools/call arrives.

Zod v4, ArkType, and Valibot (via @valibot/to-json-schema's toStandardJsonSchema) all implement both interfaces.

See ​

https://standardschema.dev/ for the Standard Schema specification

Type Parameters ​

Input ​

Input = unknown

Output ​

Output = Input

Properties ​

~standard ​

readonly ~standard: Props<Input, Output> & Props<Input, Output>

Defined in: packages/core-internal/src/util/standardSchema.ts:111


Transport ​

Defined in: packages/core-internal/src/shared/transport.ts:107

Describes the minimal contract for an MCP transport that a client or server can communicate over.

Properties ​

hasPerRequestStream? ​

readonly optional hasPerRequestStream?: boolean

Defined in: packages/core-internal/src/shared/transport.ts:139

true when this transport opens one underlying request per outbound JSON-RPC request (the Streamable HTTP POST-per-request model) and therefore honors TransportSendOptions.requestSignal. The 2026-07-28 spec makes closing that per-request stream the cancellation signal — the protocol layer aborts requestSignal instead of POSTing notifications/cancelled when this flag is set on a 2026-era connection. Transports that share a single channel (stdio, in-memory) leave it undefined.

onclose? ​

optional onclose?: () => void

Defined in: packages/core-internal/src/shared/transport.ts:146

Callback for when the connection is closed for any reason.

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

Returns ​

void

onerror? ​

optional onerror?: (error) => void

Defined in: packages/core-internal/src/shared/transport.ts:153

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

onmessage? ​

optional onmessage?: <T>(message, extra?) => void

Defined in: packages/core-internal/src/shared/transport.ts:162

Callback for when a message (request or response) is received over the connection.

Includes the request and authInfo if the transport is authenticated.

The request can be used to get the original request information (headers, etc.)

Type Parameters ​
T ​

T extends JSONRPCMessage

Parameters ​
message ​

T

extra? ​

MessageExtraInfo

Returns ​

void

sessionId? ​

optional sessionId?: string

Defined in: packages/core-internal/src/shared/transport.ts:167

The session ID generated for this connection.

setProtocolVersion? ​

optional setProtocolVersion?: (version) => void

Defined in: packages/core-internal/src/shared/transport.ts:172

Sets the protocol version used for the connection (called when the initialize response is received).

Parameters ​
version ​

string

Returns ​

void

setSupportedProtocolVersions? ​

optional setSupportedProtocolVersions?: (versions) => void

Defined in: packages/core-internal/src/shared/transport.ts:178

Sets the supported protocol versions for header validation (called during connect). This allows the server to pass its supported versions to the transport.

Parameters ​
versions ​

string[]

Returns ​

void

Methods ​

close() ​

close(): Promise<void>

Defined in: packages/core-internal/src/shared/transport.ts:127

Closes the connection.

Returns ​

Promise<void>

send() ​

send(message, options?): Promise<void>

Defined in: packages/core-internal/src/shared/transport.ts:122

Sends a JSON-RPC message (request or response).

If present, relatedRequestId is used to indicate to the transport which incoming request to associate this outgoing message with.

Parameters ​
message ​

JSONRPCMessage

options? ​

TransportSendOptions

Returns ​

Promise<void>

start() ​

start(): Promise<void>

Defined in: packages/core-internal/src/shared/transport.ts:115

Starts processing messages on the transport, including any connection steps that might need to be taken.

This method should only be called after callbacks are installed, or else messages may be lost.

NOTE: This method should not be called explicitly when using Client or Server classes, as they will implicitly call start().

Returns ​

Promise<void>


UnsupportedProtocolVersionErrorData ​

Defined in: packages/core-internal/src/types/types.ts:809

Data carried by a -32022 UnsupportedProtocolVersion protocol error (protocol revision 2026-07-28).

Properties ​

requested ​

requested: string

Defined in: packages/core-internal/src/types/types.ts:818

The protocol version that was requested.

supported ​

supported: string[]

Defined in: packages/core-internal/src/types/types.ts:814

Protocol versions the receiver supports. The sender should choose a mutually supported version from this list and retry.

Type Aliases ​

Annotations ​

Annotations = Infer<typeof AnnotationsSchema>

Defined in: packages/core-internal/src/types/types.ts:270


AudioContent ​

AudioContent = Infer<typeof AudioContentSchema>

Defined in: packages/core-internal/src/types/types.ts:396


AuthorizationServerMetadata ​

AuthorizationServerMetadata = OAuthMetadata | OpenIdProviderDiscoveryMetadata

Defined in: packages/core/src/auth.ts:300


BaseContext ​

BaseContext = object

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

Base context provided to all request handlers.

Properties ​

http? ​

optional http?: object

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

HTTP transport information, only available when using an HTTP-based transport.

authInfo? ​

optional authInfo?: AuthInfo

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

mcpReq ​

mcpReq: object

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

Information about the MCP request being handled.

_meta? ​

optional _meta?: RequestMeta

Metadata from the original request, with the reserved io.modelcontextprotocol/* envelope keys already lifted out (readable via ctx.mcpReq.envelope).

droppedInputResponseKeys? ​

optional droppedInputResponseKeys?: string[]

Keys of inputResponses entries the SDK dropped because they were not bare response objects (for example the wrapped {method, result} shape some peers emit). Surfaced so a handler can re-issue the corresponding input request rather than hard-fail.

envelope? ​

optional envelope?: Partial<RequestMetaEnvelope>

The per-request _meta envelope (protocol revision 2026-07-28): the reserved io.modelcontextprotocol/* keys carried by the request, lifted out of the _meta the handler sees. Surfaced as received — Partial because only the keys the request actually carried are present (envelope requiredness is enforced per request at dispatch time, not by the lift); only present at all when the request carried envelope keys.

id ​

id: RequestId

The JSON-RPC ID of the request being handled.

inputResponses? ​

optional inputResponses?: Record<string, unknown>

Multi-round-trip input responses carried by a retried request (protocol revision 2026-07-28), lifted out of the params the handler sees. Entries are the BARE response objects keyed by the identifiers the server assigned in inputRequests; entries that do not look like bare responses (e.g. a {method, result} wrapper) are dropped and their keys recorded in droppedInputResponseKeys.

The values arrive from the client and are NOT validated by the SDK — treat them as untrusted input.

method ​

method: string

The method name of the request (e.g., 'tools/call', 'ping').

notify ​

notify: (notification) => Promise<void>

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

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

Parameters ​
notification ​

Notification

Returns ​

Promise<void>

requestState ​

requestState: RequestStateAccessor

Reads the multi-round-trip request state for the current round: the value the configured ServerOptions.requestState.verify hook resolved with (e.g. createRequestStateCodec.verify's decoded payload — mint<T>/requestState<T>() are the typed pair), the raw wire string when no hook is configured, or undefined when the round carried no state. The type parameter is a compile-time cast only.

SECURITY: requestState round-trips through the client and MUST be treated as attacker-controlled input. The SDK applies no integrity protection by default — servers whose state influences authorization or business logic MUST integrity-protect it and verify via the requestState.verify hook (spec: basic/patterns/mrtr, server requirements 4–5).

send ​

send: {<M>(request, options?): Promise<ResultTypeMap[M]>; <T>(request, resultSchema, options?): Promise<InferOutput<T>>; }

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

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

For spec methods the result type is inferred from the method name. For custom (non-spec) methods, pass a result schema as the second argument.

Call Signature ​

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

Type Parameters ​
M ​

M extends RequestMethod

Parameters ​
request ​
method ​

M

params? ​

Record<string, unknown>

options? ​

RequestOptions

Returns ​

Promise<ResultTypeMap[M]>

Call Signature ​

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

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

signal ​

signal: AbortSignal

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

sessionId? ​

optional sessionId?: string

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

The session ID from the transport, if available.


BaseMetadata ​

BaseMetadata = Infer<typeof BaseMetadataSchema>

Defined in: packages/core-internal/src/types/types.ts:269


BlobResourceContents ​

BlobResourceContents = Infer<typeof BlobResourceContentsSchema>

Defined in: packages/core-internal/src/types/types.ts:358


BooleanSchema ​

BooleanSchema = Infer<typeof BooleanSchemaSchema>

Defined in: packages/core-internal/src/types/types.ts:523


CallToolRequest ​

CallToolRequest = Infer<typeof CallToolRequestSchema>

Defined in: packages/core-internal/src/types/types.ts:425


CallToolRequestParams ​

CallToolRequestParams = Infer<typeof CallToolRequestParamsSchema>

Defined in: packages/core-internal/src/types/types.ts:422


CallToolResult ​

CallToolResult = StripWireOnly<Infer<typeof CallToolResultSchema>>

Defined in: packages/core-internal/src/types/types.ts:423


CancelledNotification ​

CancelledNotification = Infer<typeof CancelledNotificationSchema>

Defined in: packages/core-internal/src/types/types.ts:264


CancelledNotificationParams ​

CancelledNotificationParams = Infer<typeof CancelledNotificationParamsSchema>

Defined in: packages/core-internal/src/types/types.ts:263


CancelTaskRequest ​

CancelTaskRequest = Infer<typeof CancelTaskRequestSchema>

Defined in: packages/core-internal/src/types/types.ts:344

Deprecated ​

2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.


CancelTaskResult ​

CancelTaskResult = StripWireOnly<Infer<typeof CancelTaskResultSchema>>

Defined in: packages/core-internal/src/types/types.ts:346

Deprecated ​

2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.


ClientCapabilities ​

ClientCapabilities = Infer<typeof ClientCapabilitiesSchema>

Defined in: packages/core-internal/src/types/types.ts:282

Capabilities a client may support.

Note: the roots and sampling capabilities are deprecated as of protocol version 2026-07-28 (SEP-2577); they remain in the specification for at least twelve months. See ClientCapabilitiesSchema.


ClientContext ​

ClientContext = BaseContext

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

Context provided to client-side request handlers.


ClientNotification ​

ClientNotification = Infer<typeof ClientNotificationSchema>

Defined in: packages/core-internal/src/types/types.ts:657


ClientRequest ​

ClientRequest = Infer<typeof ClientRequestSchema>

Defined in: packages/core-internal/src/types/types.ts:656


ClientResult ​

ClientResult = StripWireOnly<Infer<typeof ClientResultSchema>>

Defined in: packages/core-internal/src/types/types.ts:658


CompatibilityCallToolResult ​

CompatibilityCallToolResult = StripWireOnly<Infer<typeof CompatibilityCallToolResultSchema>>

Defined in: packages/core-internal/src/types/types.ts:424


CompleteRequest ​

CompleteRequest = Infer<typeof CompleteRequestSchema>

Defined in: packages/core-internal/src/types/types.ts:549


CompleteRequestParams ​

CompleteRequestParams = Infer<typeof CompleteRequestParamsSchema>

Defined in: packages/core-internal/src/types/types.ts:548


CompleteRequestPrompt ​

CompleteRequestPrompt = ExpandRecursively<CompleteRequest & object>

Defined in: packages/core-internal/src/types/types.ts:967


CompleteRequestResourceTemplate ​

CompleteRequestResourceTemplate = ExpandRecursively<CompleteRequest & object>

Defined in: packages/core-internal/src/types/types.ts:964


CompleteResult ​

CompleteResult = StripWireOnly<Infer<typeof CompleteResultSchema>>

Defined in: packages/core-internal/src/types/types.ts:550


ContentBlock ​

ContentBlock = Infer<typeof ContentBlockSchema>

Defined in: packages/core-internal/src/types/types.ts:411


CreateMessageRequest ​

CreateMessageRequest = Infer<typeof CreateMessageRequestSchema>

Defined in: packages/core-internal/src/types/types.ts:508

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.


CreateMessageRequestParams ​

CreateMessageRequestParams = Infer<typeof CreateMessageRequestParamsSchema>

Defined in: packages/core-internal/src/types/types.ts:502

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.


CreateMessageRequestParamsBase ​

CreateMessageRequestParamsBase = Omit<CreateMessageRequestParams, "tools" | "toolChoice">

Defined in: packages/core-internal/src/types/types.ts:951

CreateMessageRequestParams without tools - for backwards-compatible overload. Excludes tools/toolChoice to indicate they should not be provided.

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.


CreateMessageResult ​

CreateMessageResult = StripWireOnly<Infer<typeof CreateMessageResultSchema>>

Defined in: packages/core-internal/src/types/types.ts:514

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.


CreateMessageResultWithTools ​

CreateMessageResultWithTools = StripWireOnly<Infer<typeof CreateMessageResultWithToolsSchema>>

Defined in: packages/core-internal/src/types/types.ts:520

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.


CreateTaskResult ​

CreateTaskResult = StripWireOnly<Infer<typeof CreateTaskResultSchema>>

Defined in: packages/core-internal/src/types/types.ts:328

Deprecated ​

2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.


Cursor ​

Cursor = Infer<typeof CursorSchema>

Defined in: packages/core-internal/src/types/types.ts:221


DiscoverRequest ​

DiscoverRequest = Infer<typeof DiscoverRequestSchema>

Defined in: packages/core-internal/src/types/types.ts:297


DiscoverResult ​

DiscoverResult = StripWireOnly<Infer<typeof DiscoverResultSchema>>

Defined in: packages/core-internal/src/types/types.ts:298


ElicitationCompleteNotification ​

ElicitationCompleteNotification = Infer<typeof ElicitationCompleteNotificationSchema>

Defined in: packages/core-internal/src/types/types.ts:542

Deprecated ​

Removed from the spec by #2891 (2026-07-28). 2025-era only; the 2026-07-28 wire codec excludes this notification.


ElicitationCompleteNotificationParams ​

ElicitationCompleteNotificationParams = Infer<typeof ElicitationCompleteNotificationParamsSchema>

Defined in: packages/core-internal/src/types/types.ts:540

Deprecated ​

Removed from the spec by #2891 (2026-07-28). 2025-era only; the 2026-07-28 wire codec excludes this notification.


ElicitRequest ​

ElicitRequest = Infer<typeof ElicitRequestSchema>

Defined in: packages/core-internal/src/types/types.ts:538


ElicitRequestFormParams ​

ElicitRequestFormParams = Infer<typeof ElicitRequestFormParamsSchema>

Defined in: packages/core-internal/src/types/types.ts:536


ElicitRequestParams ​

ElicitRequestParams = Infer<typeof ElicitRequestParamsSchema>

Defined in: packages/core-internal/src/types/types.ts:535


ElicitRequestURLParams ​

ElicitRequestURLParams = Infer<typeof ElicitRequestURLParamsSchema>

Defined in: packages/core-internal/src/types/types.ts:537


ElicitResult ​

ElicitResult = StripWireOnly<Infer<typeof ElicitResultSchema>>

Defined in: packages/core-internal/src/types/types.ts:543


EmbeddedResource ​

EmbeddedResource = Infer<typeof EmbeddedResourceSchema>

Defined in: packages/core-internal/src/types/types.ts:409


EmptyResult ​

EmptyResult = StripWireOnly<Infer<typeof EmptyResultSchema>>

Defined in: packages/core-internal/src/types/types.ts:260


EnumSchema ​

EnumSchema = Infer<typeof EnumSchemaSchema>

Defined in: packages/core-internal/src/types/types.ts:526


FetchLike ​

FetchLike = (url, init?) => Promise<Response>

Defined in: packages/core-internal/src/shared/transport.ts:3

Parameters ​

url ​

string | URL

init? ​

RequestInit

Returns ​

Promise<Response>


GetPromptRequest ​

GetPromptRequest = Infer<typeof GetPromptRequestSchema>

Defined in: packages/core-internal/src/types/types.ts:393


GetPromptRequestParams ​

GetPromptRequestParams = Infer<typeof GetPromptRequestParamsSchema>

Defined in: packages/core-internal/src/types/types.ts:392


GetPromptResult ​

GetPromptResult = StripWireOnly<Infer<typeof GetPromptResultSchema>>

Defined in: packages/core-internal/src/types/types.ts:413


GetTaskPayloadRequest ​

GetTaskPayloadRequest = Infer<typeof GetTaskPayloadRequestSchema>

Defined in: packages/core-internal/src/types/types.ts:338

Deprecated ​

2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.


GetTaskPayloadResult ​

GetTaskPayloadResult = StripWireOnly<Infer<typeof GetTaskPayloadResultSchema>>

Defined in: packages/core-internal/src/types/types.ts:348

Deprecated ​

2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.


GetTaskRequest ​

GetTaskRequest = Infer<typeof GetTaskRequestSchema>

Defined in: packages/core-internal/src/types/types.ts:334

Deprecated ​

2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.


GetTaskResult ​

GetTaskResult = StripWireOnly<Infer<typeof GetTaskResultSchema>>

Defined in: packages/core-internal/src/types/types.ts:336

Deprecated ​

2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.


HandlerResultTypeMap ​

HandlerResultTypeMap = { [M in keyof ResultTypeMap]: M extends "tools/call" | "prompts/get" | "resources/read" ? ResultTypeMap[M] | InputRequiredResult : ResultTypeMap[M] }

Defined in: packages/core-internal/src/types/types.ts:718

The handler-return counterpart of ResultTypeMap: what a registered request handler may RETURN for each method. Identical to ResultTypeMap except that the multi-round-trip methods (tools/call, prompts/get, resources/read) additionally accept an InputRequiredResult (protocol revision 2026-07-28).

ResultTypeMap itself — what a requester receives — is deliberately NOT widened: client.callTool() returns a plain CallToolResult on both protocol eras.


Icon ​

Icon = Infer<typeof IconSchema>

Defined in: packages/core-internal/src/types/types.ts:267


Icons ​

Icons = Infer<typeof IconsSchema>

Defined in: packages/core-internal/src/types/types.ts:268


IdJagTokenExchangeResponse ​

IdJagTokenExchangeResponse = z.infer<typeof IdJagTokenExchangeResponseSchema>

Defined in: packages/core/src/auth.ts:174


ImageContent ​

ImageContent = Infer<typeof ImageContentSchema>

Defined in: packages/core-internal/src/types/types.ts:395


Implementation ​

Implementation = Infer<typeof ImplementationSchema>

Defined in: packages/core-internal/src/types/types.ts:274


InitializedNotification ​

InitializedNotification = Infer<typeof InitializedNotificationSchema>

Defined in: packages/core-internal/src/types/types.ts:294


InitializeRequest ​

InitializeRequest = Infer<typeof InitializeRequestSchema>

Defined in: packages/core-internal/src/types/types.ts:284


InitializeRequestParams ​

InitializeRequestParams = Infer<typeof InitializeRequestParamsSchema>

Defined in: packages/core-internal/src/types/types.ts:283


InitializeResult ​

InitializeResult = StripWireOnly<Infer<typeof InitializeResultSchema>>

Defined in: packages/core-internal/src/types/types.ts:293


InputRequest ​

InputRequest = CreateMessageRequest | ListRootsRequest | ElicitRequest

Defined in: packages/core-internal/src/types/types.ts:595

A single embedded (de-JSON-RPC'd) input request inside an InputRequiredResult: an elicitation, sampling, or roots request object carried in-band rather than sent as a server→client JSON-RPC request.


InputResponse ​

InputResponse = CreateMessageResult | ListRootsResult | ElicitResult

Defined in: packages/core-internal/src/types/types.ts:602

A single embedded (de-JSON-RPC'd) input response inside a retried request's inputResponses: the bare result object for the corresponding InputRequest (never wrapped in a {method, result} envelope).


JSONArray ​

JSONArray = JSONValue[]

Defined in: packages/core/src/types.ts:4


JSONObject ​

JSONObject = object

Defined in: packages/core/src/types.ts:3

Index Signature ​

[key: string]: JSONValue


JSONRPCErrorResponse ​

JSONRPCErrorResponse = Infer<typeof JSONRPCErrorResponseSchema>

Defined in: packages/core-internal/src/types/types.ts:231


JSONRPCMessage ​

JSONRPCMessage = JSONRPCRequest | JSONRPCNotification | JSONRPCResultResponse | JSONRPCErrorResponse

Defined in: packages/core-internal/src/types/types.ts:236


JSONRPCNotification ​

JSONRPCNotification = Infer<typeof JSONRPCNotificationSchema>

Defined in: packages/core-internal/src/types/types.ts:230


JSONRPCRequest ​

JSONRPCRequest = Infer<typeof JSONRPCRequestSchema>

Defined in: packages/core-internal/src/types/types.ts:229


JSONRPCResponse ​

JSONRPCResponse = JSONRPCResultResponse | JSONRPCErrorResponse

Defined in: packages/core-internal/src/types/types.ts:235


JSONRPCResultResponse ​

JSONRPCResultResponse = Omit<Infer<typeof JSONRPCResultResponseSchema>, "result"> & object

Defined in: packages/core-internal/src/types/types.ts:234

Type Declaration ​

result ​

result: Result


JsonSchemaType ​

JsonSchemaType = JSONSchema.Interface

Defined in: packages/core-internal/src/validators/types.ts:14

JSON Schema type definition (JSON Schema Draft 2020-12)

This uses the object form of JSON Schema (excluding boolean schemas). While true and false are valid JSON Schemas, this SDK uses the object form for practical type safety.

Re-exported from json-schema-typed for convenience.

See ​

https://json-schema.org/draft/2020-12/json-schema-core.html


JsonSchemaValidator ​

JsonSchemaValidator<T> = (input) => JsonSchemaValidatorResult<T>

Defined in: packages/core-internal/src/validators/types.ts:26

A validator function that validates data against a JSON Schema

Type Parameters ​

T ​

T

Parameters ​

input ​

unknown

Returns ​

JsonSchemaValidatorResult<T>


JsonSchemaValidatorResult ​

JsonSchemaValidatorResult<T> = { data: T; errorMessage: undefined; valid: true; } | { data: undefined; errorMessage: string; valid: false; }

Defined in: packages/core-internal/src/validators/types.ts:19

Result of a JSON Schema validation operation

Type Parameters ​

T ​

T


JSONValue ​

JSONValue = string | number | boolean | null | JSONObject | JSONArray

Defined in: packages/core/src/types.ts:2


LegacyTitledEnumSchema ​

LegacyTitledEnumSchema = Infer<typeof LegacyTitledEnumSchemaSchema>

Defined in: packages/core-internal/src/types/types.ts:529


ListChangedCallback ​

ListChangedCallback<T> = (error, items) => void

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

Callback type for list changed notifications.

Type Parameters ​

T ​

T

Parameters ​

error ​

Error | null

items ​

T[] | null

Returns ​

void


ListChangedHandlers ​

ListChangedHandlers = object

Defined in: packages/core-internal/src/types/types.ts:861

Configuration for list changed notification handlers.

Use this to configure handlers for tools, prompts, and resources list changes when creating a client.

Note: Handlers are only activated if the server advertises the corresponding listChanged capability (e.g., tools.listChanged: true). If the server doesn't advertise this capability, the handler will not be set up.

Properties ​

prompts? ​

optional prompts?: ListChangedOptions<Prompt>

Defined in: packages/core-internal/src/types/types.ts:869

Handler for prompt list changes.

resources? ​

optional resources?: ListChangedOptions<Resource>

Defined in: packages/core-internal/src/types/types.ts:873

Handler for resource list changes.

tools? ​

optional tools?: ListChangedOptions<Tool>

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

Handler for tool list changes.


ListChangedOptions ​

ListChangedOptions<T> = object

Defined in: packages/core-internal/src/types/types.ts:831

Options for subscribing to list changed notifications.

Type Parameters ​

T ​

T

The type of items in the list (Tool, Prompt, or Resource)

Properties ​

autoRefresh? ​

optional autoRefresh?: boolean

Defined in: packages/core-internal/src/types/types.ts:836

If true, the list will be refreshed automatically when a list changed notification is received.

Default ​
ts
true
debounceMs? ​

optional debounceMs?: number

Defined in: packages/core-internal/src/types/types.ts:841

Debounce time in milliseconds. Set to 0 to disable.

Default ​
ts
300
onChanged ​

onChanged: ListChangedCallback<T>

Defined in: packages/core-internal/src/types/types.ts:848

Callback invoked when the list changes.

If autoRefresh is true, items contains the updated list. If autoRefresh is false, items is null (caller should refresh manually).


ListPromptsRequest ​

ListPromptsRequest = Infer<typeof ListPromptsRequestSchema>

Defined in: packages/core-internal/src/types/types.ts:390


ListPromptsResult ​

ListPromptsResult = StripWireOnly<Infer<typeof ListPromptsResultSchema>>

Defined in: packages/core-internal/src/types/types.ts:391


ListResourcesRequest ​

ListResourcesRequest = Infer<typeof ListResourcesRequestSchema>

Defined in: packages/core-internal/src/types/types.ts:362


ListResourcesResult ​

ListResourcesResult = StripWireOnly<Infer<typeof ListResourcesResultSchema>>

Defined in: packages/core-internal/src/types/types.ts:363


ListResourceTemplatesRequest ​

ListResourceTemplatesRequest = Infer<typeof ListResourceTemplatesRequestSchema>

Defined in: packages/core-internal/src/types/types.ts:364


ListResourceTemplatesResult ​

ListResourceTemplatesResult = StripWireOnly<Infer<typeof ListResourceTemplatesResultSchema>>

Defined in: packages/core-internal/src/types/types.ts:365


ListRootsRequest ​

ListRootsRequest = Infer<typeof ListRootsRequestSchema>

Defined in: packages/core-internal/src/types/types.ts:564

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.


ListRootsResult ​

ListRootsResult = StripWireOnly<Infer<typeof ListRootsResultSchema>>

Defined in: packages/core-internal/src/types/types.ts:570

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.


ListTasksRequest ​

ListTasksRequest = Infer<typeof ListTasksRequestSchema>

Defined in: packages/core-internal/src/types/types.ts:340

Deprecated ​

2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.


ListTasksResult ​

ListTasksResult = StripWireOnly<Infer<typeof ListTasksResultSchema>>

Defined in: packages/core-internal/src/types/types.ts:342

Deprecated ​

2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.


ListToolsRequest ​

ListToolsRequest = Infer<typeof ListToolsRequestSchema>

Defined in: packages/core-internal/src/types/types.ts:420


ListToolsResult ​

ListToolsResult = StripWireOnly<Infer<typeof ListToolsResultSchema>>

Defined in: packages/core-internal/src/types/types.ts:421


LoggingLevel ​

LoggingLevel = Infer<typeof LoggingLevelSchema>

Defined in: packages/core-internal/src/types/types.ts:434

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.


LoggingMessageNotification ​

LoggingMessageNotification = Infer<typeof LoggingMessageNotificationSchema>

Defined in: packages/core-internal/src/types/types.ts:458

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.


LoggingMessageNotificationParams ​

LoggingMessageNotificationParams = Infer<typeof LoggingMessageNotificationParamsSchema>

Defined in: packages/core-internal/src/types/types.ts:452

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.


MetaObject ​

MetaObject = Record<string, unknown>

Defined in: packages/core-internal/src/types/types.ts:935


ModelHint ​

ModelHint = Infer<typeof ModelHintSchema>

Defined in: packages/core-internal/src/types/types.ts:472

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.


ModelPreferences ​

ModelPreferences = Infer<typeof ModelPreferencesSchema>

Defined in: packages/core-internal/src/types/types.ts:478

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.


MultiSelectEnumSchema ​

MultiSelectEnumSchema = Infer<typeof MultiSelectEnumSchemaSchema>

Defined in: packages/core-internal/src/types/types.ts:533


Notification ​

Notification = Infer<typeof NotificationSchema>

Defined in: packages/core-internal/src/types/types.ts:226


NotificationMethod ​

NotificationMethod = Exclude<ClientNotification["method"] | ServerNotification["method"], TaskNotificationMethod>

Defined in: packages/core-internal/src/types/types.ts:679


NotificationOptions ​

NotificationOptions = object

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

Options that can be given per notification.

Properties ​

relatedRequestId? ​

optional relatedRequestId?: RequestId

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

May be used to indicate to the transport which incoming request to associate this outgoing notification with.


NotificationParams ​

NotificationParams = Infer<typeof NotificationsParamsSchema>

Defined in: packages/core-internal/src/types/types.ts:238


NotificationTypeMap ​

NotificationTypeMap = MethodToTypeMap<Exclude<ClientNotification | ServerNotification, { method: TaskNotificationMethod; }>>

Defined in: packages/core-internal/src/types/types.ts:681


NumberSchema ​

NumberSchema = Infer<typeof NumberSchemaSchema>

Defined in: packages/core-internal/src/types/types.ts:525


OAuthClientInformation ​

OAuthClientInformation = z.infer<typeof OAuthClientInformationSchema>

Defined in: packages/core/src/auth.ts:274


OAuthClientInformationFull ​

OAuthClientInformationFull = z.infer<typeof OAuthClientInformationFullSchema>

Defined in: packages/core/src/auth.ts:275


OAuthClientInformationMixed ​

OAuthClientInformationMixed = OAuthClientInformation | OAuthClientInformationFull

Defined in: packages/core/src/auth.ts:276


OAuthClientMetadata ​

OAuthClientMetadata = z.infer<typeof OAuthClientMetadataSchema>

Defined in: packages/core/src/auth.ts:273


OAuthClientRegistrationError ​

OAuthClientRegistrationError = z.infer<typeof OAuthClientRegistrationErrorSchema>

Defined in: packages/core/src/auth.ts:295


OAuthErrorResponse ​

OAuthErrorResponse = z.infer<typeof OAuthErrorResponseSchema>

Defined in: packages/core/src/auth.ts:272


OAuthMetadata ​

OAuthMetadata = z.infer<typeof OAuthMetadataSchema>

Defined in: packages/core/src/auth.ts:267


OAuthProtectedResourceMetadata ​

OAuthProtectedResourceMetadata = z.infer<typeof OAuthProtectedResourceMetadataSchema>

Defined in: packages/core/src/auth.ts:297


OAuthTokenRevocationRequest ​

OAuthTokenRevocationRequest = z.infer<typeof OAuthTokenRevocationRequestSchema>

Defined in: packages/core/src/auth.ts:296


OAuthTokens ​

OAuthTokens = z.infer<typeof OAuthTokensSchema>

Defined in: packages/core/src/auth.ts:271


OpenIdProviderDiscoveryMetadata ​

OpenIdProviderDiscoveryMetadata = z.infer<typeof OpenIdProviderDiscoveryMetadataSchema>

Defined in: packages/core/src/auth.ts:269


OpenIdProviderMetadata ​

OpenIdProviderMetadata = z.infer<typeof OpenIdProviderMetadataSchema>

Defined in: packages/core/src/auth.ts:268


PaginatedRequest ​

PaginatedRequest = Infer<typeof PaginatedRequestSchema>

Defined in: packages/core-internal/src/types/types.ts:352


PaginatedRequestParams ​

PaginatedRequestParams = Infer<typeof PaginatedRequestParamsSchema>

Defined in: packages/core-internal/src/types/types.ts:351


PaginatedResult ​

PaginatedResult = StripWireOnly<Infer<typeof PaginatedResultSchema>>

Defined in: packages/core-internal/src/types/types.ts:353


PingRequest ​

PingRequest = Infer<typeof PingRequestSchema>

Defined in: packages/core-internal/src/types/types.ts:301


PrimitiveSchemaDefinition ​

PrimitiveSchemaDefinition = Infer<typeof PrimitiveSchemaDefinitionSchema>

Defined in: packages/core-internal/src/types/types.ts:534


Progress ​

Progress = Infer<typeof ProgressSchema>

Defined in: packages/core-internal/src/types/types.ts:304


ProgressCallback ​

ProgressCallback = (progress) => void

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

Callback for progress notifications.

Parameters ​

progress ​

Progress

Returns ​

void


ProgressNotification ​

ProgressNotification = Infer<typeof ProgressNotificationSchema>

Defined in: packages/core-internal/src/types/types.ts:306


ProgressNotificationParams ​

ProgressNotificationParams = Infer<typeof ProgressNotificationParamsSchema>

Defined in: packages/core-internal/src/types/types.ts:305


ProgressToken ​

ProgressToken = Infer<typeof ProgressTokenSchema>

Defined in: packages/core-internal/src/types/types.ts:220


Prompt ​

Prompt = Infer<typeof PromptSchema>

Defined in: packages/core-internal/src/types/types.ts:389


PromptArgument ​

PromptArgument = Infer<typeof PromptArgumentSchema>

Defined in: packages/core-internal/src/types/types.ts:388


PromptListChangedNotification ​

PromptListChangedNotification = Infer<typeof PromptListChangedNotificationSchema>

Defined in: packages/core-internal/src/types/types.ts:414


PromptMessage ​

PromptMessage = Infer<typeof PromptMessageSchema>

Defined in: packages/core-internal/src/types/types.ts:412


PromptReference ​

PromptReference = Infer<typeof PromptReferenceSchema>

Defined in: packages/core-internal/src/types/types.ts:547


ProtocolEra ​

ProtocolEra = "legacy" | "modern"

Defined in: packages/core-internal/src/shared/protocolEras.ts:19

The protocol era of a connection: 'legacy' for the 2025-11-25 family and earlier (negotiated via initialize), 'modern' for 2026-07-28 and later (negotiated via server/discover; every request carries a _meta envelope).


ProtocolOptions ​

ProtocolOptions = object

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

Additional initialization options.

Properties ​

debouncedNotificationMethods? ​

optional debouncedNotificationMethods?: string[]

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

An array of notification method names that should be automatically debounced. Any notifications with a method in this list will be coalesced if they occur in the same tick of the event loop. e.g., ['notifications/tools/list_changed']

enforceStrictCapabilities? ​

optional enforceStrictCapabilities?: boolean

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

Whether to restrict emitted requests to only those that the remote side has indicated that they can handle, through their advertised capabilities.

Note that this DOES NOT affect checking of local side capabilities, as it is considered a logic error to mis-specify those.

Currently this defaults to false, for backwards compatibility with SDK versions that did not advertise capabilities correctly. In future, this will default to true.

supportedProtocolVersions? ​

optional supportedProtocolVersions?: string[]

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

Protocol versions supported. The legacy initialize handshake offers and falls back to the first 2025-era entry in the list (the client sends it, the server counter-offers it); 2026-era entries are only ever selected via server/discover. Passed to transport during connect().

Default ​

SUPPORTED_PROTOCOL_VERSIONS


ReadResourceRequest ​

ReadResourceRequest = Infer<typeof ReadResourceRequestSchema>

Defined in: packages/core-internal/src/types/types.ts:368


ReadResourceRequestParams ​

ReadResourceRequestParams = Infer<typeof ReadResourceRequestParamsSchema>

Defined in: packages/core-internal/src/types/types.ts:367


ReadResourceResult ​

ReadResourceResult = StripWireOnly<Infer<typeof ReadResourceResultSchema>>

Defined in: packages/core-internal/src/types/types.ts:369


RelatedTaskMetadata ​

RelatedTaskMetadata = Infer<typeof RelatedTaskMetadataSchema>

Defined in: packages/core-internal/src/types/types.ts:326

Deprecated ​

2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.


Request ​

Request = Infer<typeof RequestSchema>

Defined in: packages/core-internal/src/types/types.ts:222


RequestId ​

RequestId = Infer<typeof RequestIdSchema>

Defined in: packages/core-internal/src/types/types.ts:228


RequestMeta ​

RequestMeta = Infer<typeof RequestMetaSchema>

Defined in: packages/core-internal/src/types/types.ts:225


RequestMetaEnvelope ​

RequestMetaEnvelope = object

Defined in: packages/core-internal/src/types/types.ts:248

The per-request _meta envelope carried by every request under protocol revision 2026-07-28 (protocol version, client info, client capabilities, optional log level).

Neutral hand-written shape keyed by the public meta-key constants — never inferred from a wire-module schema (this neutral layer does not import from wire/rev*). A type alias rather than an interface so it stays assignable to _meta's string-indexed object slot.

Properties ​

io.modelcontextprotocol/clientCapabilities ​

io.modelcontextprotocol/clientCapabilities: ClientCapabilities

Defined in: packages/core-internal/src/types/types.ts:255

io.modelcontextprotocol/clientInfo? ​

optional io.modelcontextprotocol/clientInfo?: Implementation

Defined in: packages/core-internal/src/types/types.ts:254

Optional since spec PR #3002: clients SHOULD send it, servers must not require it (and should not rely on it for behavior or security).

io.modelcontextprotocol/logLevel? ​

optional io.modelcontextprotocol/logLevel?: LoggingLevel

Defined in: packages/core-internal/src/types/types.ts:256

io.modelcontextprotocol/protocolVersion ​

io.modelcontextprotocol/protocolVersion: string

Defined in: packages/core-internal/src/types/types.ts:249


RequestMetaObject ​

RequestMetaObject = RequestMeta

Defined in: packages/core-internal/src/types/types.ts:936


RequestMethod ​

RequestMethod = Exclude<ClientRequest["method"] | ServerRequest["method"], TaskRequestMethod>

Defined in: packages/core-internal/src/types/types.ts:678


RequestOptions ​

RequestOptions = object & TransportSendOptions

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

Options that can be given per request.

Type Declaration ​

allowInputRequired? ​

optional allowInputRequired?: boolean

Manual multi-round-trip mode for this call (protocol revision 2026-07-28): when the response is an input_required result, hand it back to the caller instead of auto-fulfilling it (or raising a typed error). The resolved value is the neutral input-required shape (resultType: 'input_required', inputRequests?, requestState?); wrap the result schema with withInputRequired() on the explicit schema path to type both outcomes. The caller is then responsible for gathering the requested input and retrying the original request with inputResponses / requestState params and a fresh request.

Default: false.

maxTotalTimeout? ​

optional maxTotalTimeout?: number

Maximum total time (in milliseconds) to wait for a response. If exceeded, an SdkError with code SdkErrorCode.RequestTimeout will be raised, regardless of progress notifications. If not specified, there is no maximum total timeout.

For multi-round-trip requests fulfilled by the auto-fulfilment driver (protocol revision 2026-07-28), the budget bounds the WHOLE flow: every retry leg is given only the time remaining.

onprogress? ​

optional onprogress?: ProgressCallback

If set, requests progress notifications from the remote end (if supported). When progress notifications are received, this callback will be invoked.

resetTimeoutOnProgress? ​

optional resetTimeoutOnProgress?: boolean

If true, receiving a progress notification will reset the request timeout. This is useful for long-running operations that send periodic progress updates. Default: false

signal? ​

optional signal?: AbortSignal

Can be used to cancel an in-flight request. This will cause an AbortError to be raised from request().

timeout? ​

optional timeout?: number

A timeout (in milliseconds) for this request. If exceeded, an SdkError with code SdkErrorCode.RequestTimeout will be raised from request().

If not specified, DEFAULT_REQUEST_TIMEOUT_MSEC will be used as the timeout.


RequestParams ​

RequestParams = Infer<typeof BaseRequestParamsSchema>

Defined in: packages/core-internal/src/types/types.ts:237


RequestStateAccessor ​

RequestStateAccessor = <T>() => T | undefined

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

The type of ctx.mcpReq.requestState. The type parameter is caller-asserted (no validation, like the two-argument acceptedContent<T>) — pair with createRequestStateCodec<T> so the claim is backed by the codec's verification.

Type Parameters ​

T ​

T = unknown

Returns ​

T | undefined


RequestTypeMap ​

RequestTypeMap = MethodToTypeMap<Exclude<ClientRequest | ServerRequest, { method: TaskRequestMethod; }>>

Defined in: packages/core-internal/src/types/types.ts:680


Resource ​

Resource = Infer<typeof ResourceSchema>

Defined in: packages/core-internal/src/types/types.ts:359


ResourceContents ​

ResourceContents = Infer<typeof ResourceContentsSchema>

Defined in: packages/core-internal/src/types/types.ts:356


ResourceLink = Infer<typeof ResourceLinkSchema>

Defined in: packages/core-internal/src/types/types.ts:410


ResourceListChangedNotification ​

ResourceListChangedNotification = Infer<typeof ResourceListChangedNotificationSchema>

Defined in: packages/core-internal/src/types/types.ts:370


ResourceRequestParams ​

ResourceRequestParams = Infer<typeof ResourceRequestParamsSchema>

Defined in: packages/core-internal/src/types/types.ts:366


ResourceTemplateReference ​

ResourceTemplateReference = Infer<typeof ResourceTemplateReferenceSchema>

Defined in: packages/core-internal/src/types/types.ts:546


ResourceTemplateType ​

ResourceTemplateType = Infer<typeof ResourceTemplateSchema>

Defined in: packages/core-internal/src/types/types.ts:361


ResourceUpdatedNotification ​

ResourceUpdatedNotification = Infer<typeof ResourceUpdatedNotificationSchema>

Defined in: packages/core-internal/src/types/types.ts:376


ResourceUpdatedNotificationParams ​

ResourceUpdatedNotificationParams = Infer<typeof ResourceUpdatedNotificationParamsSchema>

Defined in: packages/core-internal/src/types/types.ts:375


Result ​

Result = StripWireOnly<Infer<typeof ResultSchema>>

Defined in: packages/core-internal/src/types/types.ts:227


ResultMetaObject ​

ResultMetaObject = Infer<typeof ResultMetaObjectSchema>

Defined in: packages/core-internal/src/types/types.ts:941

The contents of a result's _meta field (the 2026-07-28 ResultMetaObject): loose, with the optional self-reported serverInfo key typed when present.


ResultTypeMap ​

ResultTypeMap = object

Defined in: packages/core-internal/src/types/types.ts:682

Properties ​

completion/complete ​

completion/complete: CompleteResult

Defined in: packages/core-internal/src/types/types.ts:686

elicitation/create ​

elicitation/create: ElicitResult

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

initialize ​

initialize: InitializeResult

Defined in: packages/core-internal/src/types/types.ts:684

logging/setLevel ​

logging/setLevel: EmptyResult

Defined in: packages/core-internal/src/types/types.ts:687

ping ​

ping: EmptyResult

Defined in: packages/core-internal/src/types/types.ts:683

prompts/get ​

prompts/get: GetPromptResult

Defined in: packages/core-internal/src/types/types.ts:688

prompts/list ​

prompts/list: ListPromptsResult

Defined in: packages/core-internal/src/types/types.ts:689

resources/list ​

resources/list: ListResourcesResult

Defined in: packages/core-internal/src/types/types.ts:690

resources/read ​

resources/read: ReadResourceResult

Defined in: packages/core-internal/src/types/types.ts:692

resources/subscribe ​

resources/subscribe: EmptyResult

Defined in: packages/core-internal/src/types/types.ts:693

resources/templates/list ​

resources/templates/list: ListResourceTemplatesResult

Defined in: packages/core-internal/src/types/types.ts:691

resources/unsubscribe ​

resources/unsubscribe: EmptyResult

Defined in: packages/core-internal/src/types/types.ts:694

roots/list ​

roots/list: ListRootsResult

Defined in: packages/core-internal/src/types/types.ts:704

sampling/createMessage ​

sampling/createMessage: CreateMessageResult | CreateMessageResultWithTools

Defined in: packages/core-internal/src/types/types.ts:702

server/discover ​

server/discover: DiscoverResult

Defined in: packages/core-internal/src/types/types.ts:685

subscriptions/listen ​

subscriptions/listen: SubscriptionsListenResult

Defined in: packages/core-internal/src/types/types.ts:699

tools/call ​

tools/call: CallToolResult

Defined in: packages/core-internal/src/types/types.ts:700

tools/list ​

tools/list: ListToolsResult

Defined in: packages/core-internal/src/types/types.ts:701


Role ​

Role = Infer<typeof RoleSchema>

Defined in: packages/core-internal/src/types/types.ts:271


Root ​

Root = Infer<typeof RootSchema>

Defined in: packages/core-internal/src/types/types.ts:558

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.


RootsListChangedNotification ​

RootsListChangedNotification = Infer<typeof RootsListChangedNotificationSchema>

Defined in: packages/core-internal/src/types/types.ts:576

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.


SamplingContent ​

SamplingContent = Infer<typeof SamplingContentSchema>

Defined in: packages/core-internal/src/types/types.ts:484

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.


SamplingMessage ​

SamplingMessage = Infer<typeof SamplingMessageSchema>

Defined in: packages/core-internal/src/types/types.ts:496

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.


SamplingMessageContentBlock ​

SamplingMessageContentBlock = Infer<typeof SamplingMessageContentBlockSchema>

Defined in: packages/core-internal/src/types/types.ts:490

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.


ServerCapabilities ​

ServerCapabilities = Infer<typeof ServerCapabilitiesSchema>

Defined in: packages/core-internal/src/types/types.ts:292

Capabilities a server may support.

Note: the logging capability is deprecated as of protocol version 2026-07-28 (SEP-2577); it remains in the specification for at least twelve months. See ServerCapabilitiesSchema.


ServerContext ​

ServerContext = BaseContext & object

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

Context provided to server-side request handlers, extending BaseContext with server-specific fields.

Type Declaration ​

http? ​

optional http?: object

http.closeSSE? ​

optional closeSSE?: () => void

Closes the SSE stream for this request, triggering client reconnection. Only available when using a StreamableHTTPServerTransport with eventStore configured.

Returns ​

void

http.closeStandaloneSSE? ​

optional closeStandaloneSSE?: () => void

Closes the standalone GET SSE stream, triggering client reconnection. Only available when using a StreamableHTTPServerTransport with eventStore configured.

Returns ​

void

http.req? ​

optional req?: globalThis.Request

The original HTTP request.

mcpReq ​

mcpReq: object

mcpReq.elicitInput ​

elicitInput: (params, options?) => Promise<ElicitResult>

Send an elicitation request to the client, requesting user input.

Parameters ​
params ​

ElicitRequestFormParams | ElicitRequestURLParams

options? ​

RequestOptions

Returns ​

Promise<ElicitResult>

Deprecated ​

Throws on a 2026-07-28-era request — return inputRequired(...) (multi-round-trip) from the handler 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.

mcpReq.log ​

log: (level, data, logger?) => Promise<void>

Send a log message notification to the client. Respects the client's log level filter set via logging/setLevel.

Parameters ​
level ​

LoggingLevel

data ​

unknown

logger? ​

string

Returns ​

Promise<void>

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.

mcpReq.requestSampling ​

requestSampling: (params, options?) => Promise<CreateMessageResult | CreateMessageResultWithTools>

Request LLM sampling from the client.

Parameters ​
params ​

CreateMessageRequest["params"]

options? ​

RequestOptions

Returns ​

Promise<CreateMessageResult | CreateMessageResultWithTools>

Deprecated ​

Deprecated as of protocol version 2026-07-28 (SEP-2577). Throws on a 2026-07-28-era request — return inputRequired(...) (multi-round-trip) from the handler 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.


ServerNotification ​

ServerNotification = Infer<typeof ServerNotificationSchema>

Defined in: packages/core-internal/src/types/types.ts:662


ServerRequest ​

ServerRequest = Infer<typeof ServerRequestSchema>

Defined in: packages/core-internal/src/types/types.ts:661


ServerResult ​

ServerResult = StripWireOnly<Infer<typeof ServerResultSchema>>

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


SetLevelRequest ​

SetLevelRequest = Infer<typeof SetLevelRequestSchema>

Defined in: packages/core-internal/src/types/types.ts:446

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.


SetLevelRequestParams ​

SetLevelRequestParams = Infer<typeof SetLevelRequestParamsSchema>

Defined in: packages/core-internal/src/types/types.ts:440

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.


SingleSelectEnumSchema ​

SingleSelectEnumSchema = Infer<typeof SingleSelectEnumSchemaSchema>

Defined in: packages/core-internal/src/types/types.ts:532


SpecTypeName ​

SpecTypeName = StripSchemaSuffix<SchemaKey>

Defined in: packages/core-internal/src/types/specTypeSchema.ts:230

Union of every named type in the SDK's protocol and OAuth schemas (e.g. 'CallToolResult', 'ContentBlock', 'Tool', 'OAuthTokens'). Derived from the internal Zod schemas, so it stays in sync with the spec.


SpecTypes ​

SpecTypes = { [K in SchemaKey as StripSchemaSuffix<K>]: SchemaFor<K> extends z.ZodType ? z.output<SchemaFor<K>> : never }

Defined in: packages/core-internal/src/types/specTypeSchema.ts:242

Maps each SpecTypeName to its TypeScript type.

SpecTypes['Tool'] is equivalent to importing the Tool type directly. These validators cover the NEUTRAL model — the consumer-facing shapes with no wire-only members (resultType, the reserved _meta envelope keys). Per-revision WIRE validators are deliberately not public surface; they are planned to return as versioned zod-schemas/<revision> exports for consumers who validate raw wire traffic themselves.


StoredOAuthClientInformation ​

StoredOAuthClientInformation = OAuthClientInformationMixed & object

Defined in: packages/core/src/auth.ts:293

OAuthClientInformationMixed as persisted by an OAuthClientProvider. Adds an SDK-stamped authorization-server issuer identifier so stored client credentials are bound to the AS that issued them. The issuer field is not part of the RFC 7591 wire response; the client SDK writes it before calling saveClientInformation.

Type Declaration ​

issuer? ​

optional issuer?: string


StoredOAuthTokens ​

StoredOAuthTokens = OAuthTokens & object

Defined in: packages/core/src/auth.ts:284

OAuthTokens as persisted by an OAuthClientProvider. Adds an SDK-stamped authorization-server issuer identifier so stored tokens are bound to the AS that issued them. The issuer field is not part of the RFC 6749 wire response; the client SDK writes it before calling saveTokens.

Type Declaration ​

issuer? ​

optional issuer?: string


StringSchema ​

StringSchema = Infer<typeof StringSchemaSchema>

Defined in: packages/core-internal/src/types/types.ts:524


SubscribeRequest ​

SubscribeRequest = Infer<typeof SubscribeRequestSchema>

Defined in: packages/core-internal/src/types/types.ts:372


SubscribeRequestParams ​

SubscribeRequestParams = Infer<typeof SubscribeRequestParamsSchema>

Defined in: packages/core-internal/src/types/types.ts:371


SubscriptionFilter ​

SubscriptionFilter = Infer<typeof SubscriptionFilterSchema>

Defined in: packages/core-internal/src/types/types.ts:379


SubscriptionsAcknowledgedNotification ​

SubscriptionsAcknowledgedNotification = Infer<typeof SubscriptionsAcknowledgedNotificationSchema>

Defined in: packages/core-internal/src/types/types.ts:383


SubscriptionsAcknowledgedNotificationParams ​

SubscriptionsAcknowledgedNotificationParams = Infer<typeof SubscriptionsAcknowledgedNotificationParamsSchema>

Defined in: packages/core-internal/src/types/types.ts:382


SubscriptionsListenRequest ​

SubscriptionsListenRequest = Infer<typeof SubscriptionsListenRequestSchema>

Defined in: packages/core-internal/src/types/types.ts:381


SubscriptionsListenRequestParams ​

SubscriptionsListenRequestParams = Infer<typeof SubscriptionsListenRequestParamsSchema>

Defined in: packages/core-internal/src/types/types.ts:380


SubscriptionsListenResult ​

SubscriptionsListenResult = StripWireOnly<Infer<typeof SubscriptionsListenResultSchema>>

Defined in: packages/core-internal/src/types/types.ts:385


SubscriptionsListenResultMeta ​

SubscriptionsListenResultMeta = Infer<typeof SubscriptionsListenResultMetaSchema>

Defined in: packages/core-internal/src/types/types.ts:384


Task ​

Task = Infer<typeof TaskSchema>

Defined in: packages/core-internal/src/types/types.ts:318

Deprecated ​

2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.


TaskAugmentedRequestParams ​

TaskAugmentedRequestParams = Infer<typeof TaskAugmentedRequestParamsSchema>

Defined in: packages/core-internal/src/types/types.ts:224

Deprecated ​

2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.


TaskCreationParams ​

TaskCreationParams = Infer<typeof TaskCreationParamsSchema>

Defined in: packages/core-internal/src/types/types.ts:322

Deprecated ​

2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.


TaskMetadata ​

TaskMetadata = Infer<typeof TaskMetadataSchema>

Defined in: packages/core-internal/src/types/types.ts:324

Deprecated ​

2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.


TaskStatus ​

TaskStatus = Infer<typeof TaskStatusSchema>

Defined in: packages/core-internal/src/types/types.ts:320

Deprecated ​

2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.


TaskStatusNotification ​

TaskStatusNotification = Infer<typeof TaskStatusNotificationSchema>

Defined in: packages/core-internal/src/types/types.ts:332

Deprecated ​

2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.


TaskStatusNotificationParams ​

TaskStatusNotificationParams = Infer<typeof TaskStatusNotificationParamsSchema>

Defined in: packages/core-internal/src/types/types.ts:330

Deprecated ​

2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.


TextContent ​

TextContent = Infer<typeof TextContentSchema>

Defined in: packages/core-internal/src/types/types.ts:394


TextResourceContents ​

TextResourceContents = Infer<typeof TextResourceContentsSchema>

Defined in: packages/core-internal/src/types/types.ts:357


TitledMultiSelectEnumSchema ​

TitledMultiSelectEnumSchema = Infer<typeof TitledMultiSelectEnumSchemaSchema>

Defined in: packages/core-internal/src/types/types.ts:531


TitledSingleSelectEnumSchema ​

TitledSingleSelectEnumSchema = Infer<typeof TitledSingleSelectEnumSchemaSchema>

Defined in: packages/core-internal/src/types/types.ts:528


Tool ​

Tool = Infer<typeof ToolSchema>

Defined in: packages/core-internal/src/types/types.ts:419


ToolAnnotations ​

ToolAnnotations = Infer<typeof ToolAnnotationsSchema>

Defined in: packages/core-internal/src/types/types.ts:417


ToolChoice ​

ToolChoice = Infer<typeof ToolChoiceSchema>

Defined in: packages/core-internal/src/types/types.ts:466

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.


ToolExecution ​

ToolExecution = Infer<typeof ToolExecutionSchema>

Defined in: packages/core-internal/src/types/types.ts:418


ToolListChangedNotification ​

ToolListChangedNotification = Infer<typeof ToolListChangedNotificationSchema>

Defined in: packages/core-internal/src/types/types.ts:426


ToolResultContent ​

ToolResultContent = Infer<typeof ToolResultContentSchema>

Defined in: packages/core-internal/src/types/types.ts:408

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.


ToolUseContent ​

ToolUseContent = Infer<typeof ToolUseContentSchema>

Defined in: packages/core-internal/src/types/types.ts:402

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.


TransportSendOptions ​

TransportSendOptions = object

Defined in: packages/core-internal/src/shared/transport.ts:51

Options for sending a JSON-RPC message.

Properties ​

headers? ​

optional headers?: Readonly<Record<string, string>>

Defined in: packages/core-internal/src/shared/transport.ts:102

Additional HTTP headers to send with THIS outbound message, when the transport sends one outbound message per underlying HTTP request (the Streamable HTTP transport's POST-per-request model). Transports that share a single channel (stdio, in-memory) ignore it.

The Client uses this to attach SEP-2243 Mcp-Param-{Name} headers to a tools/call request on a 2026-07-28 connection. Values are sent verbatim — encode anything that is not a safe RFC 9110 field value before passing it here.

onRequestStreamEnd? ​

optional onRequestStreamEnd?: () => void

Defined in: packages/core-internal/src/shared/transport.ts:89

Fired by transports that open a per-request stream (the Streamable HTTP transport's POST-per-request SSE response) when that stream ends or errors for any reason OTHER than a deliberate requestSignal abort — i.e. the server closed the stream, the network dropped it, or reconnection was exhausted. Transports that share a single channel (stdio, in-memory) ignore it.

Returns ​

void

onresumptiontoken? ​

optional onresumptiontoken?: (token) => void

Defined in: packages/core-internal/src/shared/transport.ts:69

A callback that is invoked when the resumption token changes, if supported by the transport.

This allows clients to persist the latest token for potential reconnection.

Parameters ​
token ​

string

Returns ​

void

relatedRequestId? ​

optional relatedRequestId?: RequestId

Defined in: packages/core-internal/src/shared/transport.ts:55

If present, relatedRequestId is used to indicate to the transport which incoming request to associate this outgoing message with.

requestSignal? ​

optional requestSignal?: AbortSignal

Defined in: packages/core-internal/src/shared/transport.ts:79

An abort signal for THIS outbound message's underlying request, when the transport sends one outbound message per underlying request (the Streamable HTTP transport's POST-per-request model). Aborting it cancels the underlying request (and its SSE response stream) without closing the transport. Transports that share a single channel (stdio, in-memory) ignore it.

resumptionToken? ​

optional resumptionToken?: string

Defined in: packages/core-internal/src/shared/transport.ts:62

The resumption token used to continue long-running requests that were interrupted.

This allows clients to reconnect and continue from where they left off, if supported by the transport.


UnsubscribeRequest ​

UnsubscribeRequest = Infer<typeof UnsubscribeRequestSchema>

Defined in: packages/core-internal/src/types/types.ts:374


UnsubscribeRequestParams ​

UnsubscribeRequestParams = Infer<typeof UnsubscribeRequestParamsSchema>

Defined in: packages/core-internal/src/types/types.ts:373


UntitledMultiSelectEnumSchema ​

UntitledMultiSelectEnumSchema = Infer<typeof UntitledMultiSelectEnumSchemaSchema>

Defined in: packages/core-internal/src/types/types.ts:530


UntitledSingleSelectEnumSchema ​

UntitledSingleSelectEnumSchema = Infer<typeof UntitledSingleSelectEnumSchemaSchema>

Defined in: packages/core-internal/src/types/types.ts:527


Variables ​

Variables = Record<string, string | string[]>

Defined in: packages/core-internal/src/shared/uriTemplate.ts:3

Variables ​

BAGGAGE_META_KEY ​

const BAGGAGE_META_KEY: "baggage" = 'baggage'

Defined in: packages/core/src/constants.ts:107

_meta key carrying cross-cutting propagation values for distributed tracing (SEP-414).

When present, the value MUST follow the W3C Baggage header format, e.g. userId=alice,serverRegion=us-east-1.

See ​

https://www.w3.org/TR/baggage/


CLIENT_CAPABILITIES_META_KEY ​

const CLIENT_CAPABILITIES_META_KEY: "io.modelcontextprotocol/clientCapabilities" = 'io.modelcontextprotocol/clientCapabilities'

Defined in: packages/core/src/constants.ts:45

_meta key carrying the client's capabilities for a request.

Capabilities are declared per request rather than once at initialization; servers must not infer capabilities from prior requests.


CLIENT_INFO_META_KEY ​

const CLIENT_INFO_META_KEY: "io.modelcontextprotocol/clientInfo" = 'io.modelcontextprotocol/clientInfo'

Defined in: packages/core/src/constants.ts:28

_meta key identifying the client software making a request.

Clients SHOULD include it on every request; the value is self-reported and intended for display, logging, and debugging — servers should not rely on it for behavior or security decisions.


DEFAULT_NEGOTIATED_PROTOCOL_VERSION ​

const DEFAULT_NEGOTIATED_PROTOCOL_VERSION: "2025-03-26" = '2025-03-26'

Defined in: packages/core/src/constants.ts:2


DEFAULT_REQUEST_TIMEOUT_MSEC ​

const DEFAULT_REQUEST_TIMEOUT_MSEC: 60000 = 60_000

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

The default request timeout, in milliseconds.


INTERNAL_ERROR ​

const INTERNAL_ERROR: -32603 = -32_603

Defined in: packages/core/src/constants.ts:117


INVALID_PARAMS ​

const INVALID_PARAMS: -32602 = -32_602

Defined in: packages/core/src/constants.ts:116


INVALID_REQUEST ​

const INVALID_REQUEST: -32600 = -32_600

Defined in: packages/core/src/constants.ts:114


isSpecType ​

const isSpecType: GuardRecord

Defined in: packages/core-internal/src/types/specTypeSchema.ts:313

Type predicates for every MCP spec type, keyed by type name.

Returns true if the value satisfies the schema's input type (z.input<>, before defaults and transforms are applied), and narrows to that input type. For schemas with .default() or .preprocess(), this may accept values that do not structurally match the named output type; for example isSpecType.CallToolResult({}) is true because content has a default. Use specTypeSchemas.X['~standard'].validate(value) when you need the validated output value.

Each guard is a standalone function, so it can be passed directly as a callback.

Example ​

ts
if (isSpecType.ContentBlock(value)) {
    // value is ContentBlock
}

const blocks = mixed.filter(isSpecType.ContentBlock);

JSONRPC_VERSION ​

const JSONRPC_VERSION: "2.0" = '2.0'

Defined in: packages/core/src/constants.ts:110


LATEST_PROTOCOL_VERSION ​

const LATEST_PROTOCOL_VERSION: "2025-11-25" = '2025-11-25'

Defined in: packages/core/src/constants.ts:1


LOG_LEVEL_META_KEY ​

const LOG_LEVEL_META_KEY: "io.modelcontextprotocol/logLevel" = 'io.modelcontextprotocol/logLevel'

Defined in: packages/core/src/constants.ts:69

_meta key carrying the desired log level for a request.

When absent, the server must not send notifications/message notifications for the request.

Deprecated ​

Deprecated as of protocol version 2026-07-28 (SEP-2577); remains in the specification for at least twelve months.


METHOD_NOT_FOUND ​

const METHOD_NOT_FOUND: -32601 = -32_601

Defined in: packages/core/src/constants.ts:115


PARSE_ERROR ​

const PARSE_ERROR: -32700 = -32_700

Defined in: packages/core/src/constants.ts:113


PROTOCOL_VERSION_META_KEY ​

const PROTOCOL_VERSION_META_KEY: "io.modelcontextprotocol/protocolVersion" = 'io.modelcontextprotocol/protocolVersion'

Defined in: packages/core/src/constants.ts:19

_meta key carrying the MCP protocol version governing a request.

For the HTTP transport, the value must match the MCP-Protocol-Version header.


const RELATED_TASK_META_KEY: "io.modelcontextprotocol/related-task" = 'io.modelcontextprotocol/related-task'

Defined in: packages/core/src/constants.ts:10

_meta key associating a message with a 2025-11-25 task.

Deprecated ​

2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.


SERVER_INFO_META_KEY ​

const SERVER_INFO_META_KEY: "io.modelcontextprotocol/serverInfo" = 'io.modelcontextprotocol/serverInfo'

Defined in: packages/core/src/constants.ts:37

_meta key identifying the server software producing a response.

Servers SHOULD include it on every response; the value is self-reported and intended for display, logging, and debugging — clients should not rely on it for behavior or security decisions.


specTypeSchemas ​

const specTypeSchemas: SchemaRecord

Defined in: packages/core-internal/src/types/specTypeSchema.ts:291

Runtime validators for every MCP spec type, keyed by type name.

Use this when you need to validate a spec-defined shape at a boundary the SDK does not own, for example an extension's custom-method payload that embeds a CallToolResult, or a value read from storage that should be a Tool.

Each entry implements the Standard Schema interface, so it composes with any Standard-Schema-aware library. For a simple boolean check, use isSpecType instead.

Example ​

ts
const result = specTypeSchemas.CallToolResult['~standard'].validate(untrusted);
if (result.issues === undefined) {
    // result.value is CallToolResult
}

STDIO_DEFAULT_MAX_BUFFER_SIZE ​

const STDIO_DEFAULT_MAX_BUFFER_SIZE: number

Defined in: packages/core-internal/src/shared/stdio.ts:4


SUBSCRIPTION_ID_META_KEY ​

const SUBSCRIPTION_ID_META_KEY: "io.modelcontextprotocol/subscriptionId" = 'io.modelcontextprotocol/subscriptionId'

Defined in: packages/core/src/constants.ts:58

_meta key carrying the JSON-RPC ID of the subscriptions/listen request that opened the stream a notification was delivered on.

Stamped by the server on every notification delivered via a subscriptions/listen stream (including the leading notifications/subscriptions/acknowledged); on stdio, where all messages share one channel, clients use it to correlate notifications with their originating subscription. The value is the listen request's JSON-RPC ID verbatim.


SUPPORTED_PROTOCOL_VERSIONS ​

const SUPPORTED_PROTOCOL_VERSIONS: string[]

Defined in: packages/core/src/constants.ts:3


TRACEPARENT_META_KEY ​

const TRACEPARENT_META_KEY: "traceparent" = 'traceparent'

Defined in: packages/core/src/constants.ts:87

_meta key carrying W3C Trace Context for distributed tracing (SEP-414).

When present, the value MUST follow the W3C traceparent header format, e.g. 00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01.

See ​

https://www.w3.org/TR/trace-context/#traceparent-header


TRACESTATE_META_KEY ​

const TRACESTATE_META_KEY: "tracestate" = 'tracestate'

Defined in: packages/core/src/constants.ts:97

_meta key carrying vendor-specific trace state for distributed tracing (SEP-414).

When present, the value MUST follow the W3C tracestate header format, e.g. vendor1=value1,vendor2=value2.

See ​

https://www.w3.org/TR/trace-context/#tracestate-header

Functions ​

assertCompleteRequestPrompt() ​

assertCompleteRequestPrompt(request): asserts request is { method: "completion/complete"; params: { _meta?: { io.modelcontextprotocol/related-task?: { taskId: string }; progressToken?: string | number; [key: string]: unknown }; argument: { name: string; value: string }; context?: { arguments?: { [key: string]: string } }; ref: { name: string; type: "ref/prompt" } } }

Defined in: packages/core-internal/src/types/guards.ts:128

Parameters ​

request ​
method ​

"completion/complete" = ...

params ​

{ _meta?: {[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; }; argument: { name: string; value: string; }; context?: { arguments?: {[key: string]: string; }; }; ref: { type: "ref/resource"; uri: string; } | { name: string; type: "ref/prompt"; }; } = CompleteRequestParamsSchema

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.

params.argument ​

{ name: string; value: string; } = ...

The argument's information

params.argument.name ​

string = ...

The name of the argument

params.argument.value ​

string = ...

The value of the argument to use for completion matching.

params.context? ​

{ arguments?: {[key: string]: string; }; } = ...

params.context.arguments? ​

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

Previously-resolved variables in a URI template or prompt.

params.ref ​

{ type: "ref/resource"; uri: string; } | { name: string; type: "ref/prompt"; } = ...

Returns ​

asserts request is { method: "completion/complete"; params: { _meta?: { io.modelcontextprotocol/related-task?: { taskId: string }; progressToken?: string | number; [key: string]: unknown }; argument: { name: string; value: string }; context?: { arguments?: { [key: string]: string } }; ref: { name: string; type: "ref/prompt" } } }


assertCompleteRequestResourceTemplate() ​

assertCompleteRequestResourceTemplate(request): asserts request is { method: "completion/complete"; params: { _meta?: { io.modelcontextprotocol/related-task?: { taskId: string }; progressToken?: string | number; [key: string]: unknown }; argument: { name: string; value: string }; context?: { arguments?: { [key: string]: string } }; ref: { type: "ref/resource"; uri: string } } }

Defined in: packages/core-internal/src/types/guards.ts:135

Parameters ​

request ​
method ​

"completion/complete" = ...

params ​

{ _meta?: {[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; }; argument: { name: string; value: string; }; context?: { arguments?: {[key: string]: string; }; }; ref: { type: "ref/resource"; uri: string; } | { name: string; type: "ref/prompt"; }; } = CompleteRequestParamsSchema

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.

params.argument ​

{ name: string; value: string; } = ...

The argument's information

params.argument.name ​

string = ...

The name of the argument

params.argument.value ​

string = ...

The value of the argument to use for completion matching.

params.context? ​

{ arguments?: {[key: string]: string; }; } = ...

params.context.arguments? ​

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

Previously-resolved variables in a URI template or prompt.

params.ref ​

{ type: "ref/resource"; uri: string; } | { name: string; type: "ref/prompt"; } = ...

Returns ​

asserts request is { method: "completion/complete"; params: { _meta?: { io.modelcontextprotocol/related-task?: { taskId: string }; progressToken?: string | number; [key: string]: unknown }; argument: { name: string; value: string }; context?: { arguments?: { [key: string]: string } }; ref: { type: "ref/resource"; uri: string } } }


checkResourceAllowed() ​

checkResourceAllowed(options): boolean

Defined in: packages/core-internal/src/shared/authUtils.ts:35

Checks if a requested resource URL matches a configured resource URL. A requested resource matches if it has the same scheme, domain, port, and its path starts with the configured resource's path.

Parameters ​

options ​

The options object

configuredResource ​

string | URL

The resource URL that has been configured

requestedResource ​

string | URL

The resource URL being requested

Returns ​

boolean

true if the requested resource matches the configured resource, false otherwise


createFetchWithInit() ​

createFetchWithInit(baseFetch?, baseInit?): FetchLike

Defined in: packages/core-internal/src/shared/transport.ts:31

Creates a fetch function that includes base RequestInit options. This ensures requests inherit settings like credentials, mode, headers, etc. from the base init.

Parameters ​

baseFetch? ​

FetchLike = fetch

The base fetch function to wrap (defaults to global fetch)

baseInit? ​

RequestInit

The base RequestInit to merge with each request

Returns ​

FetchLike

A wrapped fetch function that merges base options with call-specific options


deserializeMessage() ​

deserializeMessage(line): JSONRPCMessage

Defined in: packages/core-internal/src/shared/stdio.ts:56

Parameters ​

line ​

string

Returns ​

JSONRPCMessage


getDisplayName() ​

getDisplayName(metadata): string

Defined in: packages/core-internal/src/shared/metadataUtils.ts:13

Gets the display name for an object with BaseMetadata. For tools, the precedence is: title → annotations.title → name For other objects: title → name This implements the spec requirement: "if no title is provided, name should be used for display purposes"

Parameters ​

metadata ​

{ name: string; title?: string; } | object & object

Type Literal ​

{ name: string; title?: string; }

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


object & object

Returns ​

string


isCallToolResult() ​

isCallToolResult(value): value is { _meta?: { io.modelcontextprotocol/serverInfo?: { description?: string; icons?: { mimeType?: string; sizes?: string[]; src: string; theme?: "light" | "dark" }[]; name: string; title?: string; version: string; websiteUrl?: string }; [key: string]: unknown }; 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?: { mimeType?: string; sizes?: string[]; src: string; theme?: "light" | "dark" }[]; mimeType?: string; name: string; size?: number; title?: string; type: "resource_link"; uri: string })[]; isError?: boolean; structuredContent?: unknown; [key: string]: unknown }

Defined in: packages/core-internal/src/types/guards.ts:86

Checks if a value is a valid CallToolResult.

This is a consumer-side VALUE check against the neutral model, not a wire validator: a raw wire object that additionally carries wire-only members (e.g. resultType) still passes through the loose index signature. Use a transport-level parse to validate raw wire traffic.

Parameters ​

value ​

unknown

The value to check.

Returns ​

value is { _meta?: { io.modelcontextprotocol/serverInfo?: { description?: string; icons?: { mimeType?: string; sizes?: string[]; src: string; theme?: "light" | "dark" }[]; name: string; title?: string; version: string; websiteUrl?: string }; [key: string]: unknown }; 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?: { mimeType?: string; sizes?: string[]; src: string; theme?: "light" | "dark" }[]; mimeType?: string; name: string; size?: number; title?: string; type: "resource_link"; uri: string })[]; isError?: boolean; structuredContent?: unknown; [key: string]: unknown }

True if the value is a valid CallToolResult, false otherwise.


isInitializedNotification() ​

isInitializedNotification(value): value is { method: "notifications/initialized"; params?: { _meta?: { io.modelcontextprotocol/related-task?: { taskId: string }; progressToken?: string | number; [key: string]: unknown } } }

Defined in: packages/core-internal/src/types/guards.ts:125

Parameters ​

value ​

unknown

Returns ​

value is { method: "notifications/initialized"; params?: { _meta?: { io.modelcontextprotocol/related-task?: { taskId: string }; progressToken?: string | number; [key: string]: unknown } } }


isInitializeRequest() ​

isInitializeRequest(value): value is { method: "initialize"; params: { _meta?: { io.modelcontextprotocol/related-task?: { taskId: string }; progressToken?: string | number; [key: string]: unknown }; capabilities: { elicitation?: { form?: { applyDefaults?: boolean; [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 }; 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 }; [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 }; experimental?: { [key: string]: { [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 } }; extensions?: { [key: string]: { [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 } }; 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?: { 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?: { elicitation?: { create?: { [key: ...]: ... }; [key: string]: unknown }; sampling?: { createMessage?: { [key: ...]: ... }; [key: string]: unknown }; [key: string]: unknown }; [key: string]: unknown } }; clientInfo: { description?: string; icons?: { mimeType?: string; sizes?: string[]; src: string; theme?: "light" | "dark" }[]; name: string; title?: string; version: string; websiteUrl?: string }; protocolVersion: string } }

Defined in: packages/core-internal/src/types/guards.ts:123

Parameters ​

value ​

unknown

Returns ​

value is { method: "initialize"; params: { _meta?: { io.modelcontextprotocol/related-task?: { taskId: string }; progressToken?: string | number; [key: string]: unknown }; capabilities: { elicitation?: { form?: { applyDefaults?: boolean; [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 }; 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 }; [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 }; experimental?: { [key: string]: { [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 } }; extensions?: { [key: string]: { [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 } }; 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?: { 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?: { elicitation?: { create?: { [key: ...]: ... }; [key: string]: unknown }; sampling?: { createMessage?: { [key: ...]: ... }; [key: string]: unknown }; [key: string]: unknown }; [key: string]: unknown } }; clientInfo: { description?: string; icons?: { mimeType?: string; sizes?: string[]; src: string; theme?: "light" | "dark" }[]; name: string; title?: string; version: string; websiteUrl?: string }; protocolVersion: string } }


isInputRequiredResult() ​

isInputRequiredResult(value): value is InputRequiredResult

Defined in: packages/core-internal/src/types/guards.ts:105

Checks whether a value is an input-required result (protocol revision 2026-07-28): the multi-round-trip return shape discriminated by resultType: 'input_required'.

This is a discriminator check, not a full validator — the at-least-one rule (inputRequests or requestState) is enforced by the inputRequired() builder and re-checked by the server seam for hand-built values.

Parameters ​

value ​

unknown

The value to check.

Returns ​

value is InputRequiredResult

True if the value carries the input_required discriminator.


isJsonContentType() ​

isJsonContentType(header): boolean

Defined in: packages/core-internal/src/shared/mediaType.ts:51

Whether a raw Content-Type header value denotes application/json. Parameters (for example charset=utf-8) are allowed and ignored; malformed parameter sections do not reject a header whose media type is unambiguously application/json (see mediaTypeEssence for the exact grammar).

Parameters ​

string | null | undefined

Returns ​

boolean


isJSONRPCErrorResponse() ​

isJSONRPCErrorResponse(value): value is { error: { code: number; data?: unknown; message: string }; id?: string | number; jsonrpc: "2.0" }

Defined in: packages/core-internal/src/types/guards.ts:63

Checks if a value is a valid JSONRPCErrorResponse.

Parameters ​

value ​

unknown

The value to check.

Returns ​

value is { error: { code: number; data?: unknown; message: string }; id?: string | number; jsonrpc: "2.0" }

True if the value is a valid JSONRPCErrorResponse, false otherwise.


isJSONRPCNotification() ​

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

Defined in: packages/core-internal/src/types/guards.ts:46

Parameters ​

value ​

unknown

Returns ​

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


isJSONRPCRequest() ​

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

Defined in: packages/core-internal/src/types/guards.ts:44

Parameters ​

value ​

unknown

Returns ​

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


isJSONRPCResponse() ​

isJSONRPCResponse(value): value is JSONRPCResponse

Defined in: packages/core-internal/src/types/guards.ts:72

Checks if a value is a valid JSONRPCResponse (either a result or error response).

Parameters ​

value ​

unknown

The value to check.

Returns ​

value is JSONRPCResponse

True if the value is a valid JSONRPCResponse, false otherwise.


isJSONRPCResultResponse() ​

isJSONRPCResultResponse(value): value is JSONRPCResultResponse

Defined in: packages/core-internal/src/types/guards.ts:54

Checks if a value is a valid JSONRPCResultResponse.

Parameters ​

value ​

unknown

The value to check.

Returns ​

value is JSONRPCResultResponse

True if the value is a valid JSONRPCResultResponse, false otherwise.


isTaskAugmentedRequestParams() ​

isTaskAugmentedRequestParams(value): value is { _meta?: { io.modelcontextprotocol/related-task?: { taskId: string }; progressToken?: string | number; [key: string]: unknown }; task?: { ttl?: number } }

Defined in: packages/core-internal/src/types/guards.ts:120

Checks if a value is a valid TaskAugmentedRequestParams.

Parameters ​

value ​

unknown

The value to check.

Returns ​

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

True if the value is a valid TaskAugmentedRequestParams, false otherwise.

Deprecated ​

Recognizes 2025-11-25 task wire vocabulary, which has no SDK runtime; kept importable for interoperability only.


mergeCapabilities() ​

Call Signature ​

mergeCapabilities(base, additional): object

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

Parameters ​
base ​
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.

additional ​

Partial<ServerCapabilities>

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.

Call Signature ​

mergeCapabilities(base, additional): object

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

Parameters ​
base ​
elicitation? ​

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

Present if the client supports eliciting user input.

elicitation.form? ​

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

elicitation.form.applyDefaults? ​

boolean = ...

elicitation.url? ​

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

experimental? ​

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

Experimental, non-standard capabilities that the client supports.

extensions? ​

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

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

roots? ​

{ listChanged?: boolean; } = ...

Present if the client supports listing roots.

Deprecated

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

roots.listChanged? ​

boolean = ...

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

sampling? ​

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

Present if the client supports sampling from an LLM.

Deprecated

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

sampling.context? ​

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

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

sampling.tools? ​

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

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

tasks? ​

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

Present if the client supports task creation.

Deprecated

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

tasks.cancel? ​

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

Present if the client supports cancelling tasks.

tasks.list? ​

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

Present if the client supports listing tasks.

tasks.requests? ​

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

Capabilities for task creation on specific request types.

tasks.requests.elicitation? ​

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

Task support for elicitation requests.

tasks.requests.elicitation.create? ​

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

tasks.requests.sampling? ​

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

Task support for sampling requests.

tasks.requests.sampling.createMessage? ​

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

additional ​

Partial<ClientCapabilities>

Returns ​
elicitation? ​

optional elicitation?: object

Present if the client supports eliciting user input.

Index Signature ​

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

elicitation.form? ​

optional form?: object

Index Signature ​

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

elicitation.form.applyDefaults? ​

optional applyDefaults?: boolean

elicitation.url? ​

optional url?: object

Index Signature ​

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

experimental? ​

optional experimental?: object

Experimental, non-standard capabilities that the client supports.

Index Signature ​

[key: string]: object

extensions? ​

optional extensions?: object

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

Index Signature ​

[key: string]: object

roots? ​

optional roots?: object

Present if the client supports listing roots.

Deprecated ​

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

roots.listChanged? ​

optional listChanged?: boolean

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

sampling? ​

optional sampling?: object

Present if the client supports sampling from an LLM.

Deprecated ​

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

sampling.context? ​

optional context?: object

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

Index Signature ​

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

sampling.tools? ​

optional tools?: object

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

Index Signature ​

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

tasks? ​

optional tasks?: object

Present if the client supports task creation.

Index Signature ​

[key: string]: unknown

Deprecated ​

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

tasks.cancel? ​

optional cancel?: object

Present if the client supports cancelling tasks.

Index Signature ​

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

tasks.list? ​

optional list?: object

Present if the client supports listing tasks.

Index Signature ​

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

tasks.requests? ​

optional requests?: object

Capabilities for task creation on specific request types.

Index Signature ​

[key: string]: unknown

tasks.requests.elicitation? ​

optional elicitation?: object

Task support for elicitation requests.

Index Signature ​

[key: string]: unknown

tasks.requests.elicitation.create? ​

optional create?: object

Index Signature ​

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

tasks.requests.sampling? ​

optional sampling?: object

Task support for sampling requests.

Index Signature ​

[key: string]: unknown

tasks.requests.sampling.createMessage? ​

optional createMessage?: object

Index Signature ​

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


parseJSONRPCMessage() ​

parseJSONRPCMessage(value): JSONRPCMessage

Defined in: packages/core-internal/src/types/guards.ts:40

Validates and parses an unknown value as a JSON-RPC message.

Use this to validate incoming messages in custom transport implementations. Throws if the value does not conform to the JSON-RPC message schema.

Parameters ​

value ​

unknown

The value to validate (typically a parsed JSON object).

Returns ​

JSONRPCMessage

The validated JSONRPCMessage.

Throws ​

If validation fails.


preloadSchemas() ​

preloadSchemas(): void

Defined in: packages/core-internal/src/wire/preload.ts:47

Eagerly builds every lazily-constructed wire-schema layer, so that no later validation pays schema-construction cost.

Synchronous and idempotent: every layer is a memo, so the first call does all the work and subsequent calls return immediately. Reference identity is unaffected — this forces the same memos every lazy consumer pulls through.

Call it at module scope on platforms that bill per-request CPU but not module evaluation (isolate-based edge/serverless runtimes), where deferring construction would move it into the first request of every fresh isolate:

ts
// from '@modelcontextprotocol/server' or '@modelcontextprotocol/client' —
// each package bundles its own schema copy, so warm the one(s) you import.
preloadSchemas(); // module scope — runs during isolate warm-up

On Node CLIs and other process-per-invocation runtimes, prefer the lazy default — there, module-scope construction is pure added boot latency.

Returns ​

void


resourceUrlFromServerUrl() ​

resourceUrlFromServerUrl(url): URL

Defined in: packages/core-internal/src/shared/authUtils.ts:11

Converts a server URL to a resource URL by removing the fragment. RFC 8707 section 2 states that resource URIs "MUST NOT include a fragment component". Keeps everything else unchanged (scheme, domain, port, path, query).

Parameters ​

url ​

string | URL

Returns ​

URL


serializeMessage() ​

serializeMessage(message): string

Defined in: packages/core-internal/src/shared/stdio.ts:60

Parameters ​

message ​

JSONRPCMessage

Returns ​

string


withInputRequired() ​

withInputRequired<S>(schema): StandardSchemaV1<unknown, InputRequiredResult | InferOutput<S>>

Defined in: packages/core-internal/src/shared/inputRequired.ts:260

Wraps a result schema so a request issued through client.request() / ctx.mcpReq.send() with allowInputRequired: true is typed as either the schema's result or an InputRequiredResult.

The manual multi-round-trip path: pass { allowInputRequired: true } in the request options so an input_required response is handed back to the caller instead of being auto-fulfilled (or rejected), and wrap the result schema with withInputRequired() so the returned value is typed and validated correctly for both outcomes — input_required values pass through as-is, complete results validate against the wrapped schema.

Type Parameters ​

S ​

S extends StandardSchemaV1<unknown, unknown>

Parameters ​

schema ​

S

Returns ​

StandardSchemaV1<unknown, InputRequiredResult | InferOutput<S>>

References ​

accessTokenHash ​

Re-exports accessTokenHash


AddClientAuthentication ​

Re-exports AddClientAuthentication


applyMiddlewares ​

Re-exports applyMiddlewares


AssertionCallback ​

Re-exports AssertionCallback


assertSecureTokenEndpoint ​

Re-exports assertSecureTokenEndpoint


auth ​

Re-exports auth


AuthOptions ​

Re-exports AuthOptions


AuthorizationServerMismatchError ​

Re-exports AuthorizationServerMismatchError


AuthProvider ​

Re-exports AuthProvider


AuthResult ​

Re-exports AuthResult


buildDiscoveryUrls ​

Re-exports buildDiscoveryUrls


CacheableRequestOptions ​

Re-exports CacheableRequestOptions


CacheEntry ​

Re-exports CacheEntry


CacheKey ​

Re-exports CacheKey


CacheMode ​

Re-exports CacheMode


CacheScope ​

Re-exports CacheScope


CallToolRequestOptions ​

Re-exports CallToolRequestOptions


Client ​

Re-exports Client


ClientAuthMethod ​

Re-exports ClientAuthMethod


ClientCredentialsProvider ​

Re-exports ClientCredentialsProvider


ClientCredentialsProviderOptions ​

Re-exports ClientCredentialsProviderOptions


ClientOptions ​

Re-exports ClientOptions


computeScopeUnion ​

Re-exports computeScopeUnion


ConnectOptions ​

Re-exports ConnectOptions


createMiddleware ​

Re-exports createMiddleware


createPrivateKeyJwtAuth ​

Re-exports createPrivateKeyJwtAuth


CrossAppAccessContext ​

Re-exports CrossAppAccessContext


CrossAppAccessProvider ​

Re-exports CrossAppAccessProvider


CrossAppAccessProviderOptions ​

Re-exports CrossAppAccessProviderOptions


discoverAndRequestJwtAuthGrant ​

Re-exports discoverAndRequestJwtAuthGrant


DiscoverAndRequestJwtAuthGrantOptions ​

Re-exports DiscoverAndRequestJwtAuthGrantOptions


discoverAuthorizationServerMetadata ​

Re-exports discoverAuthorizationServerMetadata


discoverOAuthMetadata ​

Re-exports discoverOAuthMetadata


discoverOAuthProtectedResourceMetadata ​

Re-exports discoverOAuthProtectedResourceMetadata


discoverOAuthServerInfo ​

Re-exports discoverOAuthServerInfo


DPOP_SUPPORTED_ALGS ​

Re-exports DPOP_SUPPORTED_ALGS


DpopAlg ​

Re-exports DpopAlg


DpopKeyPair ​

Re-exports DpopKeyPair


DpopProofRequest ​

Re-exports DpopProofRequest


DpopSession ​

Re-exports DpopSession


DpopSessionSource ​

Re-exports DpopSessionSource


DpopTokenSource ​

Re-exports DpopTokenSource


exchangeAuthorization ​

Re-exports exchangeAuthorization


exchangeJwtAuthGrant ​

Re-exports exchangeJwtAuthGrant


extractResourceMetadataUrl ​

Re-exports extractResourceMetadataUrl


extractWWWAuthenticateParams ​

Re-exports extractWWWAuthenticateParams


fetchToken ​

Re-exports fetchToken


fromJsonSchema ​

Re-exports fromJsonSchema


generateDpopKeyPair ​

Re-exports generateDpopKeyPair


GenerateDpopKeyPairOptions ​

Re-exports GenerateDpopKeyPairOptions


getSupportedElicitationModes ​

Re-exports getSupportedElicitationModes


InMemoryResponseCacheStore ​

Re-exports InMemoryResponseCacheStore


InMemoryResponseCacheStoreOptions ​

Re-exports InMemoryResponseCacheStoreOptions


InsecureTokenEndpointError ​

Re-exports InsecureTokenEndpointError


InsufficientScopeError ​

Re-exports InsufficientScopeError


isDpopNonceChallenge ​

Re-exports isDpopNonceChallenge


isHttpsUrl ​

Re-exports isHttpsUrl


isStrictScopeSuperset ​

Re-exports isStrictScopeSuperset


IssuerMismatchError ​

Re-exports IssuerMismatchError


JwtAuthGrantResult ​

Re-exports JwtAuthGrantResult


LoggingOptions ​

Re-exports LoggingOptions


MAX_CACHE_TTL_MS ​

Re-exports MAX_CACHE_TTL_MS


MaybePromise ​

Re-exports MaybePromise


McpSubscription ​

Re-exports McpSubscription


Middleware ​

Re-exports Middleware


OAuthClientFlowError ​

Re-exports OAuthClientFlowError


OAuthClientInformationContext ​

Re-exports OAuthClientInformationContext


OAuthClientProvider ​

Re-exports OAuthClientProvider


OAuthDiscoveryState ​

Re-exports OAuthDiscoveryState


OAuthServerInfo ​

Re-exports OAuthServerInfo


parseErrorResponse ​

Re-exports parseErrorResponse


prepareAuthorizationCodeRequest ​

Re-exports prepareAuthorizationCodeRequest


PriorDiscovery ​

Re-exports PriorDiscovery


PrivateKeyJwtProvider ​

Re-exports PrivateKeyJwtProvider


PrivateKeyJwtProviderOptions ​

Re-exports PrivateKeyJwtProviderOptions


ReconnectionScheduler ​

Re-exports ReconnectionScheduler


refreshAuthorization ​

Re-exports refreshAuthorization


registerClient ​

Re-exports registerClient


RegistrationRejectedError ​

Re-exports RegistrationRejectedError


RequestJwtAuthGrantOptions ​

Re-exports RequestJwtAuthGrantOptions


requestJwtAuthorizationGrant ​

Re-exports requestJwtAuthorizationGrant


RequestLogger ​

Re-exports RequestLogger


resolveClientMetadata ​

Re-exports resolveClientMetadata


ResponseCacheStore ​

Re-exports ResponseCacheStore


selectClientAuthMethod ​

Re-exports selectClientAuthMethod


selectResourceURL ​

Re-exports selectResourceURL


SSEClientTransport ​

Re-exports SSEClientTransport


SSEClientTransportOptions ​

Re-exports SSEClientTransportOptions


SseError ​

Re-exports SseError


startAuthorization ​

Re-exports startAuthorization


StartSSEOptions ​

Re-exports StartSSEOptions


StaticPrivateKeyJwtProvider ​

Re-exports StaticPrivateKeyJwtProvider


StaticPrivateKeyJwtProviderOptions ​

Re-exports StaticPrivateKeyJwtProviderOptions


StreamableHTTPClientTransport ​

Re-exports StreamableHTTPClientTransport


StreamableHTTPClientTransportOptions ​

Re-exports StreamableHTTPClientTransportOptions


StreamableHTTPReconnectionOptions ​

Re-exports StreamableHTTPReconnectionOptions


UnauthorizedError ​

Re-exports UnauthorizedError


validateAuthorizationResponseIssuer ​

Re-exports validateAuthorizationResponseIssuer


validateClientMetadataUrl ​

Re-exports validateClientMetadataUrl


VersionNegotiationMode ​

Re-exports VersionNegotiationMode


VersionNegotiationOptions ​

Re-exports VersionNegotiationOptions


VersionNegotiationProbeOptions ​

Re-exports VersionNegotiationProbeOptions


withDpop ​

Re-exports withDpop


withDpopFromProvider ​

Re-exports withDpopFromProvider


withLogging ​

Re-exports withLogging


withOAuth ​

Re-exports withOAuth