mcp_protocol_sdk/protocol/
mod.rs

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