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.
- Audio
Content - Audio content (2025-06-18)
- Base
Metadata - Base interface for metadata with name (identifier) and title (display name) properties.
- Call
Tool Result - Result of a tool execution (2025-06-18 with structured content)
- Client
Capabilities - Client capabilities for 2025-06-18
- Completions
Capability - Autocompletion capabilities (2025-03-26)
- Create
Message Result - Result of sampling/createMessage (2025-06-18)
- Elicitation
Capability - Elicitation capabilities (2025-06-18 NEW)
- Elicitation
Schema - Restricted schema for elicitation (only top-level properties allowed)
- Embedded
Resource - Embedded resource content (2025-06-18)
- Error
Object - Error object
- GetPrompt
Result - Result of prompt execution (2025-06-18 with metadata)
- Image
Content - Image content
- Implementation
- Information about an MCP implementation (2025-06-18 with title support)
- Json
RpcError - JSON-RPC error message
- Json
RpcNotification - JSON-RPC notification message
- Json
RpcRequest - JSON-RPC request message
- Json
RpcResponse - JSON-RPC response message
- Logging
Capability - Logging capabilities (2025-03-26)
- Model
Hint - Model hint for model selection (2025-06-18)
- Model
Preferences - Model preferences for sampling (2025-06-18 enhanced)
- Notification
- Base notification with metadata support
- Notification
Params - Notification parameters with metadata
- Paginated
Request - Base for paginated requests
- Paginated
Result - Base for paginated results
- Prompt
- Prompt definition
- Prompt
Argument - Argument for a prompt
- Prompt
Message - Message in a prompt result (2025-06-18 with ContentBlock support)
- Prompts
Capability - Prompt-related server capabilities
- Request
- Base request with metadata support
- Request
Meta - Request metadata
- Request
Params - Request parameters with metadata
- Resource
- Resource definition
- Resource
Link - ResourceLink content (2025-06-18 NEW)
- Resource
Template - Resource template for URI patterns
- Resources
Capability - Resource-related server capabilities
- Roots
Capability - Roots capability for clients (2025-06-18)
- Sampling
Capability - Sampling-related capabilities
- Sampling
Message - A message in a sampling conversation (2025-06-18 with ContentBlock)
- Server
Capabilities - Server capabilities for 2025-06-18
- Text
Content - Text content
- Tool
- Tool definition with annotations and title (2025-06-18)
- Tool
Annotations - Tool-specific annotations (2025-06-18 Schema Compliance)
- Tool
Input Schema - Tool input schema
- Tools
Capability - Tool-related server capabilities
Enums§
- Annotation
Audience - Annotation audience for content targeting (legacy)
- Content
Block - ContentBlock union type (2025-06-18 complete with ResourceLink)
- Danger
Level - Danger level for tool safety annotations (legacy)
- Elicitation
Action - Elicitation user action
- Json
RpcId - JSON-RPC ID type for better type safety
- Json
RpcMessage - Complete JSON-RPC message types (2025-06-18)
- Json
RpcRequest OrNotification - Request or notification union for compatibility
- Json
RpcResponse OrError - Response or error union for compatibility
- Logging
Level - Logging level enumeration (2025-06-18)
- Primitive
Schema Definition - Primitive schema definition for elicitation
- Resource
Contents - Content of a resource (2025-06-18)
- Role
- Message role
- Sampling
Content - Content types allowed in sampling (subset of ContentBlock)
- Stop
Reason - Reasons why sampling stopped
Constants§
- JSONRPC_
VERSION - LATEST_
PROTOCOL_ VERSION - MCP Protocol version (2025-06-18)
- PROTOCOL_
VERSION
Type Aliases§
- Client
Info - Content
- Cursor
- Cursor for pagination
- Json
RpcBatch Request - Batch request type alias for compatibility
- Json
RpcBatch Response - Batch response type alias for compatibility
- Progress
Token - Progress token for associating notifications with requests
- Prompt
Info - Prompt
Result - Request
Id - Request ID for JSON-RPC correlation
- Resource
Info - Server
Info - Tool
Info - Tool
Result