mcp_protocol_sdk/protocol/
mod.rs

1//! MCP protocol implementation (2025-03-26)
2//!
3//! This module contains the core protocol types and message handling for the
4//! Model Context Protocol version 2025-03-26, including JSON-RPC message
5//! serialization, validation, and new features like audio content, annotations,
6//! and enhanced capabilities.
7
8pub mod messages;
9pub mod methods;
10pub mod missing_types;
11pub mod types;
12pub mod types_2025;
13pub mod validation;
14
15// Re-export commonly used types and constants
16pub use messages::*;
17pub use missing_types::*;
18pub use types::*;
19pub use validation::*;
20
21// Re-export method constants for convenience
22pub use methods::{
23    CANCELLED, COMPLETION_COMPLETE, INITIALIZE, INITIALIZED, LOGGING_MESSAGE, LOGGING_SET_LEVEL,
24    PING, PROGRESS, PROMPTS_GET, PROMPTS_LIST, PROMPTS_LIST_CHANGED, RESOURCES_LIST,
25    RESOURCES_LIST_CHANGED, RESOURCES_READ, RESOURCES_SUBSCRIBE, RESOURCES_TEMPLATES_LIST,
26    RESOURCES_UNSUBSCRIBE, RESOURCES_UPDATED, ROOTS_LIST, ROOTS_LIST_CHANGED,
27    SAMPLING_CREATE_MESSAGE, TOOLS_CALL, TOOLS_LIST, TOOLS_LIST_CHANGED,
28};
29
30// Re-export 2025-03-26 specific constants and error codes
31pub use types::error_codes;
32pub use types::{JSONRPC_VERSION, LATEST_PROTOCOL_VERSION};
33
34// Legacy constant for compatibility
35pub const MCP_PROTOCOL_VERSION: &str = LATEST_PROTOCOL_VERSION;
36
37// Export types_2025 for comprehensive tests
38pub use types_2025 as types_2025_comprehensive;