McpSchema
Autocomplete
Signature
declare class Complete extends any {
constructor();
}CompleteResult
The server's response to a completion/complete request
Signature
declare class CompleteResult extends ReadonlySide<
{
readonly completion: Struct<{
readonly hasMore: optional<Boolean>;
readonly total: optional<Number>;
readonly values: $Array<String>;
}>;
},
"Type"
> {
constructor(
...args: [
props: ReadonlyMakeIn<{
readonly completion: Struct<{
readonly hasMore: optional<Boolean>;
readonly total: optional<Number>;
readonly values: $Array<String>;
}>;
}>,
options?: MakeOptions,
]
);
static readonly empty: CompleteResult;
}PromptReference
Identifies a prompt.
Signature
declare class PromptReference extends any {
constructor();
}ResourceReference
A reference to a resource or resource template definition.
Signature
declare class ResourceReference extends any {
constructor();
}Cancellation
CancelledNotification
Signature
declare class CancelledNotification extends any {
constructor();
}Common
Annotations
Optional annotations for the client. The client can use annotations to inform how objects are used or displayed
Signature
declare class Annotations extends any {
constructor();
}ClientCapabilities
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.
Signature
declare class ClientCapabilities extends {
readonly elicitation?: ReadonlySide<{}, "Type">;
readonly experimental?: {
[key: string]: unknown;
[key: number]: unknown;
[key: symbol]: unknown;
};
readonly roots?: {
readonly listChanged?: boolean;
};
readonly sampling?: ReadonlySide<{}, "Type">;
} {
constructor(...args: [props?: {
readonly elicitation?: ReadonlyMakeIn<{}>;
readonly experimental?: {
[key: string]: unknown;
[key: number]: unknown;
[key: symbol]: unknown;
};
readonly roots?: {
readonly listChanged?: boolean;
};
readonly sampling?: ReadonlyMakeIn<{}>;
}, options?: MakeOptions]);
}An opaque token used to represent a cursor for pagination.
Signature
declare const Cursor: typeof Schema.String;Signature
type Cursor = typeof Cursor.Type;Implementation
Describes the name and version of an MCP implementation.
Signature
declare class Implementation extends any {
constructor();
}NotificationMeta
Signature
declare class NotificationMeta extends any {
constructor();
}PaginatedRequestMeta
Signature
declare class PaginatedRequestMeta extends any {
constructor();
}PaginatedResultMeta
Signature
declare class PaginatedResultMeta extends any {
constructor();
}ProgressToken
A progress token, used to associate progress notifications with the original request.
Signature
declare const ProgressToken: Schema.Union<[typeof Schema.String, typeof Schema.Number]>;ProgressToken type
A progress token, used to associate progress notifications with the original request.
Signature
type ProgressToken = typeof ProgressToken.Type;A uniquely identifying ID for a request in JSON-RPC.
Signature
declare const RequestId: Schema.Union<[typeof Schema.String, typeof Schema.Number]>;A uniquely identifying ID for a request in JSON-RPC.
Signature
type RequestId = typeof RequestId.Type;RequestMeta
Signature
declare class RequestMeta extends any {
constructor();
}ResultMeta
Signature
declare class ResultMeta extends any {
constructor();
}The sender or recipient of messages and data in a conversation.
Signature
declare const Role: Schema.Literal<["user", "assistant"]>;Signature
type Role = typeof Role.Type;ServerCapabilities
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.
Signature
declare class ServerCapabilities extends any {
constructor();
}Elicitation
Signature
declare class Elicit extends any {
constructor();
}ElicitAcceptResult
The client's response to an elicitation request
Signature
declare class ElicitAcceptResult extends {
[key: number]: any;
[key: symbol]: any;
[key: string]: any;
} {
[key: number]: any;
[key: symbol]: any;
[key: string]: any;
constructor(...args: [props?: {
[key: number]: any;
[key: symbol]: any;
[key: string]: any;
}, options?: MakeOptions]);
}ElicitationDeclined
Signature
declare class ElicitationDeclined extends any {
constructor();
}ElicitDeclineResult
The client's response to an elicitation request
Signature
declare class ElicitDeclineResult extends {
[key: number]: any;
[key: symbol]: any;
[key: string]: any;
} {
[key: number]: any;
[key: symbol]: any;
[key: string]: any;
constructor(...args: [props?: {
[key: number]: any;
[key: symbol]: any;
[key: string]: any;
}, options?: MakeOptions]);
}ElicitResult
The client's response to an elicitation request
Signature
declare const ElicitResult: Union<readonly Array<Constraint>>Errors
INTERNAL_ERROR_CODE
Signature
declare const INTERNAL_ERROR_CODE: -32603;InternalError
Signature
declare class InternalError extends any {
constructor();
static readonly notImplemented: InternalError;
}INVALID_PARAMS_ERROR_CODE
Signature
declare const INVALID_PARAMS_ERROR_CODE: -32602;INVALID_REQUEST_ERROR_CODE
Signature
declare const INVALID_REQUEST_ERROR_CODE: -32600;InvalidParams
Signature
declare class InvalidParams extends any {
constructor();
}InvalidRequest
Signature
declare class InvalidRequest extends any {
constructor();
}Signature
declare class McpError extends {
readonly code: number;
readonly data?: unknown;
readonly message: string;
} {
constructor(...args: [props: {
readonly code: number;
readonly data?: unknown;
readonly message: string;
}, options?: MakeOptions]);
}METHOD_NOT_FOUND_ERROR_CODE
Signature
declare const METHOD_NOT_FOUND_ERROR_CODE: -32601;MethodNotFound
Signature
declare class MethodNotFound extends any {
constructor();
}PARSE_ERROR_CODE
Signature
declare const PARSE_ERROR_CODE: -32700;ParseError
Signature
declare class ParseError extends any {
constructor();
}Initialization
Initialize
This request is sent from the client to the server when it first connects, asking it to begin initialization.
Signature
declare class Initialize extends any {
constructor();
}InitializedNotification
This notification is sent from the client to the server after initialization has finished.
Signature
declare class InitializedNotification extends any {
constructor();
}InitializeResult
After receiving an initialize request from the client, the server sends this response.
Signature
declare class InitializeResult extends {
[key: number]: any;
[key: symbol]: any;
[key: string]: any;
} {
[key: number]: any;
[key: symbol]: any;
[key: string]: any;
constructor(...args: [props?: {
[key: number]: any;
[key: symbol]: any;
[key: string]: any;
}, options?: MakeOptions]);
}Logging
LoggingLevel
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
Signature
declare const LoggingLevel: Schema.Literal<
["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]
>;LoggingLevel type
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
Signature
type LoggingLevel = typeof LoggingLevel.Type;LoggingMessageNotification
Signature
declare class LoggingMessageNotification extends any {
constructor();
}A request from the client to the server, to enable or adjust logging.
Signature
declare class SetLevel extends any {
constructor();
}McpServerClient
McpServerClient
Signature
declare class McpServerClient extends any {
constructor();
}McpServerClientMiddleware
Signature
declare class McpServerClientMiddleware extends any {
constructor();
}Parameters
Helper to create a param for a resource URI template.
Signature
declare function param<Id extends string, S extends Any>(id: Id, schema: S): Param<Id, S>;Signature
interface Param<Id extends string, S extends Schema.Schema.Any> extends Schema<
S["Type"],
S["Encoded"],
S["Context"]
> {
readonly [ParamAnnotation]: Id;
}ParamAnnotation
Signature
declare const ParamAnnotation: unique symbol;Ping
Progress
ProgressNotification
An out-of-band notification used to inform the receiver of a progress update for a long-running request.
Signature
declare class ProgressNotification extends any {
constructor();
}Prompts
AudioContent
Audio provided to or from an LLM.
Signature
declare class AudioContent extends any {
constructor();
}ContentBlock
Signature
declare class ContentBlock extends any {
constructor();
}EmbeddedResource
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.
Signature
declare class EmbeddedResource extends any {
constructor();
}Used by the client to get a prompt provided by the server.
Signature
declare class GetPrompt extends any {
constructor();
}GetPromptResult
The server's response to a prompts/get request from the client.
Signature
declare class GetPromptResult extends {
[key: number]: any;
[key: symbol]: any;
[key: string]: any;
} {
[key: number]: any;
[key: symbol]: any;
[key: string]: any;
constructor(...args: [props?: {
[key: number]: any;
[key: symbol]: any;
[key: string]: any;
}, options?: MakeOptions]);
}ImageContent
An image provided to or from an LLM.
Signature
declare class ImageContent extends any {
constructor();
}ListPrompts
Sent from the client to request a list of prompts and prompt templates the server has.
Signature
declare class ListPrompts extends any {
constructor();
}ListPromptsResult
The server's response to a prompts/list request from the client.
Signature
declare class ListPromptsResult extends {
[key: number]: any;
[key: symbol]: any;
[key: string]: any;
} {
[key: number]: any;
[key: symbol]: any;
[key: string]: any;
constructor(...args: [props?: {
[key: number]: any;
[key: symbol]: any;
[key: string]: any;
}, options?: MakeOptions]);
}A prompt or prompt template that the server offers.
Signature
declare class Prompt extends {
readonly arguments?: readonly Array<unknown>;
readonly description?: string;
readonly name: string;
readonly title?: string;
} {
constructor(...args: [props: {
readonly arguments?: readonly Array<unknown>;
readonly description?: string;
readonly name: string;
readonly title?: string;
}, options?: MakeOptions]);
}PromptArgument
Describes an argument that a prompt can accept.
Signature
declare class PromptArgument extends any {
constructor();
}PromptListChangedNotification
An optional notification from the server to the client, informing it that the list of prompts it offers has changed. This may be issued by servers without any previous subscription from the client.
Signature
declare class PromptListChangedNotification extends any {
constructor();
}PromptMessage
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.
Signature
declare class PromptMessage extends any {
constructor();
}ResourceLink
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.
Signature
declare class ResourceLink extends any {
constructor();
}TextContent
Text provided to or from an LLM.
Signature
declare class TextContent extends any {
constructor();
}Protocol
ClientFailureEncoded type
Signature
type ClientFailureEncoded = FailureEncoded<typeof ServerRequestRpcs>;ClientNotificationEncoded type
Signature
type ClientNotificationEncoded = NotificationEncoded<typeof ClientNotificationRpcs>;ClientNotificationRpcs
Signature
declare class ClientNotificationRpcs extends any {
constructor();
}ClientRequestEncoded type
Signature
type ClientRequestEncoded = RequestEncoded<typeof ClientRequestRpcs>;ClientRequestRpcs
Signature
declare class ClientRequestRpcs extends any {
constructor();
}ClientRpcs
Signature
declare class ClientRpcs extends any {
constructor();
}ClientSuccessEncoded type
Signature
type ClientSuccessEncoded = SuccessEncoded<typeof ServerRequestRpcs>;FailureEncoded type
Signature
type FailureEncoded<Group extends RpcGroup.Any> =
RpcGroup.Rpcs<Group> extends infer Rpc
? Rpc extends Rpc.Rpc<
infer _Tag,
infer _Payload,
infer _Success,
infer _Error,
infer _Middleware
>
? {
readonly _tag: "Failure";
readonly error: _Error["Encoded"];
readonly id: string | number;
}
: never
: never;FromClientEncoded type
Signature
type FromClientEncoded = ClientRequestEncoded | ClientNotificationEncoded;FromServerEncoded type
Signature
type FromServerEncoded = ServerResultEncoded | ServerNotificationEncoded;NotificationEncoded type
Signature
type NotificationEncoded<Group extends RpcGroup.Any> =
RpcGroup.Rpcs<Group> extends infer Rpc
? Rpc extends Rpc.Rpc<
infer _Tag,
infer _Payload,
infer _Success,
infer _Error,
infer _Middleware
>
? {
readonly _tag: "Notification";
readonly method: _Tag;
readonly payload: _Payload["Encoded"];
}
: never
: never;RequestEncoded type
Signature
type RequestEncoded<Group extends RpcGroup.Any> =
RpcGroup.Rpcs<Group> extends infer Rpc
? Rpc extends Rpc.Rpc<
infer _Tag,
infer _Payload,
infer _Success,
infer _Error,
infer _Middleware
>
? {
readonly _tag: "Request";
readonly id: string | number;
readonly method: _Tag;
readonly payload: _Payload["Encoded"];
}
: never
: never;ServerFailureEncoded type
Signature
type ServerFailureEncoded = FailureEncoded<typeof ClientRequestRpcs>;ServerNotificationEncoded type
Signature
type ServerNotificationEncoded = NotificationEncoded<typeof ServerNotificationRpcs>;ServerNotificationRpcs
Signature
declare class ServerNotificationRpcs extends any {
constructor();
}ServerRequestEncoded type
Signature
type ServerRequestEncoded = RequestEncoded<typeof ServerRequestRpcs>;ServerRequestRpcs
Signature
declare class ServerRequestRpcs extends any {
constructor();
}ServerResultEncoded type
Signature
type ServerResultEncoded = ServerSuccessEncoded | ServerFailureEncoded;ServerSuccessEncoded type
Signature
type ServerSuccessEncoded = SuccessEncoded<typeof ClientRequestRpcs>;SuccessEncoded type
Signature
type SuccessEncoded<Group extends RpcGroup.Any> =
RpcGroup.Rpcs<Group> extends infer Rpc
? Rpc extends Rpc.Rpc<
infer _Tag,
infer _Payload,
infer _Success,
infer _Error,
infer _Middleware
>
? {
readonly _tag: "Success";
readonly id: string | number;
readonly result: _Success["Encoded"];
}
: never
: never;Resources
BlobResourceContents
The contents of a binary resource, which can be represented as an Uint8Array
Signature
declare class BlobResourceContents extends any {
constructor();
}ListResources
Sent from the client to request a list of resources the server has.
Signature
declare class ListResources extends any {
constructor();
}ListResourcesResult
The server's response to a resources/list request from the client.
Signature
declare class ListResourcesResult extends {
[key: number]: any;
[key: symbol]: any;
[key: string]: any;
} {
[key: number]: any;
[key: symbol]: any;
[key: string]: any;
constructor(...args: [props?: {
[key: number]: any;
[key: symbol]: any;
[key: string]: any;
}, options?: MakeOptions]);
}ListResourceTemplates
Sent from the client to request a list of resource templates the server has.
Signature
declare class ListResourceTemplates extends any {
constructor();
}ListResourceTemplatesResult
The server's response to a resources/templates/list request from the client.
Signature
declare class ListResourceTemplatesResult extends {
[key: number]: any;
[key: symbol]: any;
[key: string]: any;
} {
[key: number]: any;
[key: symbol]: any;
[key: string]: any;
constructor(...args: [props?: {
[key: number]: any;
[key: symbol]: any;
[key: string]: any;
}, options?: MakeOptions]);
}ReadResource
Sent from the client to the server, to read a specific resource URI.
Signature
declare class ReadResource extends any {
constructor();
}ReadResourceResult
The server's response to a resources/read request from the client.
Signature
declare class ReadResourceResult extends any {
constructor();
}A known resource that the server is capable of reading.
Signature
declare class Resource extends {
readonly annotations?: unknown;
readonly description?: string;
readonly mimeType?: string;
readonly name: string;
readonly size?: number;
readonly title?: string;
readonly uri: string;
} {
constructor(...args: [props: {
readonly annotations?: unknown;
readonly description?: string;
readonly mimeType?: string;
readonly name: string;
readonly size?: number;
readonly title?: string;
readonly uri: string;
}, options?: MakeOptions]);
}ResourceContents
The contents of a specific resource or sub-resource.
Signature
declare class ResourceContents extends any {
constructor();
}ResourceListChangedNotification
An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This may be issued by servers without any previous subscription from the client.
Signature
declare class ResourceListChangedNotification extends any {
constructor();
}ResourceTemplate
A template description for resources available on the server.
Signature
declare class ResourceTemplate extends {
readonly annotations?: unknown;
readonly description?: string;
readonly mimeType?: string;
readonly name: string;
readonly title?: string;
readonly uriTemplate: string;
} {
constructor(...args: [props: {
readonly annotations?: unknown;
readonly description?: string;
readonly mimeType?: string;
readonly name: string;
readonly title?: string;
readonly uriTemplate: string;
}, options?: MakeOptions]);
}ResourceUpdatedNotification
Signature
declare class ResourceUpdatedNotification extends any {
constructor();
}Sent from the client to request resources/updated notifications from the server whenever a particular resource changes.
Signature
declare class Subscribe extends any {
constructor();
}TextResourceContents
The contents of a text resource, which can be represented as a string.
Signature
declare class TextResourceContents extends any {
constructor();
}Unsubscribe
Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request.
Signature
declare class Unsubscribe extends any {
constructor();
}Roots
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.
Signature
declare class ListRoots extends any {
constructor();
}ListRootsResult
The client's response to a roots/list request from the server. This result contains an array of Root objects, each representing a root directory or file that the server can operate on.
Signature
declare class ListRootsResult extends ReadonlySide<
{
readonly roots: $Array<typeof Root>;
},
"Type"
> {
constructor(
...args: [
props: ReadonlyMakeIn<{
readonly roots: $Array<typeof Root>;
}>,
options?: MakeOptions,
]
);
}Represents a root directory or file that the server can operate on.
Signature
declare class Root extends {
readonly name?: string;
readonly uri: string;
} {
constructor(...args: [props: {
readonly name?: string;
readonly uri: string;
}, options?: MakeOptions]);
}RootsListChangedNotification
A notification from the client to the server, informing it that the list of roots has changed. This notification should be sent whenever the client adds, removes, or modifies any root. The server should then request an updated list of roots using the ListRootsRequest.
Signature
declare class RootsListChangedNotification extends any {
constructor();
}Sampling
CreateMessage
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.
Signature
declare class CreateMessage extends any {
constructor();
}CreateMessageResult
The client's response to a sampling/create_message request from the server. 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.
Signature
declare class CreateMessageResult extends {
readonly model: string;
readonly stopReason?: string;
} {
constructor(...args: [props: {
readonly model: string;
readonly stopReason?: string;
}, options?: MakeOptions]);
}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.
Signature
declare class ModelHint extends any {
constructor();
}ModelPreferences
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.
Signature
declare class ModelPreferences extends {
readonly costPriority?: undefined;
readonly hints?: readonly Array<unknown>;
readonly intelligencePriority?: undefined;
readonly speedPriority?: undefined;
} {
constructor(...args: [props?: {
readonly costPriority?: undefined;
readonly hints?: readonly Array<unknown>;
readonly intelligencePriority?: undefined;
readonly speedPriority?: undefined;
}, options?: MakeOptions]);
}SamplingMessage
Describes a message issued to or received from an LLM API.
Signature
declare class SamplingMessage extends any {
constructor();
}Tools
Used by the client to invoke a tool provided by the server.
Signature
declare class CallTool extends any {
constructor();
}CallToolResult
The server's response to a tool call.
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.
Signature
declare class CallToolResult extends {
[key: number]: any;
[key: symbol]: any;
[key: string]: any;
} {
[key: number]: any;
[key: symbol]: any;
[key: string]: any;
constructor(...args: [props?: {
[key: number]: any;
[key: symbol]: any;
[key: string]: any;
}, options?: MakeOptions]);
}Sent from the client to request a list of tools the server has.
Signature
declare class ListTools extends any {
constructor();
}ListToolsResult
The server's response to a tools/list request from the client.
Signature
declare class ListToolsResult extends {
[key: number]: any;
[key: symbol]: any;
[key: string]: any;
} {
[key: number]: any;
[key: symbol]: any;
[key: string]: any;
constructor(...args: [props?: {
[key: number]: any;
[key: symbol]: any;
[key: string]: any;
}, options?: MakeOptions]);
}Definition for a tool the client can call.
Signature
declare class Tool extends {
readonly annotations?: ToolAnnotations;
readonly description?: string;
readonly inputSchema: unknown;
readonly name: string;
readonly title?: string;
} {
constructor(...args: [props: {
readonly annotations?: ToolAnnotations;
readonly description?: string;
readonly inputSchema: unknown;
readonly name: string;
readonly title?: string;
}, options?: MakeOptions]);
}ToolAnnotations
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.
Signature
declare class ToolAnnotations extends {
[key: string]: any;
} {
[key: string]: any;
constructor(...args: [props?: {
[key: string]: any;
}, options?: MakeOptions]);
}ToolListChangedNotification
An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client.
Signature
declare class ToolListChangedNotification extends any {
constructor();
}
A request from the client to the server, to ask for completion options.