turbomcp_protocol/types/
mod.rs

1//! MCP Protocol Types Module
2//!
3//! This module contains all the type definitions for the Model Context Protocol
4//! organized into focused submodules based on the MCP 2025-06-18 specification.
5//!
6//! # Module Organization
7//!
8//! - [`crate::types::core`] - Core protocol types and utilities
9//! - [`crate::types::domain`] - Validated domain types (Uri, MimeType, Base64String)
10//! - [`crate::types::capabilities`] - Client/server capability negotiation
11//! - [`crate::types::content`] - Message content types (text, image, audio, resources)
12//! - [`crate::types::requests`] - Request/response/notification enums
13//! - [`crate::types::initialization`] - Connection handshake types
14//! - [`crate::types::tools`] - Tool calling and execution
15//! - [`crate::types::prompts`] - Prompt templates
16//! - [`crate::types::resources`] - Resource access and templates
17//! - [`crate::types::logging`] - Logging and progress tracking
18//! - [`crate::types::sampling`] - LLM sampling (MCP 2025-06-18)
19//! - [`crate::types::elicitation`] - User input elicitation (MCP 2025-06-18)
20//! - [`crate::types::roots`] - Filesystem boundaries (MCP 2025-06-18)
21//! - [`crate::types::completion`] - Argument autocompletion
22//! - [`crate::types::ping`] - Connection testing
23//! - [`crate::types::tasks`] - Tasks API for durable operations (MCP 2025-11-25 draft)
24
25pub mod capabilities;
26pub mod completion;
27pub mod content;
28pub mod core;
29pub mod domain;
30pub mod elicitation;
31pub mod initialization;
32pub mod logging;
33pub mod ping;
34pub mod prompts;
35pub mod requests;
36pub mod resources;
37pub mod roots;
38pub mod sampling;
39#[cfg(feature = "mcp-tasks")]
40pub mod tasks;
41pub mod tools;
42
43// Re-export all types for backward compatibility
44pub use capabilities::*;
45pub use completion::*;
46pub use content::*;
47pub use core::*;
48pub use elicitation::*;
49pub use initialization::*;
50pub use logging::*;
51pub use ping::*;
52pub use prompts::*;
53pub use requests::*;
54pub use resources::*;
55pub use roots::*;
56pub use sampling::{ModelHint, *};
57#[cfg(feature = "mcp-tasks")]
58pub use tasks::*;
59pub use tools::*;
60
61// Re-export validated domain types (these have the same names as type aliases in core,
62// but are distinct types with validation. Core type aliases are preferred for backward compat)
63pub use domain::{
64    Base64Error,
65    MimeTypeError,
66    UriError,
67    // Note: Uri, MimeType, and Base64String from domain are NOT glob re-exported
68    // to avoid ambiguity with the type aliases in core. Access them via domain::Uri, etc.
69};