Module types

Source
Expand description

Complete MCP Protocol Types for 2025-06-18 Specification

This module contains all the core types defined by the Model Context Protocol specification version 2025-06-18, with simplified JSON-RPC (no batching) and enhanced metadata handling.

Modules§

error_codes
Standard JSON-RPC error codes

Structs§

Annotations
Optional annotations for the client. The client can use annotations to inform how objects are used or displayed.
AudioContent
Audio content (2025-06-18)
BaseMetadata
Base interface for metadata with name (identifier) and title (display name) properties.
CallToolResult
Result of a tool execution (2025-06-18 with structured content)
ClientCapabilities
Client capabilities for 2025-06-18
CompletionsCapability
Autocompletion capabilities (2025-03-26)
CreateMessageResult
Result of sampling/createMessage (2025-06-18)
ElicitationCapability
Elicitation capabilities (2025-06-18 NEW)
ElicitationSchema
Restricted schema for elicitation (only top-level properties allowed)
EmbeddedResource
Embedded resource content (2025-06-18)
ErrorObject
Error object
GetPromptResult
Result of prompt execution (2025-06-18 with metadata)
ImageContent
Image content
Implementation
Information about an MCP implementation (2025-06-18 with title support)
JsonRpcError
JSON-RPC error message
JsonRpcNotification
JSON-RPC notification message
JsonRpcRequest
JSON-RPC request message
JsonRpcResponse
JSON-RPC response message
LoggingCapability
Logging capabilities (2025-03-26)
ModelHint
Model hint for model selection (2025-06-18)
ModelPreferences
Model preferences for sampling (2025-06-18 enhanced)
Notification
Base notification with metadata support
NotificationParams
Notification parameters with metadata
PaginatedRequest
Base for paginated requests
PaginatedResult
Base for paginated results
Prompt
Prompt definition
PromptArgument
Argument for a prompt
PromptMessage
Message in a prompt result (2025-06-18 with ContentBlock support)
PromptsCapability
Prompt-related server capabilities
Request
Base request with metadata support
RequestMeta
Request metadata
RequestParams
Request parameters with metadata
Resource
Resource definition
ResourceLink
ResourceLink content (2025-06-18 NEW)
ResourceTemplate
Resource template for URI patterns
ResourcesCapability
Resource-related server capabilities
RootsCapability
Roots capability for clients (2025-06-18)
SamplingCapability
Sampling-related capabilities
SamplingMessage
A message in a sampling conversation (2025-06-18 with ContentBlock)
ServerCapabilities
Server capabilities for 2025-06-18
TextContent
Text content
Tool
Tool definition with annotations and title (2025-06-18)
ToolAnnotations
Tool-specific annotations (2025-06-18 Schema Compliance)
ToolInputSchema
Tool input schema
ToolsCapability
Tool-related server capabilities

Enums§

AnnotationAudience
Annotation audience for content targeting (legacy)
ContentBlock
ContentBlock union type (2025-06-18 complete with ResourceLink)
DangerLevel
Danger level for tool safety annotations (legacy)
ElicitationAction
Elicitation user action
JsonRpcId
JSON-RPC ID type for better type safety
JsonRpcMessage
Complete JSON-RPC message types (2025-06-18)
JsonRpcRequestOrNotification
Request or notification union for compatibility
JsonRpcResponseOrError
Response or error union for compatibility
LoggingLevel
Logging level enumeration (2025-06-18)
PrimitiveSchemaDefinition
Primitive schema definition for elicitation
ResourceContents
Content of a resource (2025-06-18)
Role
Message role
SamplingContent
Content types allowed in sampling (subset of ContentBlock)
StopReason
Reasons why sampling stopped

Constants§

JSONRPC_VERSION
LATEST_PROTOCOL_VERSION
MCP Protocol version (2025-06-18)
PROTOCOL_VERSION

Type Aliases§

ClientInfo
Content
Cursor
Cursor for pagination
JsonRpcBatchRequest
Batch request type alias for compatibility
JsonRpcBatchResponse
Batch response type alias for compatibility
ProgressToken
Progress token for associating notifications with requests
PromptInfo
PromptResult
RequestId
Request ID for JSON-RPC correlation
ResourceInfo
ServerInfo
ToolInfo
ToolResult