Skip to main content

Schema Reference

还没翻译译自英文(modelcontextprotocol.io)本页 311 段都还没译

JSON-RPC

JSONRPCErrorResponse

interface JSONRPCErrorResponse {

  jsonrpc: "2.0";

  id?: RequestId;

  error: Error;

}

A response to a request that indicates an error occurred.

jsonrpc: "2.0"
id?: RequestId
error: Error

JSONRPCMessage

Refers to any valid JSON-RPC object that can be decoded off the wire, or encoded to be sent.

JSONRPCNotification

interface JSONRPCNotification {

  method: string;

  params?: { [key: string]: any };

  jsonrpc: "2.0";

}

A notification which does not expect a response.

method: string

Inherited from Notification.method

params?: { [key: string]: any }

Inherited from Notification.params

jsonrpc: "2.0"

JSONRPCRequest

interface JSONRPCRequest {

  method: string;

  params?: { [key: string]: any };

  jsonrpc: "2.0";

  id: RequestId;

}

A request that expects a response.

method: string

Inherited from Request.method

params?: { [key: string]: any }

Inherited from Request.params

jsonrpc: "2.0"
id: RequestId

JSONRPCResponse

A response to a request, containing either the result or error.

JSONRPCResultResponse

interface JSONRPCResultResponse {

  jsonrpc: "2.0";

  id: RequestId;

  result: Result;

}

A successful (non-error) response to a request.

jsonrpc: "2.0"
id: RequestId
result: Result

Common Types

Annotations

interface Annotations {

  audience?: Role[];

  priority?: number;

  lastModified?: string;

}

Optional annotations for the client. The client can use annotations to inform how objects are used or displayed

audience?: Role[]

Describes who the intended audience of this object or data is.

It can include multiple entries to indicate content useful for multiple audiences (e.g., ["user", "assistant"]).

priority?: number

Describes how important this data is for operating the server.

A value of 1 means "most important," and indicates that the data is effectively required, while 0 means "least important," and indicates that the data is entirely optional.

lastModified?: string

The moment the resource was last modified, as an ISO 8601 formatted string.

Should be an ISO 8601 formatted string (e.g., "2025-01-12T15:00:58Z").

Examples: last activity timestamp in an open file, timestamp when the resource was attached, etc.

Cursor

Cursor: string

An opaque token used to represent a cursor for pagination.

EmptyResult

EmptyResult: Result

A result that indicates success but carries no data.

Icon

interface Icon {

  src: string;

  mimeType?: string;

  sizes?: string[];

  theme?: "light" | "dark";

}

An optionally-sized icon that can be displayed in a user interface.

src: string

A standard URI pointing to an icon resource. May be an HTTP/HTTPS URL or a data: URI with Base64-encoded image data.

Consumers SHOULD take steps to ensure URLs serving icons are from the same domain as the client/server or a trusted domain.

Consumers SHOULD take appropriate precautions when consuming SVGs as they can contain executable JavaScript.

mimeType?: string

Optional MIME type override if the source MIME type is missing or generic. For example: "image/png", "image/jpeg", or "image/svg+xml".

sizes?: string[]

Optional array of strings that specify sizes at which the icon can be used. Each string should be in WxH format (e.g., "48x48", "96x96") or "any" for scalable formats like SVG.

If not provided, the client should assume that the icon can be used at any size.

theme?: "light" | "dark"

Optional specifier for the theme this icon is designed for. "light" indicates the icon is designed to be used with a light background, and "dark" indicates the icon is designed to be used with a dark background.

If not provided, the client should assume the icon can be used with any theme.

InputResponseRequestParams

interface InputResponseRequestParams {

  _meta: RequestMetaObject;

  inputResponses?: InputResponses;

  requestState?: string;

}

Common params for any request.

_meta: RequestMetaObject

Inherited from RequestParams._meta

inputResponses?: InputResponses
requestState?: string

JSONArray

JSONArray: JSONValue[]

JSONObject

JSONObject: { [key: string]: JSONValue }
Type Declaration

JSONValue

JSONValue: string | number | boolean | null | JSONObject | JSONArray

LoggingLevel

LoggingLevel:

  | "debug"

  | "info"

  | "notice"

  | "warning"

  | "error"

  | "critical"

  | "alert"

  | "emergency"

The severity of a log message.

These map to syslog message severities, as specified in RFC-5424: https://datatracker.ietf.org/doc/html/rfc5424#section-6.2.1

Deprecated

Deprecated as of protocol version 2026-07-28 (SEP-2577). Remains in the specification for at least twelve months; see the deprecated features registry.

MetaObject

MetaObject: Record<string, unknown>

Represents the contents of a _meta field, which clients and servers use to attach additional metadata to their interactions.

Certain key names are reserved by MCP for protocol-level metadata; implementations MUST NOT make assumptions about values at these keys. Additionally, specific schema definitions may reserve particular names for purpose-specific metadata, as declared in those definitions.

Valid keys have two segments:

Prefix:

  • Optional — if specified, MUST be a series of labels separated by dots (.), followed by a slash (/).
  • Labels MUST start with a letter and end with a letter or digit. Interior characters may be letters, digits, or hyphens (-).
  • Implementations SHOULD use reverse DNS notation (e.g., com.example/ rather than example.com/).
  • Any prefix where the second label is modelcontextprotocol or mcp is reserved for MCP use. For example: io.modelcontextprotocol/, dev.mcp/, org.modelcontextprotocol.api/, and com.mcp.tools/ are all reserved. However, com.example.mcp/ is NOT reserved, as the second label is example.

Name:

  • Unless empty, MUST start and end with an alphanumeric character ([a-z0-9A-Z]).
  • Interior characters may be alphanumeric, hyphens (-), underscores (_), or dots (.).
See

General fields: _meta for more details.

NotificationMetaObject

interface NotificationMetaObject {

  "io.modelcontextprotocol/subscriptionId"?: RequestId;

  [key: string]: unknown;

}

Extends MetaObject with additional notification-specific fields. All key naming rules from MetaObject apply.

See
"io.modelcontextprotocol/subscriptionId"?: RequestId

Identifies the subscription stream a notification was delivered on. The server MUST include this key on every notification delivered via a subscriptions/listen stream, so the client can correlate the notification with the originating subscription. The key is absent on notifications not delivered via a subscription stream (e.g. progress notifications for an in-flight request), which is why it is optional here.

The value is the JSON-RPC ID of the subscriptions/listen request that opened the stream.

NotificationParams

interface NotificationParams {

  _meta?: NotificationMetaObject;

}

Common params for any notification.

_meta?: NotificationMetaObject

PaginatedRequestParams

interface PaginatedRequestParams {

  _meta: RequestMetaObject;

  cursor?: string;

}

Common params for paginated requests.

_meta: RequestMetaObject

Inherited from RequestParams._meta

cursor?: string

An opaque token representing the current pagination position. If provided, the server should return results starting after this cursor.

ProgressToken

ProgressToken: string | number

A progress token, used to associate progress notifications with the original request.

RequestId

RequestId: string | number

A uniquely identifying ID for a request in JSON-RPC.

RequestMetaObject

Extends MetaObject with additional request-specific fields. All key naming rules from MetaObject apply.

See
progressToken?: ProgressToken

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.

"io.modelcontextprotocol/protocolVersion": string

The MCP Protocol Version being used for this request. Required.

For the HTTP transport, this value MUST match the MCP-Protocol-Version header; otherwise the server MUST return a 400 Bad Request. If the server does not support the requested version, it MUST return an UnsupportedProtocolVersionError.

"io.modelcontextprotocol/clientInfo"?: Implementation

Identifies the client software making the request. Clients SHOULD include this field on every request unless specifically configured not to do so.

The Implementation schema requires name and version; other fields are optional.

The value is self-reported by the client and is not verified by the protocol. It is intended for display, logging, and debugging. Servers SHOULD NOT use it to change their behavior, and SHOULD NOT rely on it for security decisions.

"io.modelcontextprotocol/clientCapabilities": ClientCapabilities

The client's capabilities for this specific request. Required.

Capabilities are declared per-request rather than once at initialization; an empty object means the client supports no optional capabilities. Servers MUST NOT infer capabilities from prior requests.

"io.modelcontextprotocol/logLevel"?: LoggingLevel

The desired log level for this request. Optional.

If absent, the server MUST NOT send any notifications/message notifications for this request. The client opts in to log messages by explicitly setting a level. Replaces the former logging/setLevel RPC.

Deprecated

Deprecated as of protocol version 2026-07-28 (SEP-2577). Remains in the specification for at least twelve months; see the deprecated features registry.

RequestParams

interface RequestParams {

  _meta: RequestMetaObject;

}

Common params for any request.

_meta: RequestMetaObject

Result

interface Result {

  _meta?: ResultMetaObject;

  resultType: string;

  [key: string]: unknown;

}

Common result fields.

_meta?: ResultMetaObject
resultType: string

Indicates the type of the result, which allows the client to determine how to parse the result object.

Servers implementing this protocol version MUST include this field. For backward compatibility, when a client receives a result from a server implementing an earlier protocol version (which does not include resultType), the client MUST treat the absent field as "complete".

ResultMetaObject

interface ResultMetaObject {

  "io.modelcontextprotocol/serverInfo"?: Implementation;

  [key: string]: unknown;

}

Extends MetaObject with additional result-specific fields. All key naming rules from MetaObject apply.

See
"io.modelcontextprotocol/serverInfo"?: Implementation

Identifies the server software producing the response. Servers SHOULD include this field on every response unless specifically configured not to do so.

The Implementation schema requires name and version; other fields are optional.

The value is self-reported by the server and is not verified by the protocol. It is intended for display, logging, and debugging. Clients SHOULD NOT use it to change their behavior, and SHOULD NOT rely on it for security decisions.

ResultType

ResultType: "complete" | "input_required" | string

Indicates the type of a Result object, allowing the client to determine how to parse the response.

complete - the request completed successfully and the result contains the final content. input_required - the request requires additional input and the result contains an InputRequiredResult object with instructions for the client to provide additional input before retrying the original request.

Role

Role: "user" | "assistant"

The sender or recipient of messages and data in a conversation.

Errors

Error

interface Error {

  code: number;

  message: string;

  data?: unknown;

}
code: number

The error type that occurred.

message: string

A short description of the error. The message SHOULD be limited to a concise single sentence.

data?: unknown

Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).

HEADER_MISMATCH

HEADER_MISMATCH: -32020

Error code returned when the HTTP headers of a request do not match the corresponding values in the request body, or required headers are missing or malformed.

HeaderMismatchError

interface HeaderMismatchError {

  jsonrpc: "2.0";

  id?: RequestId;

  error: Error & { code: -32020 };

}

Returned when a server rejects a request because the values in the HTTP headers do not match the corresponding values in the request body, or because required headers are missing or malformed. For HTTP, the response status code MUST be 400 Bad Request.

jsonrpc: "2.0"

Inherited from JSONRPCErrorResponse.jsonrpc

id?: RequestId

Inherited from JSONRPCErrorResponse.id

error: Error & { code: -32020 }

InternalError

interface InternalError {

  message: string;

  data?: unknown;

  code: -32603;

}

A JSON-RPC error indicating that an internal error occurred on the receiver. This error is returned when the receiver encounters an unexpected condition that prevents it from fulfilling the request.

message: string

A short description of the error. The message SHOULD be limited to a concise single sentence.

Inherited from Error.message

data?: unknown

Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).

Inherited from Error.data

code: -32603

The error type that occurred.

Overrides Error.code

InvalidParamsError

interface InvalidParamsError {

  message: string;

  data?: unknown;

  code: -32602;

}

A JSON-RPC error indicating that the method parameters are invalid or malformed.

In MCP, this error is returned in various contexts when request parameters fail validation:

  • Tools: Unknown tool name or invalid tool arguments
  • Prompts: Unknown prompt name or missing required arguments
  • Pagination: Invalid or expired cursor values
  • Logging: Invalid log level
  • Elicitation: Server requests an elicitation mode not declared in client capabilities
  • Sampling: Missing tool result or tool results mixed with other content

message: string

A short description of the error. The message SHOULD be limited to a concise single sentence.

Inherited from Error.message

data?: unknown

Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).

Inherited from Error.data

code: -32602

The error type that occurred.

Overrides Error.code

InvalidRequestError

interface InvalidRequestError {

  message: string;

  data?: unknown;

  code: -32600;

}

A JSON-RPC error indicating that the request is not a valid request object. This error is returned when the message structure does not conform to the JSON-RPC 2.0 specification requirements for a request (e.g., missing required fields like jsonrpc or method, or using invalid types for these fields).

message: string

A short description of the error. The message SHOULD be limited to a concise single sentence.

Inherited from Error.message

data?: unknown

Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).

Inherited from Error.data

code: -32600

The error type that occurred.

Overrides Error.code

MethodNotFoundError

interface MethodNotFoundError {

  message: string;

  data?: unknown;

  code: -32601;

}

A JSON-RPC error indicating that the requested method does not exist or is not available.

In MCP, a server returns this error when a client invokes a method the server does not implement — either a genuinely unknown method, or one gated behind a server capability the server did not advertise (e.g., calling prompts/list when the prompts capability was not advertised).

A request that requires a client capability the client did not declare is signalled instead by MissingRequiredClientCapabilityError (-32021).

message: string

A short description of the error. The message SHOULD be limited to a concise single sentence.

Inherited from Error.message

data?: unknown

Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).

Inherited from Error.data

code: -32601

The error type that occurred.

Overrides Error.code

MISSING_REQUIRED_CLIENT_CAPABILITY

MISSING_REQUIRED_CLIENT_CAPABILITY: -32021

Error code returned when a server requires a client capability that was not declared in the request's clientCapabilities.

MissingRequiredClientCapabilityError

interface MissingRequiredClientCapabilityError {

  jsonrpc: "2.0";

  id?: RequestId;

  error: Error & {

    code: -32021;

    data: { requiredCapabilities: ClientCapabilities };

  };

}

Returned when processing a request requires a capability the client did not declare in clientCapabilities. For HTTP, the response status code MUST be 400 Bad Request.

jsonrpc: "2.0"

Inherited from JSONRPCErrorResponse.jsonrpc

id?: RequestId

Inherited from JSONRPCErrorResponse.id

error: Error & { code: -32021; data: { requiredCapabilities: ClientCapabilities }; }

ParseError

interface ParseError {

  message: string;

  data?: unknown;

  code: -32700;

}

A JSON-RPC error indicating that invalid JSON was received by the server. This error is returned when the server cannot parse the JSON text of a message.

message: string

A short description of the error. The message SHOULD be limited to a concise single sentence.

Inherited from Error.message

data?: unknown

Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).

Inherited from Error.data

code: -32700

The error type that occurred.

Overrides Error.code

UNSUPPORTED_PROTOCOL_VERSION

UNSUPPORTED_PROTOCOL_VERSION: -32022

Error code returned when the request's protocol version is not supported by the server.

UnsupportedProtocolVersionError

interface UnsupportedProtocolVersionError {

  jsonrpc: "2.0";

  id?: RequestId;

  error: Error & {

    code: -32022;

    data: { supported: string[]; requested: string };

  };

}

Returned when the request's protocol version is unknown to the server or unsupported (e.g., a known experimental or draft version the server has chosen not to implement). For HTTP, the response status code MUST be 400 Bad Request.

jsonrpc: "2.0"

Inherited from JSONRPCErrorResponse.jsonrpc

id?: RequestId

Inherited from JSONRPCErrorResponse.id

error: Error & { code: -32022; data: { supported: string[]; requested: string }; }

Content

AudioContent

interface AudioContent {

  type: "audio";

  data: string;

  mimeType: string;

  annotations?: Annotations;

  _meta?: MetaObject;

}

Audio provided to or from an LLM.

type: "audio"
data: string

The base64-encoded audio data.

mimeType: string

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

annotations?: Annotations

Optional annotations for the client.

_meta?: MetaObject

BlobResourceContents

interface BlobResourceContents {

  uri: string;

  mimeType?: string;

  _meta?: MetaObject;

  blob: string;

}

uri: string

The URI of this resource.

Inherited from ResourceContents.uri

mimeType?: string

The MIME type of this resource, if known.

Inherited from ResourceContents.mimeType

_meta?: MetaObject

Inherited from ResourceContents._meta

blob: string

A base64-encoded string representing the binary data of the item.

ContentBlock

ContentBlock:

  | TextContent

  | ImageContent

  | AudioContent

  | ResourceLink

  | EmbeddedResource

EmbeddedResource

interface EmbeddedResource {

  type: "resource";

  resource: TextResourceContents | BlobResourceContents;

  annotations?: Annotations;

  _meta?: MetaObject;

}

The contents of a resource, embedded into a prompt or tool call result.

It is up to the client how best to render embedded resources for the benefit of the LLM and/or the user.

type: "resource"
resource: TextResourceContents | BlobResourceContents
annotations?: Annotations

Optional annotations for the client.

_meta?: MetaObject

ImageContent

interface ImageContent {

  type: "image";

  data: string;

  mimeType: string;

  annotations?: Annotations;

  _meta?: MetaObject;

}

An image provided to or from an LLM.

type: "image"
data: string

The base64-encoded image data.

mimeType: string

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

annotations?: Annotations

Optional annotations for the client.

_meta?: MetaObject
interface ResourceLink {

  icons?: Icon[];

  name: string;

  title?: string;

  uri: string;

  description?: string;

  mimeType?: string;

  annotations?: Annotations;

  size?: number;

  _meta?: MetaObject;

  type: "resource_link";

}

A resource that the server is capable of reading, included in a prompt or tool call result.

Note: resource links returned by tools are not guaranteed to appear in the results of resources/list requests.

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)

Inherited from Resource.icons

Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).

Inherited from Resource.name

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

Inherited from Resource.title

The URI of this resource.

Inherited from Resource.uri

A description of what this resource represents.

This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.

Inherited from Resource.description

The MIME type of this resource, if known.

Inherited from Resource.mimeType

Optional annotations for the client.

Inherited from Resource.annotations

The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known.

This can be used by Hosts to display file sizes and estimate context window usage.

Inherited from Resource.size

Inherited from Resource._meta

TextContent

interface TextContent {

  type: "text";

  text: string;

  annotations?: Annotations;

  _meta?: MetaObject;

}

Text provided to or from an LLM.

type: "text"
text: string

The text content of the message.

annotations?: Annotations

Optional annotations for the client.

_meta?: MetaObject

TextResourceContents

interface TextResourceContents {

  uri: string;

  mimeType?: string;

  _meta?: MetaObject;

  text: string;

}

uri: string

The URI of this resource.

Inherited from ResourceContents.uri

mimeType?: string

The MIME type of this resource, if known.

Inherited from ResourceContents.mimeType

_meta?: MetaObject

Inherited from ResourceContents._meta

text: string

The text of the item. This must only be set if the item can actually be represented as text (not binary data).

completion/complete

CompleteRequest

interface CompleteRequest {

  jsonrpc: "2.0";

  id: RequestId;

  method: "completion/complete";

  params: CompleteRequestParams;

}

A request from the client to the server, to ask for completion options.

jsonrpc: "2.0"

Inherited from JSONRPCRequest.jsonrpc

id: RequestId

Inherited from JSONRPCRequest.id

method: "completion/complete"

Overrides JSONRPCRequest.method

params: CompleteRequestParams

Overrides JSONRPCRequest.params

CompleteRequestParams

interface CompleteRequestParams {

  _meta: RequestMetaObject;

  ref: PromptReference | ResourceTemplateReference;

  argument: { name: string; value: string };

  context?: { arguments?: { [key: string]: string } };

}

Parameters for a completion/complete request.

_meta: RequestMetaObject

Inherited from RequestParams._meta

ref: PromptReference | ResourceTemplateReference
argument: { name: string; value: string }

The argument's information

Type Declaration
  • name: string

    The name of the argument

  • value: string

    The value of the argument to use for completion matching.

context?: { arguments?: { [key: string]: string } }

Additional, optional context for completions

Type Declaration
  • Optionalarguments?: { [key: string]: string }

    Previously-resolved variables in a URI template or prompt.

CompleteResultResponse

interface CompleteResultResponse {

  jsonrpc: "2.0";

  id: RequestId;

  result: CompleteResult;

}

A successful response from the server for a completion/complete request.

jsonrpc: "2.0"

Inherited from JSONRPCResultResponse.jsonrpc

id: RequestId

Inherited from JSONRPCResultResponse.id

result: CompleteResult

Overrides JSONRPCResultResponse.result

CompleteResult

interface CompleteResult {

  _meta?: ResultMetaObject;

  resultType: string;

  completion: { values: string[]; total?: number; hasMore?: boolean };

  [key: string]: unknown;

}

The result returned by the server for a completion/complete request.

_meta?: ResultMetaObject

Inherited from Result._meta

resultType: string

Indicates the type of the result, which allows the client to determine how to parse the result object.

Servers implementing this protocol version MUST include this field. For backward compatibility, when a client receives a result from a server implementing an earlier protocol version (which does not include resultType), the client MUST treat the absent field as "complete".

Inherited from Result.resultType

completion: { values: string[]; total?: number; hasMore?: boolean }
Type Declaration
  • values: string[]

    An array of completion values. Must not exceed 100 items.

  • Optionaltotal?: number

    The total number of completion options available. This can exceed the number of values actually sent in the response.

  • OptionalhasMore?: boolean

    Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown.

PromptReference

interface PromptReference {

  name: string;

  title?: string;

  type: "ref/prompt";

}

Identifies a prompt.

name: string

Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).

Inherited from BaseMetadata.name

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

Inherited from BaseMetadata.title

type: "ref/prompt"

ResourceTemplateReference

interface ResourceTemplateReference {

  type: "ref/resource";

  uri: string;

}

A reference to a resource or resource template definition.

type: "ref/resource"
uri: string

The URI or URI template of the resource.

elicitation/create

ElicitRequest

interface ElicitRequest {

  method: "elicitation/create";

  params: ElicitRequestParams;

}

A request from the server to elicit additional information from the user via the client.

method: "elicitation/create"
params: ElicitRequestParams

ElicitRequestParams

The parameters for a request to elicit additional information from the user via the client.

ElicitResult

interface ElicitResult {

  action: "accept" | "decline" | "cancel";

  content?: { [key: string]: string | number | boolean | string[] };

}

The result returned by the client for an elicitation/create request.

action: "accept" | "decline" | "cancel"

The user action in response to the elicitation.

  • "accept": User submitted the form/confirmed the action
  • "decline": User explicitly declined the action
  • "cancel": User dismissed without making an explicit choice
content?: { [key: string]: string | number | boolean | string[] }

The submitted form data, only present when action is "accept" and mode was "form". Contains values matching the requested schema. Omitted for out-of-band mode responses.

BooleanSchema

interface BooleanSchema {

  type: "boolean";

  title?: string;

  description?: string;

  default?: boolean;

}

type: "boolean"
title?: string
description?: string
default?: boolean

ElicitRequestFormParams

interface ElicitRequestFormParams {

  mode?: "form";

  message: string;

  requestedSchema: {

    $schema?: string;

    type: "object";

    properties: { [key: string]: PrimitiveSchemaDefinition };

    required?: string[];

  };

}

The parameters for a request to elicit non-sensitive information from the user via a form in the client.

mode?: "form"

The elicitation mode.

message: string

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

requestedSchema: { $schema?: string; type: "object"; properties: { [key: string]: PrimitiveSchemaDefinition }; required?: string[]; }

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

ElicitRequestURLParams

interface ElicitRequestURLParams {

  mode: "url";

  message: string;

  url: string;

}

The parameters for a request to elicit information from the user via a URL in the client.

mode: "url"

The elicitation mode.

message: string

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

url: string

The URL that the user should navigate to.

LegacyTitledEnumSchema

interface LegacyTitledEnumSchema {

  type: "string";

  title?: string;

  description?: string;

  enum: string[];

  enumNames?: string[];

  default?: string;

}

Use TitledSingleSelectEnumSchema instead. This interface will be removed in a future version.

type: "string"
title?: string
description?: string
enum: string[]
enumNames?: string[]

(Legacy) Display names for enum values. Non-standard according to JSON schema 2020-12.

default?: string

MultiSelectEnumSchema

NumberSchema

interface NumberSchema {

  type: "number" | "integer";

  title?: string;

  description?: string;

  minimum?: number;

  maximum?: number;

  default?: number;

}

type: "number" | "integer"
title?: string
description?: string
minimum?: number
maximum?: number
default?: number

PrimitiveSchemaDefinition

PrimitiveSchemaDefinition:

  | StringSchema

  | NumberSchema

  | BooleanSchema

  | EnumSchema

Restricted schema definitions that only allow primitive types without nested objects or arrays.

SingleSelectEnumSchema

StringSchema

interface StringSchema {

  type: "string";

  title?: string;

  description?: string;

  minLength?: number;

  maxLength?: number;

  format?: "uri" | "email" | "date" | "date-time";

  default?: string;

}

type: "string"
title?: string
description?: string
minLength?: number
maxLength?: number
format?: "uri" | "email" | "date" | "date-time"
default?: string

TitledMultiSelectEnumSchema

interface TitledMultiSelectEnumSchema {

  type: "array";

  title?: string;

  description?: string;

  minItems?: number;

  maxItems?: number;

  items: { anyOf: { const: string; title: string }[] };

  default?: string[];

}

Schema for multiple-selection enumeration with display titles for each option.

type: "array"
title?: string

Optional title for the enum field.

description?: string

Optional description for the enum field.

minItems?: number

Minimum number of items to select.

maxItems?: number

Maximum number of items to select.

items: { anyOf: { const: string; title: string }[] }

Schema for array items with enum options and display labels.

Type Declaration
  • anyOf: { const: string; title: string }[]

    Array of enum options with values and display labels.

default?: string[]

Optional default value.

TitledSingleSelectEnumSchema

interface TitledSingleSelectEnumSchema {

  type: "string";

  title?: string;

  description?: string;

  oneOf: { const: string; title: string }[];

  default?: string;

}

Schema for single-selection enumeration with display titles for each option.

type: "string"
title?: string

Optional title for the enum field.

description?: string

Optional description for the enum field.

oneOf: { const: string; title: string }[]

Array of enum options with values and display labels.

Type Declaration
  • const: string

    The enum value.

  • title: string

    Display label for this option.

default?: string

Optional default value.

UntitledMultiSelectEnumSchema

interface UntitledMultiSelectEnumSchema {

  type: "array";

  title?: string;

  description?: string;

  minItems?: number;

  maxItems?: number;

  items: { type: "string"; enum: string[] };

  default?: string[];

}

Schema for multiple-selection enumeration without display titles for options.

type: "array"
title?: string

Optional title for the enum field.

description?: string

Optional description for the enum field.

minItems?: number

Minimum number of items to select.

maxItems?: number

Maximum number of items to select.

items: { type: "string"; enum: string[] }

Schema for the array items.

Type Declaration
  • type: "string"
  • enum: string[]

    Array of enum values to choose from.

default?: string[]

Optional default value.

UntitledSingleSelectEnumSchema

interface UntitledSingleSelectEnumSchema {

  type: "string";

  title?: string;

  description?: string;

  enum: string[];

  default?: string;

}

Schema for single-selection enumeration without display titles for options.

type: "string"
title?: string

Optional title for the enum field.

description?: string

Optional description for the enum field.

enum: string[]

Array of enum values to choose from.

default?: string

Optional default value.

notifications/cancelled

CancelledNotification

interface CancelledNotification {

  jsonrpc: "2.0";

  method: "notifications/cancelled";

  params: CancelledNotificationParams;

}

This notification is sent by the client to indicate that it is cancelling a request it previously issued.

On stdio, the server also sends this notification, solely to terminate a subscriptions/listen stream: it references the ID of the subscriptions/listen request that opened the stream. Servers MUST NOT use this notification to cancel any other request.

The request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished.

This notification indicates that the result will be unused, so any associated processing SHOULD cease.

jsonrpc: "2.0"

Inherited from JSONRPCNotification.jsonrpc

method: "notifications/cancelled"

Overrides JSONRPCNotification.method

params: CancelledNotificationParams

Overrides JSONRPCNotification.params

CancelledNotificationParams

interface CancelledNotificationParams {

  _meta?: NotificationMetaObject;

  requestId: RequestId;

  reason?: string;

}

Parameters for a notifications/cancelled notification.

_meta?: NotificationMetaObject

Inherited from NotificationParams._meta

requestId: RequestId

The ID of the request to cancel.

This MUST correspond to the ID of a request the client previously issued.

reason?: string

An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.

notifications/message

LoggingMessageNotification

interface LoggingMessageNotification {

  jsonrpc: "2.0";

  method: "notifications/message";

  params: LoggingMessageNotificationParams;

}

JSONRPCNotification of a log message passed from server to client. The client opts in by setting "io.modelcontextprotocol/logLevel" in a request's _meta.

Deprecated

Deprecated as of protocol version 2026-07-28 (SEP-2577). Remains in the specification for at least twelve months; see the deprecated features registry.

jsonrpc: "2.0"

Inherited from JSONRPCNotification.jsonrpc

method: "notifications/message"

Overrides JSONRPCNotification.method

params: LoggingMessageNotificationParams

Overrides JSONRPCNotification.params

LoggingMessageNotificationParams

interface LoggingMessageNotificationParams {

  _meta?: NotificationMetaObject;

  level: LoggingLevel;

  logger?: string;

  data: unknown;

}

Parameters for a notifications/message notification.

Deprecated

Deprecated as of protocol version 2026-07-28 (SEP-2577). Remains in the specification for at least twelve months; see the deprecated features registry.

_meta?: NotificationMetaObject

Inherited from NotificationParams._meta

level: LoggingLevel

The severity of this log message.

logger?: string

An optional name of the logger issuing this message.

data: unknown

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

notifications/progress

ProgressNotification

interface ProgressNotification {

  jsonrpc: "2.0";

  method: "notifications/progress";

  params: ProgressNotificationParams;

}

An out-of-band notification used to inform the receiver of a progress update for a long-running request.

jsonrpc: "2.0"

Inherited from JSONRPCNotification.jsonrpc

method: "notifications/progress"

Overrides JSONRPCNotification.method

params: ProgressNotificationParams

Overrides JSONRPCNotification.params

ProgressNotificationParams

interface ProgressNotificationParams {

  _meta?: NotificationMetaObject;

  progressToken: ProgressToken;

  progress: number;

  total?: number;

  message?: string;

}

Parameters for a notifications/progress notification.

_meta?: NotificationMetaObject

Inherited from NotificationParams._meta

progressToken: ProgressToken

The progress token which was given in the initial request, used to associate this notification with the request that is proceeding.

progress: number

The progress thus far. This should increase every time progress is made, even if the total is unknown.

total?: number

Total number of items to process (or total progress required), if known.

message?: string

An optional message describing the current progress.

notifications/prompts/list_changed

PromptListChangedNotification

interface PromptListChangedNotification {

  jsonrpc: "2.0";

  method: "notifications/prompts/list_changed";

  params?: NotificationParams;

}

An optional notification from the server to the client, informing it that the list of prompts it offers has changed. This is only delivered on a subscriptions/listen stream when the client requested it via the promptsListChanged filter field.

jsonrpc: "2.0"

Inherited from JSONRPCNotification.jsonrpc

method: "notifications/prompts/list_changed"

Overrides JSONRPCNotification.method

params?: NotificationParams

Overrides JSONRPCNotification.params

notifications/resources/list_changed

ResourceListChangedNotification

interface ResourceListChangedNotification {

  jsonrpc: "2.0";

  method: "notifications/resources/list_changed";

  params?: NotificationParams;

}

An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This is only delivered on a subscriptions/listen stream when the client requested it via the resourcesListChanged filter field.

jsonrpc: "2.0"

Inherited from JSONRPCNotification.jsonrpc

method: "notifications/resources/list_changed"

Overrides JSONRPCNotification.method

params?: NotificationParams

Overrides JSONRPCNotification.params

notifications/resources/updated

ResourceUpdatedNotification

interface ResourceUpdatedNotification {

  jsonrpc: "2.0";

  method: "notifications/resources/updated";

  params: ResourceUpdatedNotificationParams;

}

A notification from the server to the client, informing it that a resource has changed and may need to be read again. This is only sent for resources the client opted in to via the resourceSubscriptions field of a subscriptions/listen request.

jsonrpc: "2.0"

Inherited from JSONRPCNotification.jsonrpc

method: "notifications/resources/updated"

Overrides JSONRPCNotification.method

params: ResourceUpdatedNotificationParams

Overrides JSONRPCNotification.params

ResourceUpdatedNotificationParams

interface ResourceUpdatedNotificationParams {

  _meta?: NotificationMetaObject;

  uri: string;

}

Parameters for a notifications/resources/updated notification.

_meta?: NotificationMetaObject

Inherited from NotificationParams._meta

uri: string

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

notifications/subscriptions/acknowledged

SubscriptionsAcknowledgedNotification

interface SubscriptionsAcknowledgedNotification {

  jsonrpc: "2.0";

  method: "notifications/subscriptions/acknowledged";

  params: SubscriptionsAcknowledgedNotificationParams;

}

Sent by the server to acknowledge that a subscriptions/listen subscription has been established and to report which notification types it agreed to honor.

This notification MUST be the first message the server sends carrying the subscription's ID in io.modelcontextprotocol/subscriptionId. The server MUST NOT send any notification on the subscription before acknowledging it. On stdio, where every subscription shares one channel, this ordering is defined per subscription ID and not per channel: messages belonging to other subscriptions MAY be interleaved before it.

jsonrpc: "2.0"

Inherited from JSONRPCNotification.jsonrpc

method: "notifications/subscriptions/acknowledged"

Overrides JSONRPCNotification.method

params: SubscriptionsAcknowledgedNotificationParams

Overrides JSONRPCNotification.params

SubscriptionsAcknowledgedNotificationParams

interface SubscriptionsAcknowledgedNotificationParams {

  _meta?: NotificationMetaObject;

  notifications: SubscriptionFilter;

}

Parameters for a notifications/subscriptions/acknowledged notification.

_meta?: NotificationMetaObject

Inherited from NotificationParams._meta

notifications: SubscriptionFilter

The subset of requested notification types the server agreed to honor. Only includes notification types the server actually supports; if the client requested an unsupported type (e.g., promptsListChanged when the server has no prompts), it is omitted from this set.

notifications/tools/list_changed

ToolListChangedNotification

interface ToolListChangedNotification {

  jsonrpc: "2.0";

  method: "notifications/tools/list_changed";

  params?: NotificationParams;

}

An optional notification from the server to the client, informing it that the list of tools it offers has changed. This is only delivered on a subscriptions/listen stream when the client requested it via the toolsListChanged filter field.

jsonrpc: "2.0"

Inherited from JSONRPCNotification.jsonrpc

method: "notifications/tools/list_changed"

Overrides JSONRPCNotification.method

params?: NotificationParams

Overrides JSONRPCNotification.params

Multi Round-Trip

InputRequests

InputRequests: any

A map of server-initiated requests that the client must fulfill. Keys are server-assigned identifiers; values are the request objects.

InputRequiredResult

interface InputRequiredResult {

  _meta?: ResultMetaObject;

  resultType: string;

  inputRequests?: InputRequests;

  requestState?: string;

  [key: string]: unknown;

}

An InputRequiredResult sent by the server to indicate that additional input is needed before the request can be completed.

At least one of inputRequests or requestState MUST be present.

_meta?: ResultMetaObject

Inherited from Result._meta

resultType: string

Indicates the type of the result, which allows the client to determine how to parse the result object.

Servers implementing this protocol version MUST include this field. For backward compatibility, when a client receives a result from a server implementing an earlier protocol version (which does not include resultType), the client MUST treat the absent field as "complete".

Inherited from Result.resultType

inputRequests?: InputRequests
requestState?: string

InputResponses

InputResponses: any

A map of client responses to server-initiated requests. Keys correspond to the keys in the InputRequests map; values are the client's result for each request.

prompts/get

GetPromptRequest

interface GetPromptRequest {

  jsonrpc: "2.0";

  id: RequestId;

  method: "prompts/get";

  params: GetPromptRequestParams;

}

Used by the client to get a prompt provided by the server.

jsonrpc: "2.0"

Inherited from JSONRPCRequest.jsonrpc

id: RequestId

Inherited from JSONRPCRequest.id

method: "prompts/get"

Overrides JSONRPCRequest.method

params: GetPromptRequestParams

Overrides JSONRPCRequest.params

GetPromptRequestParams

interface GetPromptRequestParams {

  _meta: RequestMetaObject;

  inputResponses?: InputResponses;

  requestState?: string;

  name: string;

  arguments?: { [key: string]: string };

}

Parameters for a prompts/get request.

_meta: RequestMetaObject

Inherited from InputResponseRequestParams._meta

inputResponses?: InputResponses

Inherited from InputResponseRequestParams.inputResponses

requestState?: string

Inherited from InputResponseRequestParams.requestState

name: string

The name of the prompt or prompt template.

arguments?: { [key: string]: string }

Arguments to use for templating the prompt.

GetPromptResultResponse

interface GetPromptResultResponse {

  jsonrpc: "2.0";

  id: RequestId;

  result: InputRequiredResult | GetPromptResult;

}

A successful response from the server for a prompts/get request.

jsonrpc: "2.0"

Inherited from JSONRPCResultResponse.jsonrpc

id: RequestId

Inherited from JSONRPCResultResponse.id

result: InputRequiredResult | GetPromptResult

Overrides JSONRPCResultResponse.result

GetPromptResult

interface GetPromptResult {

  _meta?: ResultMetaObject;

  resultType: string;

  description?: string;

  messages: PromptMessage[];

  [key: string]: unknown;

}

The result returned by the server for a prompts/get request.

_meta?: ResultMetaObject

Inherited from Result._meta

resultType: string

Indicates the type of the result, which allows the client to determine how to parse the result object.

Servers implementing this protocol version MUST include this field. For backward compatibility, when a client receives a result from a server implementing an earlier protocol version (which does not include resultType), the client MUST treat the absent field as "complete".

Inherited from Result.resultType

description?: string

An optional description for the prompt.

messages: PromptMessage[]

PromptMessage

interface PromptMessage {

  role: Role;

  content: ContentBlock;

}

Describes a message returned as part of a prompt.

This is similar to SamplingMessage, but also supports the embedding of resources from the MCP server.

role: Role
content: ContentBlock

prompts/list

ListPromptsRequest

interface ListPromptsRequest {

  jsonrpc: "2.0";

  id: RequestId;

  params: PaginatedRequestParams;

  method: "prompts/list";

}

Sent from the client to request a list of prompts and prompt templates the server has.

jsonrpc: "2.0"

Inherited from PaginatedRequest.jsonrpc

id: RequestId

Inherited from PaginatedRequest.id

params: PaginatedRequestParams

Inherited from PaginatedRequest.params

method: "prompts/list"

Overrides PaginatedRequest.method

ListPromptsResultResponse

interface ListPromptsResultResponse {

  jsonrpc: "2.0";

  id: RequestId;

  result: ListPromptsResult;

}

A successful response from the server for a prompts/list request.

jsonrpc: "2.0"

Inherited from JSONRPCResultResponse.jsonrpc

id: RequestId

Inherited from JSONRPCResultResponse.id

result: ListPromptsResult

Overrides JSONRPCResultResponse.result

ListPromptsResult

interface ListPromptsResult {

  _meta?: ResultMetaObject;

  resultType: string;

  nextCursor?: string;

  ttlMs: number;

  cacheScope: "public" | "private";

  prompts: Prompt[];

  [key: string]: unknown;

}

The result returned by the server for a prompts/list request.

_meta?: ResultMetaObject

Inherited from PaginatedResult._meta

resultType: string

Indicates the type of the result, which allows the client to determine how to parse the result object.

Servers implementing this protocol version MUST include this field. For backward compatibility, when a client receives a result from a server implementing an earlier protocol version (which does not include resultType), the client MUST treat the absent field as "complete".

Inherited from PaginatedResult.resultType

nextCursor?: string

An opaque token representing the pagination position after the last returned result. If present, there may be more results available.

Inherited from PaginatedResult.nextCursor

ttlMs: number

A hint from the server indicating how long (in milliseconds) the client MAY cache this response before re-fetching. Semantics are analogous to HTTP Cache-Control max-age.

  • If 0, The response SHOULD be considered immediately stale, The client MAY re-fetch every time the result is needed.
  • If positive, the client SHOULD consider the result fresh for this many milliseconds after receiving the response.

Inherited from CacheableResult.ttlMs

cacheScope: "public" | "private"

Indicates the intended scope of the cached response, analogous to HTTP Cache-Control: public vs Cache-Control: private.

  • "public": The response does not contain user-specific data. Any client or intermediary (e.g., shared gateway, caching proxy) MAY cache the response and serve it across authorization contexts.
  • "private": The response MAY be cached and reused only within the same authorization context. Caches MUST NOT be shared across authorization contexts (e.g., a different access token requires a different cache).

Inherited from CacheableResult.cacheScope

prompts: Prompt[]

Prompt

interface Prompt {

  icons?: Icon[];

  name: string;

  title?: string;

  description?: string;

  arguments?: PromptArgument[];

  _meta?: MetaObject;

}

A prompt or prompt template that the server offers.

icons?: Icon[]

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)

Inherited from Icons.icons

name: string

Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).

Inherited from BaseMetadata.name

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

Inherited from BaseMetadata.title

description?: string

An optional description of what this prompt provides

arguments?: PromptArgument[]

A list of arguments to use for templating the prompt.

_meta?: MetaObject

PromptArgument

interface PromptArgument {

  name: string;

  title?: string;

  description?: string;

  required?: boolean;

}

Describes an argument that a prompt can accept.

name: string

Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).

Inherited from BaseMetadata.name

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

Inherited from BaseMetadata.title

description?: string

A human-readable description of the argument.

required?: boolean

Whether this argument must be provided.

resources/list

ListResourcesRequest

interface ListResourcesRequest {

  jsonrpc: "2.0";

  id: RequestId;

  params: PaginatedRequestParams;

  method: "resources/list";

}

Sent from the client to request a list of resources the server has.

jsonrpc: "2.0"

Inherited from PaginatedRequest.jsonrpc

id: RequestId

Inherited from PaginatedRequest.id

params: PaginatedRequestParams

Inherited from PaginatedRequest.params

method: "resources/list"

Overrides PaginatedRequest.method

ListResourcesResultResponse

interface ListResourcesResultResponse {

  jsonrpc: "2.0";

  id: RequestId;

  result: ListResourcesResult;

}

A successful response from the server for a resources/list request.

jsonrpc: "2.0"

Inherited from JSONRPCResultResponse.jsonrpc

id: RequestId

Inherited from JSONRPCResultResponse.id

result: ListResourcesResult

Overrides JSONRPCResultResponse.result

ListResourcesResult

interface ListResourcesResult {

  _meta?: ResultMetaObject;

  resultType: string;

  nextCursor?: string;

  ttlMs: number;

  cacheScope: "public" | "private";

  resources: Resource[];

  [key: string]: unknown;

}

The result returned by the server for a resources/list request.

_meta?: ResultMetaObject

Inherited from PaginatedResult._meta

resultType: string

Indicates the type of the result, which allows the client to determine how to parse the result object.

Servers implementing this protocol version MUST include this field. For backward compatibility, when a client receives a result from a server implementing an earlier protocol version (which does not include resultType), the client MUST treat the absent field as "complete".

Inherited from PaginatedResult.resultType

nextCursor?: string

An opaque token representing the pagination position after the last returned result. If present, there may be more results available.

Inherited from PaginatedResult.nextCursor

ttlMs: number

A hint from the server indicating how long (in milliseconds) the client MAY cache this response before re-fetching. Semantics are analogous to HTTP Cache-Control max-age.

  • If 0, The response SHOULD be considered immediately stale, The client MAY re-fetch every time the result is needed.
  • If positive, the client SHOULD consider the result fresh for this many milliseconds after receiving the response.

Inherited from CacheableResult.ttlMs

cacheScope: "public" | "private"

Indicates the intended scope of the cached response, analogous to HTTP Cache-Control: public vs Cache-Control: private.

  • "public": The response does not contain user-specific data. Any client or intermediary (e.g., shared gateway, caching proxy) MAY cache the response and serve it across authorization contexts.
  • "private": The response MAY be cached and reused only within the same authorization context. Caches MUST NOT be shared across authorization contexts (e.g., a different access token requires a different cache).

Inherited from CacheableResult.cacheScope

resources: Resource[]

Resource

interface Resource {

  icons?: Icon[];

  name: string;

  title?: string;

  uri: string;

  description?: string;

  mimeType?: string;

  annotations?: Annotations;

  size?: number;

  _meta?: MetaObject;

}

A known resource that the server is capable of reading.

icons?: Icon[]

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)

Inherited from Icons.icons

name: string

Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).

Inherited from BaseMetadata.name

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

Inherited from BaseMetadata.title

uri: string

The URI of this resource.

description?: string

A description of what this resource represents.

This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.

mimeType?: string

The MIME type of this resource, if known.

annotations?: Annotations

Optional annotations for the client.

size?: number

The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known.

This can be used by Hosts to display file sizes and estimate context window usage.

_meta?: MetaObject

resources/read

ReadResourceRequest

interface ReadResourceRequest {

  jsonrpc: "2.0";

  id: RequestId;

  method: "resources/read";

  params: ReadResourceRequestParams;

}

Sent from the client to the server, to read a specific resource URI.

jsonrpc: "2.0"

Inherited from JSONRPCRequest.jsonrpc

id: RequestId

Inherited from JSONRPCRequest.id

method: "resources/read"

Overrides JSONRPCRequest.method

params: ReadResourceRequestParams

Overrides JSONRPCRequest.params

ReadResourceRequestParams

interface ReadResourceRequestParams {

  _meta: RequestMetaObject;

  inputResponses?: InputResponses;

  requestState?: string;

  uri: string;

}

Parameters for a resources/read request.

_meta: RequestMetaObject

Inherited from InputResponseRequestParams._meta

inputResponses?: InputResponses

Inherited from InputResponseRequestParams.inputResponses

requestState?: string

Inherited from InputResponseRequestParams.requestState

uri: string

The URI of the resource. The URI can use any protocol; it is up to the server how to interpret it.

Inherited from ResourceRequestParams.uri

ReadResourceResultResponse

interface ReadResourceResultResponse {

  jsonrpc: "2.0";

  id: RequestId;

  result: InputRequiredResult | ReadResourceResult;

}

A successful response from the server for a resources/read request.

jsonrpc: "2.0"

Inherited from JSONRPCResultResponse.jsonrpc

id: RequestId

Inherited from JSONRPCResultResponse.id

result: InputRequiredResult | ReadResourceResult

Overrides JSONRPCResultResponse.result

ReadResourceResult

interface ReadResourceResult {

  _meta?: ResultMetaObject;

  resultType: string;

  ttlMs: number;

  cacheScope: "public" | "private";

  contents: (TextResourceContents | BlobResourceContents)[];

  [key: string]: unknown;

}

The result returned by the server for a resources/read request.

_meta?: ResultMetaObject

Inherited from CacheableResult._meta

resultType: string

Indicates the type of the result, which allows the client to determine how to parse the result object.

Servers implementing this protocol version MUST include this field. For backward compatibility, when a client receives a result from a server implementing an earlier protocol version (which does not include resultType), the client MUST treat the absent field as "complete".

Inherited from CacheableResult.resultType

ttlMs: number

A hint from the server indicating how long (in milliseconds) the client MAY cache this response before re-fetching. Semantics are analogous to HTTP Cache-Control max-age.

  • If 0, The response SHOULD be considered immediately stale, The client MAY re-fetch every time the result is needed.
  • If positive, the client SHOULD consider the result fresh for this many milliseconds after receiving the response.

Inherited from CacheableResult.ttlMs

cacheScope: "public" | "private"

Indicates the intended scope of the cached response, analogous to HTTP Cache-Control: public vs Cache-Control: private.

  • "public": The response does not contain user-specific data. Any client or intermediary (e.g., shared gateway, caching proxy) MAY cache the response and serve it across authorization contexts.
  • "private": The response MAY be cached and reused only within the same authorization context. Caches MUST NOT be shared across authorization contexts (e.g., a different access token requires a different cache).

Inherited from CacheableResult.cacheScope

contents: (TextResourceContents | BlobResourceContents)[]

resources/templates/list

ListResourceTemplatesRequest

interface ListResourceTemplatesRequest {

  jsonrpc: "2.0";

  id: RequestId;

  params: PaginatedRequestParams;

  method: "resources/templates/list";

}

Sent from the client to request a list of resource templates the server has.

jsonrpc: "2.0"

Inherited from PaginatedRequest.jsonrpc

id: RequestId

Inherited from PaginatedRequest.id

params: PaginatedRequestParams

Inherited from PaginatedRequest.params

method: "resources/templates/list"

Overrides PaginatedRequest.method

ListResourceTemplatesResultResponse

interface ListResourceTemplatesResultResponse {

  jsonrpc: "2.0";

  id: RequestId;

  result: ListResourceTemplatesResult;

}

A successful response from the server for a resources/templates/list request.

jsonrpc: "2.0"

Inherited from JSONRPCResultResponse.jsonrpc

id: RequestId

Inherited from JSONRPCResultResponse.id

result: ListResourceTemplatesResult

Overrides JSONRPCResultResponse.result

ListResourceTemplatesResult

interface ListResourceTemplatesResult {

  _meta?: ResultMetaObject;

  resultType: string;

  nextCursor?: string;

  ttlMs: number;

  cacheScope: "public" | "private";

  resourceTemplates: ResourceTemplate[];

  [key: string]: unknown;

}

The result returned by the server for a resources/templates/list request.

_meta?: ResultMetaObject

Inherited from PaginatedResult._meta

resultType: string

Indicates the type of the result, which allows the client to determine how to parse the result object.

Servers implementing this protocol version MUST include this field. For backward compatibility, when a client receives a result from a server implementing an earlier protocol version (which does not include resultType), the client MUST treat the absent field as "complete".

Inherited from PaginatedResult.resultType

nextCursor?: string

An opaque token representing the pagination position after the last returned result. If present, there may be more results available.

Inherited from PaginatedResult.nextCursor

ttlMs: number

A hint from the server indicating how long (in milliseconds) the client MAY cache this response before re-fetching. Semantics are analogous to HTTP Cache-Control max-age.

  • If 0, The response SHOULD be considered immediately stale, The client MAY re-fetch every time the result is needed.
  • If positive, the client SHOULD consider the result fresh for this many milliseconds after receiving the response.

Inherited from CacheableResult.ttlMs

cacheScope: "public" | "private"

Indicates the intended scope of the cached response, analogous to HTTP Cache-Control: public vs Cache-Control: private.

  • "public": The response does not contain user-specific data. Any client or intermediary (e.g., shared gateway, caching proxy) MAY cache the response and serve it across authorization contexts.
  • "private": The response MAY be cached and reused only within the same authorization context. Caches MUST NOT be shared across authorization contexts (e.g., a different access token requires a different cache).

Inherited from CacheableResult.cacheScope

resourceTemplates: ResourceTemplate[]

ResourceTemplate

interface ResourceTemplate {

  icons?: Icon[];

  name: string;

  title?: string;

  uriTemplate: string;

  description?: string;

  mimeType?: string;

  annotations?: Annotations;

  _meta?: MetaObject;

}

A template description for resources available on the server.

icons?: Icon[]

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)

Inherited from Icons.icons

name: string

Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).

Inherited from BaseMetadata.name

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

Inherited from BaseMetadata.title

uriTemplate: string

A URI template (according to RFC 6570) that can be used to construct resource URIs.

description?: string

A description of what this template is for.

This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.

mimeType?: string

The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type.

annotations?: Annotations

Optional annotations for the client.

_meta?: MetaObject

roots/list

ListRootsRequest

interface ListRootsRequest {

  method: "roots/list";

  params?: { _meta?: MetaObject };

}

Sent from the server to request a list of root URIs from the client. Roots allow servers to ask for specific directories or files to operate on. A common example for roots is providing a set of repositories or directories a server should operate on.

This request is typically used when the server needs to understand the file system structure or access specific locations that the client has permission to read from.

Deprecated

Deprecated as of protocol version 2026-07-28 (SEP-2577). Remains in the specification for at least twelve months; see the deprecated features registry.

method: "roots/list"
params?: { _meta?: MetaObject }

ListRootsResult

interface ListRootsResult {

  roots: Root[];

}

The result returned by the client for a roots/list request. This result contains an array of Root objects, each representing a root directory or file that the server can operate on.

Deprecated

Deprecated as of protocol version 2026-07-28 (SEP-2577). Remains in the specification for at least twelve months; see the deprecated features registry.

roots: Root[]

Root

interface Root {

  uri: string;

  name?: string;

  _meta?: MetaObject;

}

Represents a root directory or file that the server can operate on.

Deprecated

Deprecated as of protocol version 2026-07-28 (SEP-2577). Remains in the specification for at least twelve months; see the deprecated features registry.

uri: string

The URI identifying the root. This must start with file:// for now. This restriction may be relaxed in future versions of the protocol to allow other URI schemes.

name?: string

An optional name for the root. This can be used to provide a human-readable identifier for the root, which may be useful for display purposes or for referencing the root in other parts of the application.

_meta?: MetaObject

sampling/createMessage

CreateMessageRequest

interface CreateMessageRequest {

  method: "sampling/createMessage";

  params: CreateMessageRequestParams;

}

A request from the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it.

Deprecated

Deprecated as of protocol version 2026-07-28 (SEP-2577). Remains in the specification for at least twelve months; see the deprecated features registry.

method: "sampling/createMessage"
params: CreateMessageRequestParams

CreateMessageRequestParams

interface CreateMessageRequestParams {

  messages: SamplingMessage[];

  modelPreferences?: ModelPreferences;

  systemPrompt?: string;

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

  temperature?: number;

  maxTokens: number;

  stopSequences?: string[];

  metadata?: JSONObject;

  tools?: Tool[];

  toolChoice?: ToolChoice;

}

Parameters for a sampling/createMessage request.

Deprecated

Deprecated as of protocol version 2026-07-28 (SEP-2577). Remains in the specification for at least twelve months; see the deprecated features registry.

messages: SamplingMessage[]
modelPreferences?: ModelPreferences

The server's preferences for which model to select. The client MAY ignore these preferences.

systemPrompt?: string

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

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

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

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

Deprecated

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

temperature?: number
maxTokens: number

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

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

stopSequences?: string[]
metadata?: JSONObject

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

tools?: Tool[]

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.

toolChoice?: ToolChoice

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

CreateMessageResult

interface CreateMessageResult {

  model: string;

  stopReason?: string;

  role: Role;

  content: SamplingMessageContentBlock | SamplingMessageContentBlock[];

  _meta?: MetaObject;

}

The result returned by the client for a sampling/createMessage request. The client should inform the user before returning the sampled message, to allow them to inspect the response (human in the loop) and decide whether to allow the server to see it.

Deprecated

Deprecated as of protocol version 2026-07-28 (SEP-2577). Remains in the specification for at least twelve months; see the deprecated features registry.

model: string

The name of the model that generated the message.

stopReason?: string

The reason why sampling stopped, if known.

Standard values:

  • "endTurn": Natural end of the assistant's turn
  • "stopSequence": A stop sequence was encountered
  • "maxTokens": Maximum token limit was reached
  • "toolUse": The model wants to use one or more tools

This field is an open string to allow for provider-specific stop reasons.

role: Role

Inherited from SamplingMessage.role

content: SamplingMessageContentBlock | SamplingMessageContentBlock[]

Inherited from SamplingMessage.content

_meta?: MetaObject

Inherited from SamplingMessage._meta

ModelHint

interface ModelHint {

  name?: string;

}

Hints to use for model selection.

Keys not declared here are currently left unspecified by the spec and are up to the client to interpret.

Deprecated

Deprecated as of protocol version 2026-07-28 (SEP-2577). Remains in the specification for at least twelve months; see the deprecated features registry.

name?: string

A hint for a model name.

The client SHOULD treat this as a substring of a model name; for example:

  • claude-3-5-sonnet should match claude-3-5-sonnet-20241022
  • sonnet should match claude-3-5-sonnet-20241022, claude-3-sonnet-20240229, etc.
  • claude should match any Claude model

The client MAY also map the string to a different provider's model name or a different model family, as long as it fills a similar niche; for example:

  • gemini-1.5-flash could match claude-3-haiku-20240307

ModelPreferences

interface ModelPreferences {

  hints?: ModelHint[];

  costPriority?: number;

  speedPriority?: number;

  intelligencePriority?: number;

}

The server's preferences for model selection, requested of the client during sampling.

Because LLMs can vary along multiple dimensions, choosing the "best" model is rarely straightforward. Different models excel in different areas—some are faster but less capable, others are more capable but more expensive, and so on. This interface allows servers to express their priorities across multiple dimensions to help clients make an appropriate selection for their use case.

These preferences are always advisory. The client MAY ignore them. It is also up to the client to decide how to interpret these preferences and how to balance them against other considerations.

Deprecated

Deprecated as of protocol version 2026-07-28 (SEP-2577). Remains in the specification for at least twelve months; see the deprecated features registry.

hints?: ModelHint[]

Optional hints to use for model selection.

If multiple hints are specified, the client MUST evaluate them in order (such that the first match is taken).

The client SHOULD prioritize these hints over the numeric priorities, but MAY still use the priorities to select from ambiguous matches.

costPriority?: number

How much to prioritize cost when selecting a model. A value of 0 means cost is not important, while a value of 1 means cost is the most important factor.

speedPriority?: number

How much to prioritize sampling speed (latency) when selecting a model. A value of 0 means speed is not important, while a value of 1 means speed is the most important factor.

intelligencePriority?: number

How much to prioritize intelligence and capabilities when selecting a model. A value of 0 means intelligence is not important, while a value of 1 means intelligence is the most important factor.

SamplingMessage

Describes a message issued to or received from an LLM API.

Deprecated

Deprecated as of protocol version 2026-07-28 (SEP-2577). Remains in the specification for at least twelve months; see the deprecated features registry.

role: Role
content: SamplingMessageContentBlock | SamplingMessageContentBlock[]
_meta?: MetaObject

SamplingMessageContentBlock

SamplingMessageContentBlock:

  | TextContent

  | ImageContent

  | AudioContent

  | ToolUseContent

  | ToolResultContent
Deprecated

Deprecated as of protocol version 2026-07-28 (SEP-2577). Remains in the specification for at least twelve months; see the deprecated features registry.

ToolChoice

interface ToolChoice {

  mode?: "none" | "required" | "auto";

}

Controls tool selection behavior for sampling requests.

Deprecated

Deprecated as of protocol version 2026-07-28 (SEP-2577). Remains in the specification for at least twelve months; see the deprecated features registry.

mode?: "none" | "required" | "auto"

Controls the tool use ability of the model:

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

ToolResultContent

interface ToolResultContent {

  type: "tool_result";

  toolUseId: string;

  content: ContentBlock[];

  structuredContent?: unknown;

  isError?: boolean;

  _meta?: MetaObject;

}

The result of a tool use, provided by the user back to the assistant.

Deprecated

Deprecated as of protocol version 2026-07-28 (SEP-2577). Remains in the specification for at least twelve months; see the deprecated features registry.

type: "tool_result"
toolUseId: string

The ID of the tool use this result corresponds to.

This MUST match the ID from a previous ToolUseContent.

content: ContentBlock[]

The unstructured result content of the tool use.

This has the same format as CallToolResult.content and can include text, images, audio, resource links, and embedded resources.

structuredContent?: unknown

An optional structured result value.

This can be any JSON value (object, array, string, number, boolean, or null). If the tool defined an Tool.outputSchema, this SHOULD conform to that schema.

isError?: boolean

Whether the tool use resulted in an error.

If true, the content typically describes the error that occurred. Default: false

_meta?: MetaObject

Optional metadata about the tool result. Clients SHOULD preserve this field when including tool results in subsequent sampling requests to enable caching optimizations.

ToolUseContent

interface ToolUseContent {

  type: "tool_use";

  id: string;

  name: string;

  input: { [key: string]: unknown };

  _meta?: MetaObject;

}

A request from the assistant to call a tool.

Deprecated

Deprecated as of protocol version 2026-07-28 (SEP-2577). Remains in the specification for at least twelve months; see the deprecated features registry.

type: "tool_use"
id: string

A unique identifier for this tool use.

This ID is used to match tool results to their corresponding tool uses.

name: string

The name of the tool to call.

input: { [key: string]: unknown }

The arguments to pass to the tool, conforming to the tool's input schema.

_meta?: MetaObject

Optional metadata about the tool use. Clients SHOULD preserve this field when including tool uses in subsequent sampling requests to enable caching optimizations.

server/discover

DiscoverRequest

interface DiscoverRequest {

  jsonrpc: "2.0";

  id: RequestId;

  method: "server/discover";

  params: RequestParams;

}

A request from the client asking the server to advertise its supported protocol versions, capabilities, and other metadata. Servers MUST implement server/discover. Clients MAY call it but are not required to — version negotiation can also happen inline via per-request _meta.

jsonrpc: "2.0"

Inherited from JSONRPCRequest.jsonrpc

id: RequestId

Inherited from JSONRPCRequest.id

method: "server/discover"

Overrides JSONRPCRequest.method

params: RequestParams

Overrides JSONRPCRequest.params

DiscoverResultResponse

interface DiscoverResultResponse {

  jsonrpc: "2.0";

  id: RequestId;

  result: DiscoverResult;

}

A successful response from the server for a server/discover request.

jsonrpc: "2.0"

Inherited from JSONRPCResultResponse.jsonrpc

id: RequestId

Inherited from JSONRPCResultResponse.id

result: DiscoverResult

Overrides JSONRPCResultResponse.result

DiscoverResult

interface DiscoverResult {

  _meta?: ResultMetaObject;

  resultType: string;

  supportedVersions: string[];

  capabilities: ServerCapabilities;

  instructions?: string;

  ttlMs: number;

  cacheScope: "public" | "private";

  [key: string]: unknown;

}

The result returned by the server for a server/discover request.

_meta?: ResultMetaObject

Inherited from CacheableResult._meta

resultType: string

Indicates the type of the result, which allows the client to determine how to parse the result object.

Servers implementing this protocol version MUST include this field. For backward compatibility, when a client receives a result from a server implementing an earlier protocol version (which does not include resultType), the client MUST treat the absent field as "complete".

Inherited from CacheableResult.resultType

supportedVersions: string[]

MCP Protocol Versions this server supports. The client should choose a version from this list for use in subsequent requests.

capabilities: ServerCapabilities

The capabilities of the server.

instructions?: string

Natural-language guidance describing the server and its features.

This can be used by clients to improve an LLM's understanding of available tools (e.g., by including it in a system prompt). It should focus on information that helps the model use the server effectively and should not duplicate information already in tool descriptions.

ttlMs: number

A hint from the server indicating how long (in milliseconds) the client MAY cache this response before re-fetching. Semantics are analogous to HTTP Cache-Control max-age.

  • If 0, The response SHOULD be considered immediately stale, The client MAY re-fetch every time the result is needed.
  • If positive, the client SHOULD consider the result fresh for this many milliseconds after receiving the response.

Inherited from CacheableResult.ttlMs

cacheScope: "public" | "private"

Indicates the intended scope of the cached response, analogous to HTTP Cache-Control: public vs Cache-Control: private.

  • "public": The response does not contain user-specific data. Any client or intermediary (e.g., shared gateway, caching proxy) MAY cache the response and serve it across authorization contexts.
  • "private": The response MAY be cached and reused only within the same authorization context. Caches MUST NOT be shared across authorization contexts (e.g., a different access token requires a different cache).

Inherited from CacheableResult.cacheScope

ClientCapabilities

interface ClientCapabilities {

  experimental?: { [key: string]: JSONObject };

  roots?: {};

  sampling?: { context?: JSONObject; tools?: JSONObject };

  elicitation?: { form?: JSONObject; url?: JSONObject };

  extensions?: { [key: string]: JSONObject };

}

Capabilities a client may support. Known capabilities are defined here, in this schema, but this is not a closed set: any client can define its own, additional capabilities.

experimental?: { [key: string]: JSONObject }

Experimental, non-standard capabilities that the client supports.

roots?: {}

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; see the deprecated features registry.

sampling?: { context?: JSONObject; tools?: JSONObject }

Present if the client supports sampling from an LLM.

Type Declaration
  • Optionalcontext?: JSONObject

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

  • Optionaltools?: JSONObject

    Whether the client supports tool use via tools and toolChoice parameters.

Deprecated

Deprecated as of protocol version 2026-07-28 (SEP-2577). Remains in the specification for at least twelve months; see the deprecated features registry.

elicitation?: { form?: JSONObject; url?: JSONObject }

Present if the client supports elicitation from the server.

extensions?: { [key: string]: JSONObject }

Optional MCP extensions that the client supports. Keys are extension identifiers (e.g., "io.modelcontextprotocol/oauth-client-credentials"), and values are per-extension settings objects. An empty object indicates support with no settings.

Keys MUST follow the _meta key naming rules, with a mandatory prefix.

Implementation

interface Implementation {

  icons?: Icon[];

  name: string;

  title?: string;

  version: string;

  description?: string;

  websiteUrl?: string;

}

Describes the MCP implementation.

icons?: Icon[]

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)

Inherited from Icons.icons

name: string

Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).

Inherited from BaseMetadata.name

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

Inherited from BaseMetadata.title

version: string

The version of this implementation.

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.

websiteUrl?: string

An optional URL of the website for this implementation.

ServerCapabilities

interface ServerCapabilities {

  experimental?: { [key: string]: JSONObject };

  logging?: JSONObject;

  completions?: JSONObject;

  prompts?: { listChanged?: boolean };

  resources?: { subscribe?: boolean; listChanged?: boolean };

  tools?: { listChanged?: boolean };

  extensions?: { [key: string]: JSONObject };

}

Capabilities that a server may support. Known capabilities are defined here, in this schema, but this is not a closed set: any server can define its own, additional capabilities.

experimental?: { [key: string]: JSONObject }

Experimental, non-standard capabilities that the server supports.

logging?: JSONObject

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; see the deprecated features registry.

completions?: JSONObject

Present if the server supports argument autocompletion suggestions.

prompts?: { listChanged?: boolean }

Present if the server offers any prompt templates.

Type Declaration
  • OptionallistChanged?: boolean

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

resources?: { subscribe?: boolean; listChanged?: boolean }

Present if the server offers any resources to read.

Type Declaration
  • Optionalsubscribe?: boolean

    Whether this server supports subscribing to resource updates.

  • OptionallistChanged?: boolean

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

tools?: { listChanged?: boolean }

Present if the server offers any tools to call.

Type Declaration
  • OptionallistChanged?: boolean

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

extensions?: { [key: string]: JSONObject }

Optional MCP extensions that the server supports. Keys are extension identifiers (e.g., "io.modelcontextprotocol/tasks"), and values are per-extension settings objects. An empty object indicates support with no settings.

Keys MUST follow the _meta key naming rules, with a mandatory prefix.

subscriptions/listen

SubscriptionsListenRequest

interface SubscriptionsListenRequest {

  jsonrpc: "2.0";

  id: RequestId;

  method: "subscriptions/listen";

  params: SubscriptionsListenRequestParams;

}

Sent from the client to open a long-lived channel for receiving notifications outside the context of a specific request. Replaces the previous HTTP GET endpoint and ensures consistent behavior between HTTP and STDIO.

jsonrpc: "2.0"

Inherited from JSONRPCRequest.jsonrpc

id: RequestId

Inherited from JSONRPCRequest.id

method: "subscriptions/listen"

Overrides JSONRPCRequest.method

params: SubscriptionsListenRequestParams

Overrides JSONRPCRequest.params

SubscriptionsListenRequestParams

interface SubscriptionsListenRequestParams {

  _meta: RequestMetaObject;

  notifications: SubscriptionFilter;

}

Parameters for a subscriptions/listen request.

_meta: RequestMetaObject

Inherited from RequestParams._meta

notifications: SubscriptionFilter

The notifications the client opts in to on this stream. The server MUST NOT send notification types the client has not explicitly requested.

SubscriptionsListenResultResponse

interface SubscriptionsListenResultResponse {

  jsonrpc: "2.0";

  id: RequestId;

  result: SubscriptionsListenResult;

}

A successful response from the server for a subscriptions/listen request, sent when the server tears the subscription down gracefully.

jsonrpc: "2.0"

Inherited from JSONRPCResultResponse.jsonrpc

id: RequestId

Inherited from JSONRPCResultResponse.id

result: SubscriptionsListenResult

Overrides JSONRPCResultResponse.result

SubscriptionsListenResult

interface SubscriptionsListenResult {

  resultType: string;

  _meta: SubscriptionsListenResultMetaObject;

  [key: string]: unknown;

}

The response to a subscriptions/listen request, signalling that the subscription has ended gracefully (for example, during server shutdown). Because the listen stream is long-lived, this result is sent only when the server tears the subscription down; an abrupt transport close carries no response. The result body is otherwise empty.

resultType: string

Indicates the type of the result, which allows the client to determine how to parse the result object.

Servers implementing this protocol version MUST include this field. For backward compatibility, when a client receives a result from a server implementing an earlier protocol version (which does not include resultType), the client MUST treat the absent field as "complete".

Inherited from Result.resultType

_meta: SubscriptionsListenResultMetaObject

Overrides Result._meta

SubscriptionFilter

interface SubscriptionFilter {

  toolsListChanged?: boolean;

  promptsListChanged?: boolean;

  resourcesListChanged?: boolean;

  resourceSubscriptions?: string[];

}

The set of notification types a client may opt in to on a subscriptions/listen request.

Each notification type is opt-in; the server MUST NOT send notification types the client has not explicitly requested here.

toolsListChanged?: boolean
promptsListChanged?: boolean
resourcesListChanged?: boolean
resourceSubscriptions?: string[]

Subscribe to notifications/resources/updated for these resource URIs. Replaces the former resources/subscribe RPC.

SubscriptionsListenResultMetaObject

interface SubscriptionsListenResultMetaObject {

  "io.modelcontextprotocol/serverInfo"?: Implementation;

  "io.modelcontextprotocol/subscriptionId": RequestId;

  [key: string]: unknown;

}

Extends ResultMetaObject with the subscription-stream identifier carried by a SubscriptionsListenResult. All key naming rules from MetaObject apply.

See

MetaObject for key naming rules and reserved prefixes.

"io.modelcontextprotocol/serverInfo"?: Implementation

Identifies the server software producing the response. Servers SHOULD include this field on every response unless specifically configured not to do so.

The Implementation schema requires name and version; other fields are optional.

The value is self-reported by the server and is not verified by the protocol. It is intended for display, logging, and debugging. Clients SHOULD NOT use it to change their behavior, and SHOULD NOT rely on it for security decisions.

Inherited from ResultMetaObject.io.modelcontextprotocol/serverInfo

"io.modelcontextprotocol/subscriptionId": RequestId

Identifies the subscription stream this response closes, so the client can correlate it with the originating subscription — mirroring the same key on the stream's notifications. The value is the JSON-RPC ID of the subscriptions/listen request that opened the stream (and equals this response's id).

tools/call

CallToolRequest

interface CallToolRequest {

  jsonrpc: "2.0";

  id: RequestId;

  method: "tools/call";

  params: CallToolRequestParams;

}

Used by the client to invoke a tool provided by the server.

jsonrpc: "2.0"

Inherited from JSONRPCRequest.jsonrpc

id: RequestId

Inherited from JSONRPCRequest.id

method: "tools/call"

Overrides JSONRPCRequest.method

params: CallToolRequestParams

Overrides JSONRPCRequest.params

CallToolRequestParams

interface CallToolRequestParams {

  _meta: RequestMetaObject;

  inputResponses?: InputResponses;

  requestState?: string;

  name: string;

  arguments?: { [key: string]: unknown };

}

Parameters for a tools/call request.

_meta: RequestMetaObject

Inherited from InputResponseRequestParams._meta

inputResponses?: InputResponses

Inherited from InputResponseRequestParams.inputResponses

requestState?: string

Inherited from InputResponseRequestParams.requestState

name: string

The name of the tool.

arguments?: { [key: string]: unknown }

Arguments to use for the tool call.

CallToolResultResponse

interface CallToolResultResponse {

  jsonrpc: "2.0";

  id: RequestId;

  result: InputRequiredResult | CallToolResult;

}

A successful response from the server for a tools/call request.

jsonrpc: "2.0"

Inherited from JSONRPCResultResponse.jsonrpc

id: RequestId

Inherited from JSONRPCResultResponse.id

result: InputRequiredResult | CallToolResult

Overrides JSONRPCResultResponse.result

CallToolResult

interface CallToolResult {

  _meta?: ResultMetaObject;

  resultType: string;

  content: ContentBlock[];

  structuredContent?: unknown;

  isError?: boolean;

  [key: string]: unknown;

}

The result returned by the server for a tools/call request.

_meta?: ResultMetaObject

Inherited from Result._meta

resultType: string

Indicates the type of the result, which allows the client to determine how to parse the result object.

Servers implementing this protocol version MUST include this field. For backward compatibility, when a client receives a result from a server implementing an earlier protocol version (which does not include resultType), the client MUST treat the absent field as "complete".

Inherited from Result.resultType

content: ContentBlock[]

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

structuredContent?: unknown

An optional JSON value that represents the structured result of the tool call.

This can be any JSON value (object, array, string, number, boolean, or null) that conforms to the tool's outputSchema if one is defined.

isError?: boolean

Whether the tool call ended in an error.

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

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

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

tools/list

ListToolsRequest

interface ListToolsRequest {

  jsonrpc: "2.0";

  id: RequestId;

  params: PaginatedRequestParams;

  method: "tools/list";

}

Sent from the client to request a list of tools the server has.

jsonrpc: "2.0"

Inherited from PaginatedRequest.jsonrpc

id: RequestId

Inherited from PaginatedRequest.id

params: PaginatedRequestParams

Inherited from PaginatedRequest.params

method: "tools/list"

Overrides PaginatedRequest.method

ListToolsResultResponse

interface ListToolsResultResponse {

  jsonrpc: "2.0";

  id: RequestId;

  result: ListToolsResult;

}

A successful response from the server for a tools/list request.

jsonrpc: "2.0"

Inherited from JSONRPCResultResponse.jsonrpc

id: RequestId

Inherited from JSONRPCResultResponse.id

result: ListToolsResult

Overrides JSONRPCResultResponse.result

ListToolsResult

interface ListToolsResult {

  _meta?: ResultMetaObject;

  resultType: string;

  nextCursor?: string;

  ttlMs: number;

  cacheScope: "public" | "private";

  tools: Tool[];

  [key: string]: unknown;

}

The result returned by the server for a tools/list request.

_meta?: ResultMetaObject

Inherited from PaginatedResult._meta

resultType: string

Indicates the type of the result, which allows the client to determine how to parse the result object.

Servers implementing this protocol version MUST include this field. For backward compatibility, when a client receives a result from a server implementing an earlier protocol version (which does not include resultType), the client MUST treat the absent field as "complete".

Inherited from PaginatedResult.resultType

nextCursor?: string

An opaque token representing the pagination position after the last returned result. If present, there may be more results available.

Inherited from PaginatedResult.nextCursor

ttlMs: number

A hint from the server indicating how long (in milliseconds) the client MAY cache this response before re-fetching. Semantics are analogous to HTTP Cache-Control max-age.

  • If 0, The response SHOULD be considered immediately stale, The client MAY re-fetch every time the result is needed.
  • If positive, the client SHOULD consider the result fresh for this many milliseconds after receiving the response.

Inherited from CacheableResult.ttlMs

cacheScope: "public" | "private"

Indicates the intended scope of the cached response, analogous to HTTP Cache-Control: public vs Cache-Control: private.

  • "public": The response does not contain user-specific data. Any client or intermediary (e.g., shared gateway, caching proxy) MAY cache the response and serve it across authorization contexts.
  • "private": The response MAY be cached and reused only within the same authorization context. Caches MUST NOT be shared across authorization contexts (e.g., a different access token requires a different cache).

Inherited from CacheableResult.cacheScope

tools: Tool[]

Tool

interface Tool {

  icons?: Icon[];

  name: string;

  title?: string;

  description?: string;

  inputSchema: { $schema?: string; type: "object"; [key: string]: unknown };

  outputSchema?: { $schema?: string; [key: string]: unknown };

  annotations?: ToolAnnotations;

  _meta?: MetaObject;

}

Definition for a tool the client can call.

icons?: Icon[]

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)

Inherited from Icons.icons

name: string

Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).

Inherited from BaseMetadata.name

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

Inherited from BaseMetadata.title

description?: string

A human-readable description of the tool.

This can be used by clients to improve the LLM's understanding of available tools. It can be thought of like a "hint" to the model.

inputSchema: { $schema?: string; type: "object"; [key: string]: unknown }

A JSON Schema object defining the expected parameters for the tool.

Tool arguments are always JSON objects, so type: "object" is required at the root. Beyond that, any JSON Schema 2020-12 keyword may appear alongside type — including composition keywords (oneOf, anyOf, allOf, not), conditional keywords (if/then/else), reference keywords ($ref, $defs, $anchor), and any other standard validation or annotation keywords.

Property schemas may carry an x-mcp-header annotation to mirror the argument value into an HTTP header on the Streamable HTTP transport. See the Streamable HTTP transport specification for the validity and extraction rules.

Defaults to JSON Schema 2020-12 when no explicit $schema is provided.

outputSchema?: { $schema?: string; [key: string]: unknown }

An optional JSON Schema object defining the structure of the tool's output returned in the structuredContent field of a CallToolResult. This can be any valid JSON Schema 2020-12.

Defaults to JSON Schema 2020-12 when no explicit $schema is provided.

annotations?: ToolAnnotations

Optional additional tool information.

Display name precedence order is: title, annotations.title, then name.

_meta?: MetaObject

ToolAnnotations

interface ToolAnnotations {

  title?: string;

  readOnlyHint?: boolean;

  destructiveHint?: boolean;

  idempotentHint?: boolean;

  openWorldHint?: boolean;

}

Additional properties describing a Tool to clients.

NOTE: all properties in ToolAnnotations are hints. They are not guaranteed to provide a faithful description of tool behavior (including descriptive properties like title).

Clients should never make tool use decisions based on ToolAnnotations received from untrusted servers.

title?: string

A human-readable title for the tool.

readOnlyHint?: boolean

If true, the tool does not modify its environment.

Default: false

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

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

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