Module prelude

Module prelude 

Source

Macros§

json
Construct a serde_json::Value from a JSON literal.

Structs§

Annotations
Generic annotations structure (matches TypeScript Annotations) Used across all MCP types that support client annotations
CallToolParams
Parameters for tools/call request (matches TypeScript CallToolRequest.params)
CallToolRequest
Complete tools/call request (matches TypeScript CallToolRequest interface)
CallToolResult
Result for tools/call (per MCP spec)
ClientCapabilities
Capabilities that a client may support
CreateMessageResult
Result for sampling/createMessage (per MCP spec)
Cursor
Cursor for pagination support
GetPromptParams
Parameters for prompts/get request (matches MCP GetPromptRequest.params exactly)
HashMap
A hash map implemented with quadratic probing and SIMD lookup.
Implementation
Describes the name and version of an MCP implementation
InitializeRequest
Parameters for initialize request
JsonRpcNotification
A JSON-RPC 2.0 notification (no response expected)
JsonRpcRequest
A standard JSON-RPC 2.0 request
JsonRpcResponse
A standard JSON-RPC 2.0 response
ListResourcesParams
Parameters for resources/list request
LoggingMessageNotification
Method: “notifications/message”
LoggingMessageNotificationParams
Notification
Base notification structure following MCP TypeScript specification
NotificationParams
Base notification parameters that can include _meta
ProgressNotification
Method: “notifications/progress”
ProgressNotificationParams
Prompt
A prompt descriptor (matches TypeScript Prompt interface exactly)
PromptArgument
Argument definition for prompts (extends BaseMetadata per MCP spec)
PromptMessage
Message content for prompts (matches MCP PromptMessage interface exactly)
ReadResourceParams
Parameters for resources/read request
Resource
A resource descriptor (matches TypeScript Resource interface) Resource extends BaseMetadata, so it includes name and title fields
ResourceTemplate
A template description for resources available on the server ResourceTemplate extends BaseMetadata
ResourceUpdatedNotification
Method: “notifications/resources/updated”
ResourceUpdatedNotificationParams
SamplingMessage
Sampling message (per MCP spec)
Tool
Tool definition
ToolSchema
JSON Schema definition for tool input/output (matches TypeScript spec exactly) Must be an object with type: “object”, properties, and required fields

Enums§

ContentBlock
Content block union type matching MCP 2025-06-18 specification exactly
McpError
MCP-specific errors
McpVersion
Supported MCP protocol versions
ResourceContent
Union type for resource contents (matches TypeScript union)
Role
Role enum for messages (per MCP spec)
Value
Represents any valid JSON value.

Traits§

CompletionDefinition
Complete MCP Completion Creation - Build intelligent autocomplete providers for enhanced UX.
HasAnnotations
Annotations trait
HasBaseMetadata
Base metadata trait - matches TypeScript BaseMetadata interface
HasCompletionContext
Trait for completion context (argument, context)
HasCompletionHandling
Trait for completion validation and processing
HasCompletionMetadata
Trait for completion metadata (method, reference type)
HasDescription
Tool description trait
HasInputSchema
Input schema trait
HasLogLevel
Trait for logging level configuration
HasLoggingMetadata
Trait for logging metadata (method, logger name)
HasOutputSchema
Output schema trait
HasPromptAnnotations
Prompt annotations trait
HasPromptArguments
Prompt arguments trait
HasPromptDescription
Prompt description trait
HasPromptMeta
Prompt-specific meta trait (separate from RPC _meta)
HasPromptMetadata
Base metadata trait - matches TypeScript BaseMetadata interface
HasResourceAnnotations
Resource annotations trait
HasResourceDescription
Resource description trait
HasResourceMeta
Resource-specific meta trait (separate from RPC _meta)
HasResourceMetadata
Base metadata trait - matches TypeScript BaseMetadata interface
HasResourceMimeType
Resource MIME type trait
HasResourceSize
Resource size trait
HasResourceUri
Resource URI trait
HasRootAnnotations
Trait for root annotations and custom metadata
HasRootFiltering
Trait for root filtering and exclusions
HasRootMetadata
Trait for root metadata (URI, name, path info)
HasRootPermissions
Trait for root permissions and security
HasSamplingConfig
Trait for sampling configuration (from CreateMessageRequest spec)
HasSamplingContext
Trait for sampling context (from CreateMessageRequest spec)
HasToolMeta
Tool-specific meta trait (separate from RPC _meta)
LoggerDefinition
Complete MCP Logger Creation - Build structured logging systems with level control.
PromptDefinition
Complete prompt definition - composed from fine-grained traits Complete MCP Prompt Creation - Build reusable prompt templates that generate contextual content.
ResourceDefinition
Complete MCP Resource Creation - Build readable resources that clients can access.
RootDefinition
Complete MCP Root Creation - Build secure file system access boundaries.
SamplingDefinition
Complete MCP Sampling Creation - Build AI model interaction and completion systems.
ToolDefinition
Complete tool definition - composed from fine-grained traits Complete MCP Tool Creation - Build executable tools that clients can invoke.

Type Aliases§

McpResult
Common result type for MCP operations
ToolResult
Tool result type - an alias for ContentBlock to maintain backward compatibility while ensuring MCP 2025-06-18 specification compliance