Expand description
MCP JSON-RPC Protocol Types
This module defines the core JSON-RPC 2.0 protocol types used for communicating with Model Context Protocol (MCP) servers.
Re-exports§
pub use crate::MCP_PROTOCOL_VERSION;
Modules§
- error_
codes - Standard JSON-RPC error codes
Structs§
- Annotations
- Optional annotations for the client.
- Base
Metadata - Base metadata with name (identifier) and title (display name) properties.
- Boolean
Schema - Boolean schema for elicitation forms.
- Call
Tool Params - MCP tools/call request parameters
- Call
Tool Result - MCP tools/call response
- Cancel
Task Params - Parameters for tasks/cancel request.
- Complete
Argument - Argument information for completion.
- Complete
Context - Additional context for completions.
- Complete
Params - Parameters for completion/complete request.
- Complete
Result - Response to a completion/complete request.
- Completion
Data - Completion data.
- Create
Message Params - Parameters for sampling/createMessage request.
- Create
Message Result - The client’s response to a sampling/createMessage request.
- Create
Task Result - A response to a task-augmented request.
- Elicit
Request Form Params - Parameters for elicitation/create request with form mode.
- Elicit
Request UrlParams - Parameters for elicitation/create request with URL mode.
- Elicit
Result - The client’s response to an elicitation request.
- Elicitation
Complete Params - Parameters for notifications/elicitation/complete notification.
- GetTask
Params - Parameters for tasks/get request.
- GetTask
Payload Params - Parameters for tasks/result request.
- Icon
- An optionally-sized icon that can be displayed in a user interface.
- Implementation
- MCP Implementation info (server or client). Describes the MCP implementation with name, version, icons, and description.
- Json
RpcError - JSON-RPC 2.0 Error
- Json
RpcNotification - JSON-RPC 2.0 Notification (no id, no response expected)
- Json
RpcRequest - JSON-RPC 2.0 Request
- Json
RpcResponse - JSON-RPC 2.0 Response
- List
Roots Result - Response to a roots/list request.
- List
Tasks Params - Parameters for tasks/list request.
- List
Tasks Result - Response to a tasks/list request.
- List
Tools Params - MCP tools/list request parameters
- List
Tools Result - MCP tools/list response
- Logging
Message Params - Parameters for notifications/message notification.
- McpCapabilities
- MCP server capabilities (legacy format).
- McpTool
Definition - MCP Tool Definition (from tools/list response)
- Model
Hint - Hints to use for model selection.
- Model
Preferences - The server’s preferences for model selection.
- Multi
Select Enum Items - Multi-select enum item schema (untitled).
- Number
Schema - Number schema for elicitation forms.
- Progress
Notification Params - Parameters for notifications/progress notification.
- Prompt
Reference - A reference to a prompt.
- Related
Task Metadata - Metadata for associating messages with a task.
- Resource
Template Reference - A reference to a resource or resource template.
- Root
- Represents a root directory or file that the server can operate on.
- Sampling
Message - Describes a message issued to or received from an LLM API.
- SetLevel
Params - Parameters for logging/setLevel request.
- String
Schema - String schema for elicitation forms.
- Task
- Data associated with a task.
- Task
Metadata - Metadata for augmenting a request with task execution.
- Task
Status Notification Params - Parameters for notifications/tasks/status notification.
- Titled
Enum Option - Single-select enum option with title.
- Titled
Multi Select Enum Items - Multi-select enum item schema (titled).
- Tool
Annotations - Additional properties describing a Tool to clients. NOTE: all properties in ToolAnnotations are hints.
- Tool
Choice - Controls tool selection behavior for sampling requests.
- Tool
Execution - Execution-related properties for a tool.
- Tool
Input Schema - JSON Schema for tool inputs (legacy format)
- Tool
Result Content - The result of a tool use, provided by the user back to the assistant.
- Tool
UseContent - A request from the assistant to call a tool.
Enums§
- Client
Inbound - Inbound message from client to server.
- Elicit
Action - User action in response to an elicitation.
- Elicit
Request Params - Parameters for elicitation/create request.
- Icon
Theme - Theme specifier for an icon.
- Json
RpcId - JSON-RPC ID can be string, number, or null
- Json
RpcMessage - A JSON-RPC message that can be any of request, response, or notification. Used for parsing incoming messages when the type is unknown.
- Json
RpcPayload - Logging
Level - The severity of a log message (RFC-5424 syslog severities).
- Progress
Token - A progress token, used to associate progress notifications with the original request.
- Role
- The sender or recipient of messages and data in a conversation.
- Sampling
Content - Sampling message content block types.
- Server
Outbound - Outbound message from server to client.
- Stop
Reason - Standard stop reasons for sampling.
- String
Schema Format - Format options for string schema.
- Task
Status - The status of a task.
- Task
Support - Indicates whether a tool supports task-augmented execution.
- Tool
Choice Mode - Controls tool selection behavior for sampling requests.
- Tool
Content - Tool execution content (text, image, audio, or resource types)
Type Aliases§
- McpServer
Info - MCP server information (legacy alias for Implementation).