Module mcp

Source

Modules§

client

Structs§

Annotations
Optional annotations for the client. The client can use annotations to inform how objects are used or displayed
AudioContent
Audio provided to or from an LLM.
CallToolParams
Used by the client to invoke a tool provided by the server.
CallToolResult
The server’s response to a tool call.
CancelledNotificationParams
This notification can be sent by either side to indicate that it is cancelling a previously-issued request.
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.
ClientRootsCapabilities
Capabilities related to listing roots supported by the client. Nested within ClientCapabilities.
CompleteParams
A request from the client to the server, to ask for completion options.
CompleteResult
The server’s response to a completion/complete request
CompletionArgument
Information about the argument being completed.
CompletionResultData
Data containing the completion results.
CreateMessageParams
A request from the server to sample an LLM via the client.
CreateMessageResult
The client’s response to a sampling/createMessage request from the server.
EmptyResult
Represents an empty JSON-RPC result, potentially containing only metadata. Used for requests like ping, logging/setLevel, resources/subscribe, resources/unsubscribe.
GenericMeta
Metadata attachable to a notification’s _meta field.
GetPromptParams
Used by the client to get a prompt provided by the server.
GetPromptResult
The server’s response to a prompts/get request from the client.
ImageContent
An image provided to or from an LLM.
Implementation
Describes the name and version of an MCP implementation. Used in InitializeRequest and InitializeResult.
InitializeParams
This request is sent from the client to the server when it first connects, asking it to begin initialization.
InitializeResult
After receiving an initialize request from the client, the server sends this response.
InitializedNotificationParams
This notification is sent from the client to the server after initialization has finished.
ListPromptsParams
Sent from the client to request a list of prompts and prompt templates the server has.
ListPromptsResult
The server’s response to a prompts/list request from the client.
ListResourceTemplatesParams
Sent from the client to request a list of resource templates the server has.
ListResourceTemplatesResult
The server’s response to a resources/templates/list request from the client.
ListResourcesParams
Sent from the client to request a list of resources the server has.
ListResourcesResult
The server’s response to a resources/list request from the client.
ListRootsParams
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.
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.
ListToolsParams
Sent from the client to request a list of tools the server has.
ListToolsResult
The server’s response to a tools/list request from the client.
LoggingMessageNotificationParams
Notification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically.
McpError
Represents an MCP Error response, corresponding to the JSON-RPC 2.0 Error Object.
McpNotification
McpRequest
McpResponse
Represents a successful MCP response.
ModelHint
Hints to use for model selection.
ModelPreferences
The server’s preferences for model selection, requested of the client during sampling.
PaginationParams
Base structure for requests supporting pagination. Specific request types embed these fields.
PingParams
A ping, issued by either the server or the client, to check that the other party is still alive. The receiver must promptly respond with an EmptyResult, or else may be disconnected.
ProgressNotificationParams
An out-of-band notification used to inform the receiver of a progress update for a long-running request.
Prompt
A prompt or prompt template that the server offers.
PromptArgument
Describes an argument that a prompt can accept.
PromptListChangedNotificationParams
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.
PromptMessage
Describes a message returned as part of a prompt.
PromptReference
Identifies a prompt for completion context.
ReadResourceParams
Sent from the client to the server, to read a specific resource URI.
ReadResourceResult
The server’s response to a resources/read request from the client.
RequestMeta
Metadata attachable to a request’s _meta field.
Resource
A known resource that the server is capable of reading.
ResourceListChangedNotificationParams
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.
ResourceReference
Identifies a resource or template for completion context.
ResourceTemplate
A template description for resources available on the server.
ResourceUpdatedNotificationParams
A notification from the server to the client, informing it that a resource has changed and may need to be read again. This should only be sent if the client previously sent a resources/subscribe request.
Root
Represents a root directory or file that the server can operate on.
RootsListChangedNotificationParams
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.
SamplingMessage
Describes a message issued to or received from an LLM API.
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.
ServerPromptsCapabilities
Capabilities related to prompts supported by the server. Nested within ServerCapabilities.
ServerResourcesCapabilities
Capabilities related to resources supported by the server. Nested within ServerCapabilities.
ServerToolsCapabilities
Capabilities related to tools supported by the server. Nested within ServerCapabilities.
SetLevelParams
A request from the client to the server, to enable or adjust logging.
SubscribeParams
Sent from the client to request resources/updated notifications from the server whenever a particular resource changes.
TextContent
Text provided to or from an LLM.
Tool
Definition for a tool the client can call.
ToolAnnotations
Additional properties describing a Tool to clients.
ToolInputSchema
The input schema for a tool.
ToolListChangedNotificationParams
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.
UnsubscribeParams
Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request.

Enums§

CompletionReference
Reference to the context for which completion is requested. Can be either a prompt or a resource.
Error
IncludeContext
A request to include context from one or more MCP servers (including the caller), to be attached to the prompt.
LoggingLevel
The severity of a log message.
McpMessage
Represents any valid MCP message (Request, Notification, Response, or Error).
MessageContent
Content types for messages (used in Prompts and Tool Calls).
ProgressToken
A progress token, used to associate progress notifications with the original request.
ResourceContents
The contents of a specific resource or sub-resource.
Role
The sender or recipient of messages and data in a conversation.
SamplingContent
Represents the content part of a SamplingMessage. Based on TS SamplingMessage.content: TextContent | ImageContent | AudioContent.

Constants§

JSONRPC_VERSION
LATEST_PROTOCOL_VERSION

Traits§

IntoMcpNotification
IntoMcpRequest

Type Aliases§

CancelledNotification
Cursor
InitializedNotification
LoggingMessageNotification
ProgressNotification
PromptListChangedNotification
ResourceListChangedNotification
ResourceUpdatedNotification
Result
RootsListChangedNotification
ToolListChangedNotification