Skip to main content

rust_mcp_schema/
generated_schema.rs

1macro_rules! define_schema_version {
2    (
3        $feature:literal,
4        $mod_name:ident,
5        $schema_path:literal,
6        $utils_path:literal,
7        $validators_path:literal,
8        $schema_mod:ident,
9        $utils_mod:ident
10    ) => {
11        #[cfg(feature = $feature)]
12        #[path = $schema_path]
13        // Doc comments are machine-generated from upstream schema descriptions whose
14        // markdown does not always satisfy clippy's doc-formatting lints.
15        #[allow(clippy::doc_lazy_continuation)]
16        mod $schema_mod;
17
18        #[cfg(all(feature = "schema_utils", feature = $feature))]
19        #[path = $utils_path]
20        mod $utils_mod;
21
22        #[path = $validators_path]
23        mod validators;
24
25        #[cfg(feature = $feature)]
26        pub mod $mod_name {
27            pub use super::$schema_mod::*;
28
29            #[cfg(feature = "schema_utils")]
30            pub mod schema_utils {
31                pub use super::super::$utils_mod::*;
32            }
33        }
34    };
35}
36
37#[cfg(feature = "2025_11_25")]
38pub use mcp_2025_11_25::*;
39
40/// Latest MCP Protocol 2026_07_28
41#[cfg(feature = "2026_07_28")]
42pub use mcp_2026_07_28::*;
43
44/// Draft (pre-release) MCP schema. Shares the 2026-07-28 schema contents.
45/// NOTE: do not enable together with `2026_07_28` (duplicate re-exports).
46#[cfg(feature = "draft")]
47pub use mcp_draft::*;
48
49#[cfg(feature = "2025_06_18")]
50define_schema_version!(
51    "2025_06_18",
52    mcp_2025_06_18,
53    "generated_schema/2025_06_18/mcp_schema.rs",
54    "generated_schema/2025_06_18/schema_utils.rs",
55    "generated_schema/2025_06_18/validators.rs",
56    __int_2025_06_18,
57    __int_utils_2025_06_18
58);
59
60#[cfg(feature = "2025_03_26")]
61define_schema_version!(
62    "2025_03_26",
63    mcp_2025_03_26,
64    "generated_schema/2025_03_26/mcp_schema.rs",
65    "generated_schema/2025_03_26/schema_utils.rs",
66    "generated_schema/2025_03_26/validators.rs",
67    __int_2025_03_26,
68    __int_utils_2025_03_26
69);
70
71#[cfg(feature = "2024_11_05")]
72define_schema_version!(
73    "2024_11_05",
74    mcp_2024_11_05,
75    "generated_schema/2024_11_05/mcp_schema.rs",
76    "generated_schema/2024_11_05/schema_utils.rs",
77    "generated_schema/2024_11_05/validators.rs",
78    __int_2024_11_05,
79    __int_utils_2024_11_05
80);
81
82#[cfg(feature = "2025_11_25")]
83define_schema_version!(
84    "2025_11_25",
85    mcp_2025_11_25,
86    "generated_schema/2025_11_25/mcp_schema.rs",
87    "generated_schema/2025_11_25/schema_utils.rs",
88    "generated_schema/2025_11_25/validators.rs",
89    __int_2025_11_25,
90    __int_utils_2025_11_25
91);
92
93#[cfg(feature = "2026_07_28")]
94define_schema_version!(
95    "2026_07_28",
96    mcp_2026_07_28,
97    "generated_schema/2026_07_28/mcp_schema.rs",
98    "generated_schema/2026_07_28/schema_utils.rs",
99    "generated_schema/2026_07_28/validators.rs",
100    __int_2026_07_28,
101    __int_utils_2026_07_28
102);
103
104#[cfg(feature = "draft")]
105define_schema_version!(
106    "draft",
107    mcp_draft,
108    "generated_schema/draft/mcp_schema.rs",
109    "generated_schema/draft/schema_utils.rs",
110    "generated_schema/draft/validators.rs",
111    __int_draft,
112    __int_utils_draft
113);
114
115#[path = "generated_schema/protocol_version.rs"]
116mod protocol_version;
117pub use protocol_version::*;