Expand description
MCP protocol types based on JSON-RPC 2.0
These types follow the MCP specification (2025-11-25): https://modelcontextprotocol.io/specification/2025-11-25
Modules§
- notifications
- MCP notification methods
Structs§
- Boolean
Schema - Boolean field schema
- Call
Tool Params - Call
Tool Result - Result of a tool invocation.
- Cancel
Task Params - Parameters for cancelling a task
- Cancel
Task Result - Result of cancelling a task
- Cancelled
Params - Parameters for cancellation notification
- Client
Capabilities - Complete
Params - Parameters for completion/complete request
- Complete
Result - Result of completion/complete request
- Completion
- Completion suggestions
- Completion
Argument - Argument being completed
- Completions
Capability - Server capability for providing completions
- Content
Annotations - Annotations for content items
- Create
Message Params - Parameters for sampling/createMessage request
- Create
Message Result - Result of sampling/createMessage request
- Elicit
Form Params - Parameters for form-based elicitation request
- Elicit
Form Schema - Restricted JSON Schema for elicitation forms
- Elicit
Result - Result of an elicitation request
- Elicit
UrlParams - Parameters for URL-based elicitation request
- Elicitation
Capability - Client capability for elicitation (requesting user input)
- Elicitation
Complete Params - Parameters for elicitation complete notification
- Elicitation
Form Capability - Marker for form-based elicitation support
- Elicitation
UrlCapability - Marker for URL-based elicitation support
- Empty
Result - Enqueue
Task Params - Parameters for enqueuing a task
- Enqueue
Task Result - Result of enqueuing a task
- GetPrompt
Params - GetPrompt
Result - GetPrompt
Result Builder - Builder for constructing
GetPromptResultwith multiple messages. - GetTask
Info Params - Parameters for getting task info
- GetTask
Result Params - Parameters for getting task result
- GetTask
Result Result - Result of getting task result
- Implementation
- Information about a client or server implementation
- Initialize
Params - Initialize
Result - Integer
Schema - Integer field schema
- Json
RpcError Response - JSON-RPC 2.0 error response.
- Json
RpcNotification - JSON-RPC 2.0 notification (no response expected)
- Json
RpcRequest - JSON-RPC 2.0 request.
- Json
RpcResult Response - JSON-RPC 2.0 success response.
- List
Prompts Params - List
Prompts Result - List
Resource Templates Params - Parameters for listing resource templates
- List
Resource Templates Result - Result of listing resource templates
- List
Resources Params - List
Resources Result - List
Roots Params - Parameters for roots/list request (server to client)
- List
Roots Result - Result of roots/list request
- List
Tasks Params - Parameters for listing tasks
- List
Tasks Result - Result of listing tasks
- List
Tools Params - List
Tools Result - Logging
Capability - Logging capability declaration
- Logging
Message Params - Parameters for logging message notification
- Model
Hint - Hint for model selection
- Model
Preferences - Preferences for model selection during sampling
- Multi
Select Enum Items - Items definition for multi-select enum
- Multi
Select Enum Schema - Multi-select enum schema
- Number
Schema - Number field schema
- Progress
Params - Parameters for progress notification
- Prompt
Argument - Prompt
Definition - Prompt
Message - Prompt
Reference - Reference to a prompt for completion
- Prompts
Capability - Read
Resource Params - Read
Resource Result - Request
Meta - Request metadata that can include progress token
- Resource
Content - Content of an embedded resource.
- Resource
Definition - Resource
Reference - Reference to a resource for completion
- Resource
Template Definition - Definition of a resource template as returned by resources/templates/list
- Resources
Capability - Root
- Represents a root directory or file that the server can operate on
- Roots
Capability - Client capability for roots (filesystem access)
- Sampling
Capability - Sampling
Message - Message for sampling request
- Sampling
Tool - Tool definition for use in sampling requests (SEP-1577)
- Server
Capabilities - SetLog
Level Params - Parameters for setting log level
- Single
Select Enum Schema - Single-select enum schema
- String
Schema - String field schema
- Subscribe
Resource Params - Task
Info - Information about a task
- Task
Status Changed Params - Notification params when task status changes
- Tasks
Capability - Capability for async task management
- Tool
Annotations - Annotations describing tool behavior for trust and safety. Clients MUST consider these untrusted unless the server is trusted.
- Tool
Choice - Tool choice mode for sampling requests (SEP-1577)
- Tool
Definition - Tool definition as returned by tools/list
- Tool
Icon - Icon for tool display in user interfaces
- Tools
Capability - Unsubscribe
Resource Params
Enums§
- Completion
Reference - Reference for completion - either a prompt or resource reference
- Content
- Content types for tool results, resources, and prompts.
- Content
Role - Role indicating who content is intended for.
- Elicit
Action - User action in response to elicitation
- Elicit
Field Value - Value from an elicitation form field
- Elicit
Mode - Elicitation mode
- Elicit
Request Params - Elicitation request parameters (union of form and URL modes)
- Include
Context - Context inclusion mode for sampling
- Json
RpcMessage - JSON-RPC 2.0 message - can be a single request or a batch
- Json
RpcResponse - JSON-RPC 2.0 response (either success or error).
- Json
RpcResponse Message - JSON-RPC 2.0 response message - can be a single response or a batch
- LogLevel
- Log severity levels following RFC 5424 (syslog)
- McpNotification
- High-level MCP notification (parsed from JSON-RPC)
- McpRequest
- High-level MCP request (parsed from JSON-RPC)
- McpResponse
- High-level MCP response
- Primitive
Schema Definition - Primitive schema definition for form fields
- Progress
Token - Progress token - can be string or number
- Prompt
Role - Request
Id - Request ID - can be string or number per JSON-RPC spec
- Sampling
Content - Content types for sampling messages
- Sampling
Content OrArray - Content that can be either a single item or an array (for CreateMessageResult)
- Task
Status - Status of an async task
Constants§
- JSONRPC_
VERSION - The JSON-RPC version. MUST be “2.0”.
- LATEST_
PROTOCOL_ VERSION - The latest supported MCP protocol version.
- SUPPORTED_
PROTOCOL_ VERSIONS - All supported MCP protocol versions (newest first).
Type Aliases§
- GetTask
Info Result - Result of getting task info