mcp library

Classes

Annotations
Optional client hints attached to MCP content objects.
AudioContent
Audio content block for LLM interactions.
BlobResourceContents
Binary resource content encoded as base64.
BooleanSchema
The MCP BooleanSchema schema type.
CallToolRequest
A tools/call JSON-RPC request.
CallToolRequestParams
Parameters for a tools/call request.
CallToolResult
The server's response to a tools/call request.
CallToolResultOutcome
Discriminated union: either an InputRequiredResult pause or the completed CallToolResult, as returned by CallToolResultResponse.result.
CallToolResultResponse
A successful response from the server for a tools/call request.
CancelledNotification
Sent by the client to indicate it is cancelling a previously-issued request.
CancelledNotificationParams
Parameters for a notifications/cancelled notification.
ClientCapabilities
Capabilities declared by the MCP client.
CompleteRequest
A request from the client to the server, to ask for completion options.
CompleteRequestParams
Parameters for a completion/complete request.
CompleteRequestParamsArgument
The MCP CompleteRequestParamsArgument schema type.
CompleteRequestParamsContext
The MCP CompleteRequestParamsContext schema type.
CompleteResult
The result returned by the server for a completion/complete request.
CompleteResultCompletion
The MCP CompleteResultCompletion schema type.
CompleteResultResponse
A successful response from the server for a completion/complete request.
ContentBlock
Base class for all MCP content blocks (text, image, audio, resource, etc.).
CreateMessageRequest
A request from the server to sample an LLM via the client.
CreateMessageRequestParams
Parameters for a sampling/createMessage request.
CreateMessageResult
The result returned by the client for a sampling/createMessage request.
DiscoverRequest
Requests the server's capability advertisement out-of-band, replacing the former initialize handshake now that protocol negotiation happens per-request via RequestMetaObject.
DiscoverResult
The server's capability advertisement, servers implementing this protocol version MUST support server/discover.
DiscoverResultResponse
A successful response from the server for a server/discover request.
ElicitRequest
A request from the server to elicit additional information from the user via the client.
ElicitRequestFormParams
The parameters for a request to elicit non-sensitive information from the user via a form in the client.
ElicitRequestFormParamsSchema
The MCP ElicitRequestFormParamsSchema schema type.
ElicitRequestParams
Discriminated union of the two ElicitRequest param shapes, dispatched on ElicitRequestFormParams.mode / ElicitRequestURLParams.mode: a form-based elicitation, or a URL-based one.
ElicitRequestURLParams
The parameters for a request to elicit information from the user via a URL in the client.
ElicitResult
The result returned by the client for an elicitation/create request.
EmbeddedResource
An MCP resource embedded inside a prompt or tool-call result.
EmptyResult
A successful result that carries no data.
EnumSchema<T>
The MCP EnumSchema schema type.
Error
A JSON-RPC 2.0 error object.
GetPromptRequest
Used by the client to get a prompt provided by the server.
GetPromptRequestParams
Parameters for a prompts/get request.
GetPromptResult
The result returned by the server for a prompts/get request.
GetPromptResultOutcome
Discriminated union: either an InputRequiredResult pause or the completed GetPromptResult, as returned by GetPromptResultResponse.result.
GetPromptResultResponse
A successful response from the server for a prompts/get request.
HeaderMismatchError
Returned when a server rejects a request because HTTP header values do not match the corresponding values in the request body, or required headers are missing/malformed. For HTTP, the response status MUST be 400 Bad Request.
Icon
An optionally-sized icon that may be displayed in a UI.
ImageContent
Image content block for LLM interactions.
Implementation
Describes an MCP client or server implementation.
InputRequiredResult
A result indicating the original request requires additional client input before the server can produce a final answer.
InputResponseRequestParams
Base params shape for requests that may resume a paused multi-round-trip operation by supplying inputResponses and/or requestState.
InternalError
JSON-RPC internal error (code -32603).
InvalidParamsError
JSON-RPC invalid params error (code -32602).
InvalidRequestError
JSON-RPC invalid request error (code -32600).
JSONRPCErrorResponse
A JSON-RPC 2.0 error response.
JSONRPCMessage
Union base for all JSON-RPC wire objects.
JSONRPCNotification
A JSON-RPC 2.0 notification (a request with no expected response).
JSONRPCRequest
A JSON-RPC 2.0 request that expects a response.
JSONRPCResponse
Abstract base for all JSON-RPC response objects.
JSONRPCResultResponse
A successful JSON-RPC 2.0 response carrying a Result.
LegacyTitledEnumSchema
Use TitledSingleSelectEnumSchema instead.
ListPromptsRequest
Sent from the client to request a list of prompts and prompt templates the server has.
ListPromptsResult
The result returned by the server for a prompts/list request.
ListPromptsResultResponse
A successful response from the server for a prompts/list request.
ListResourcesRequest
Sent from the client to request a list of resources the server has.
ListResourcesResult
The result returned by the server for a resources/list request.
ListResourcesResultResponse
A successful response from the server for a resources/list request.
ListResourceTemplatesRequest
Sent from the client to request a list of resource templates the server has.
ListResourceTemplatesResult
The result returned by the server for a resources/templates/list request.
ListResourceTemplatesResultResponse
A successful response from the server for a resources/templates/list request.
ListRootsRequest
Sent from the server to request a list of root URIs from the client.
ListRootsResult
The result returned by the client for a roots/list request.
ListToolsRequest
Sent from the client to request a list of tools the server has.
ListToolsResult
The result returned by the server for a tools/list request.
ListToolsResultResponse
A successful response from the server for a tools/list request.
LoggingMessageNotification
JSONRPCNotification of a log message passed from server to client.
LoggingMessageNotificationParams
Parameters for a notifications/message notification.
MapMC<K, V>
A MapModel that also satisfies MCP.
MCP
Base interface for all MCP model objects.
McpBuilder
Declarative MCP capability builder.
McpServerController
Abstract base for MCPP-compatible controllers in the Finch framework.
MetaObject
Holds the _meta map present on many MCP types.
MethodNotFoundError
JSON-RPC method not found error (code -32601).
MissingRequiredClientCapabilityError
Returned when a request omits a client capability the server requires for the requested operation.
ModelHint
Hints to use for model selection.
ModelPreferences
The server's preferences for model selection, requested of the client during sampling.
MultiSelectEnumSchema<T>
The MCP MultiSelectEnumSchema schema type.
NotificationMetaObject
The _meta object carried inside notification params.
NotificationParams
Parameters shared by MCP notifications.
NumberSchema
The MCP NumberSchema schema type.
PaginatedRequestParams
Request params for paginated MCP list calls.
ParseError
JSON-RPC parse error (code -32700).
PrimitiveSchemaDefinition<T>
Restricted schema definitions that only allow primitive types without nested objects or arrays.
ProgressNotification
An out-of-band notification used to inform the receiver of a progress update for a long-running request.
ProgressNotificationParams
Parameters for a notifications/progress notification.
Prompt
A prompt or prompt template offered by the server.
PromptArgument
Describes an argument accepted by a Prompt.
PromptListChangedNotification
An optional notification from the server to the client, informing it that the list of prompts it offers has changed.
PromptMessage
Describes a message returned as part of a prompt.
PromptReference
Identifies a prompt.
ReadResourceRequest
Sent from the client to the server, to read a specific resource URI.
ReadResourceRequestParams
Parameters for a resources/read request.
ReadResourceResult
The result returned by the server for a resources/read request.
ReadResourceResultOutcome
Discriminated union: either an InputRequiredResult pause or the completed ReadResourceResult, as returned by ReadResourceResultResponse.result.
ReadResourceResultResponse
A successful response from the server for a resources/read request.
Reference
Discriminated union of completion reference targets: either a PromptReference (type: "ref/prompt") or a ResourceTemplateReference (type: "ref/resource").
RequestMetaObject
The _meta object carried inside request params.
RequestParams
Common params for any request.
Resource
A known resource that the server can serve.
ResourceContents
Base interface for resource content (text or blob).
A resource link returned by a tool or included in a prompt.
ResourceListChangedNotification
An optional notification from the server to the client, informing it that the list of resources it can read from has changed.
ResourceTemplate
A URI template (RFC 6570) describing a family of resources.
ResourceTemplateReference
A reference to a resource or resource template definition.
ResourceUpdatedNotification
A notification from the server to the client, informing it that a resource has changed and may need to be read again.
ResourceUpdatedNotificationParams
Parameters for a notifications/resources/updated notification.
Result
Generic MCP result that may carry arbitrary extra fields.
ResultMetaObject
The _meta object carried inside a Result.
Root
Represents a root directory or file that the server can operate on.
RootsListChangedNotification
A JSON-RPC notification for the rootsListChanged event.
SamplingMessage
Describes a message issued to or received from an LLM API.
SamplingMessageContentBlock
The MCP SamplingMessageContentBlock schema type.
Schema<T>
The MCP Schema schema type.
ServerCapabilities
Capabilities declared by the MCP server.
SingleSelectEnumSchema<T>
The MCP SingleSelectEnumSchema schema type.
StringSchema
The MCP StringSchema schema type.
SubscriptionFilter
Filter describing which change notifications a subscriptions/listen stream should deliver.
SubscriptionsAcknowledgedNotification
Sent by the server to acknowledge that a subscriptions/listen subscription has been established and to report which notification types it agreed to honor.
SubscriptionsAcknowledgedNotificationParams
The first message a server sends after a client opens a new subscriptions/listen stream, acknowledging which notifications it will deliver on it.
SubscriptionsListenRequest
Opens a long-lived stream on which the server pushes change notifications, replacing the former resources/subscribe / resources/unsubscribe RPCs.
SubscriptionsListenRequestParams
Parameters for a subscriptions/listen request.
SubscriptionsListenResult
Sent by the server, at most once, to gracefully terminate a subscriptions/listen stream. The result body is otherwise empty.
SubscriptionsListenResultMetaObject
The _meta object carried on a SubscriptionsListenResult.
SubscriptionsListenResultResponse
A successful response from the server for a subscriptions/listen request, sent when the server tears the subscription down gracefully.
TextContent
Plain-text content for LLM interactions.
TextResourceContents
UTF-8 text resource contents.
TitledMultiSelectEnumSchema
Schema for multiple-selection enumeration with display titles for each option.
TitledSingleSelectEnumSchema
Schema for single-selection enumeration with display titles for each option.
Tool
A tool that the server exposes for the client to call.
ToolAnnotations
Behavioural hints for a Tool (all properties are advisory).
ToolChoice
Controls tool selection behavior for sampling requests.
ToolListChangedNotification
An optional notification from the server to the client, informing it that the list of tools it offers has changed.
ToolResultContent
The result of a tool use, provided by the user back to the assistant.
ToolSchema
Execution-related properties for a Tool. JSON Schema (2020-12) object used for a tool's Tool.inputSchema or Tool.outputSchema.
ToolUseContent
A request from the assistant to call a tool.
UnsupportedProtocolVersionError
Returned when a server does not support the protocol version requested via RequestMetaObject["io.modelcontextprotocol/protocolVersion"].
UntitledMultiSelectEnumSchema
Schema for multiple-selection enumeration without display titles for options.
UntitledSingleSelectEnumSchema
Schema for single-selection enumeration without display titles for options.

Enums

ActionType
The user action in response to an elicitation request.
CacheScope
Cache scope for a cacheable result (see DiscoverResult and the various List*Result / ReadResourceResult types).
LoggingLevel
The severity of a log message, mapped to syslog severities (RFC-5424).
McpProtocolVersion
ResultType
Indicates the type of a result, so a client knows how to parse it.
Role
The sender or recipient of messages and data in a conversation.
StringFormat
The JSON Schema format keyword for string-typed values.
Theme
UI theme variants for Icon.