Skip to content

Commit 6c7b555

Browse files
authored
feat!: support mcp protocol version 2025-11-25 (#93)
* feat: add schema for mcp protocol version 2025-11-25 * chore: update readme * chore: generate fresh schemas * chore: last update * chore: set minimum rust version
1 parent c20f9e0 commit 6c7b555

34 files changed

+26119
-3861
lines changed

Cargo.toml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ documentation = "https://docs.rs/rust-mcp-schema"
99
keywords = ["rust-mcp-stack", "model", "context", "protocol", "schema"]
1010
license = "MIT"
1111
edition = "2021"
12+
rust-version = "1.80.0"
13+
1214

1315
[lib]
1416
path = "src/rust-mcp-schema.rs"
@@ -24,24 +26,26 @@ json5 = { version = "0.4" }
2426

2527

2628
[package.metadata.docs.rs]
27-
features = ["2025_06_18", "schema_utils"]
29+
features = ["2025_11_25", "schema_utils"]
2830
rustdoc-args = ["--generate-link-to-definition"]
2931

3032
[package.metadata.playground]
31-
features = ["2025_06_18", "schema_utils"]
33+
features = ["2025_11_25", "schema_utils"]
3234

3335
### FEATURES #################################################################
3436

3537
# Features to enable different schema versions and associated schema_utils
3638
[features]
3739

3840
# default features
39-
default = ["2025_06_18", "schema_utils"] # Default features
41+
default = ["2025_11_25", "schema_utils"] # Default features
4042

4143
# activates the latest MCP schema version, this will be updated once a new version of schema is published
42-
latest = ["2025_06_18"]
44+
latest = ["2025_11_25"]
45+
# enabled mcp schema version 2025_11_25
46+
2025_11_25 = ["latest"]
4347
# enabled mcp schema version 2025_06_18
44-
2025_06_18 = ["latest"]
48+
2025_06_18 = []
4549
# enabled mcp schema version 2025_03_26
4650
2025_03_26 = []
4751
# enabled mcp schema version 2024_11_05

README.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@
99
[<img alt="build status" src="https://img.shields.io/github/actions/workflow/status/rust-mcp-stack/rust-mcp-schema/ci.yml?style=for-the-badge" height="22">
1010
](https://github.com/rust-mcp-stack/rust-mcp-schema/actions/workflows/ci.yml)
1111

12-
A type-safe Rust implementation of the official Model Context Protocol (MCP) schema, supporting all official released versions including `2025_06_18`, `2025_03_26`, `2024_11_05` and `draft` version for early adoption.
12+
A type-safe Rust implementation of the official Model Context Protocol (MCP) schema, supporting all official MCP Protocol versions:
13+
14+
- `2025-11-25`
15+
- `2025-06-18`
16+
- `2025-03-26`
17+
- `2024-11-05`
18+
- `draft`
1319

1420
The MCP schemas in this repository are [automatically generated](#how-are-schemas-generated) from the official Model Context Protocol, ensuring they are always up-to-date and aligned with the latest official specifications.
1521

@@ -46,7 +52,7 @@ Focus on your app's logic while [rust-mcp-sdk](https://crates.io/crates/rust-mcp
4652

4753
- 🧩 Type-safe implementation of the MCP protocol specification.
4854
- 💎 Auto-generated schemas are always synchronized with the official schema specifications.
49-
- 📜 Includes all official released versions : `2025_06_18`, `2025_03_26`, `2024_11_05` and `draft` version for early adoption.
55+
- 📜 Includes all official released versions : `2025-11-25`, `2025-06-18`, `2025-03-26`, `2024-11-05` and `draft` version for early adoption.
5056
- 🛠 Complimentary schema utility module (schema_utils) to boost productivity and ensure development integrity.
5157

5258
## How can this crate be used?
@@ -70,9 +76,10 @@ For more information on the MCP architecture, refer to the [official documentati
7076

7177
This repository provides all official released versions the schema , including draft version, enabling you to prepare and adapt your applications ahead of upcoming official schema releases.
7278

73-
- [2025_06_18](src/generated_schema/2025_06_18)
74-
- [2025_03_26](src/generated_schema/2025_03_26)
75-
- [2024_11_05](src/generated_schema/2024_11_05)
79+
- [2025-11-25](src/generated_schema/2025_11_25)
80+
- [2025-06-18](src/generated_schema/2025_06_18)
81+
- [2025-03-26](src/generated_schema/2025_03_26)
82+
- [2024-11-05](src/generated_schema/2024_11_05)
7683
- [draft](src/generated_schema/draft)
7784

7885
### How to switch between different schema versions?
@@ -83,19 +90,19 @@ Each schema version has a corresponding Cargo feature that can be enabled in you
8390

8491
Multiple schema versions may be enabled concurrently if needed. Non-default versions are available under explicitly named modules, for example:
8592

86-
- rust_mcp_schema::mcp_2024_11_05
93+
- rust_mcp_schema::mcp_2025_06_18
8794
- rust_mcp_schema::mcp_draft"
8895

89-
Example: enable `2024_11_05` version of the schema:
96+
Example: enable `2025-06-18` version of the schema:
9097

9198
<!-- x-release-please-start-version -->
9299

93100
```toml
94101
# Cargo.toml
95-
rust-mcp-schema = { version: 0.7.5 , default-features = false, features=["2024_11_05"] }
102+
rust-mcp-schema = { version: 0.7.5 , default-features = false, features=["2025_06_18"] }
96103
```
97104

98-
Example: enable `draft`` version of the schema (2024_11_05) :
105+
Example: enable `draft`` version of the schema :
99106

100107
```toml
101108
#Cargo.toml

examples/mcp_client_handle_message.rs

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ mod schema {
44
pub use rust_mcp_schema::*;
55
}
66

7+
#[cfg(feature = "2025_06_18")]
8+
mod schema {
9+
pub use rust_mcp_schema::mcp_2025_06_18::schema_utils::*;
10+
pub use rust_mcp_schema::mcp_2025_06_18::*;
11+
}
12+
713
#[cfg(feature = "2024_11_05")]
814
mod schema {
915
pub use rust_mcp_schema::mcp_2024_11_05::schema_utils::*;
@@ -77,10 +83,26 @@ fn handle_message(message_payload: &str) -> std::result::Result<(), AppError> {
7783
ServerRequest::ListRootsRequest(list_roots_request) => {
7884
dbg!(list_roots_request);
7985
}
80-
#[cfg(any(feature = "2025_06_18", feature = "draft"))]
86+
#[cfg(any(feature = "2025_06_18", feature = "2025_11_25", feature = "draft"))]
8187
ServerRequest::ElicitRequest(elicit_request) => {
8288
dbg!(elicit_request);
8389
}
90+
#[cfg(any(feature = "2025_11_25", feature = "draft"))]
91+
ServerRequest::GetTaskRequest(get_task_request) => {
92+
dbg!(get_task_request);
93+
}
94+
#[cfg(any(feature = "2025_11_25", feature = "draft"))]
95+
ServerRequest::GetTaskPayloadRequest(get_task_payload_request) => {
96+
dbg!(get_task_payload_request);
97+
}
98+
#[cfg(any(feature = "2025_11_25", feature = "draft"))]
99+
ServerRequest::CancelTaskRequest(cancel_task_request) => {
100+
dbg!(cancel_task_request);
101+
}
102+
#[cfg(any(feature = "2025_11_25", feature = "draft"))]
103+
ServerRequest::ListTasksRequest(list_tasks_request) => {
104+
dbg!(list_tasks_request);
105+
}
84106
}
85107
}
86108
// Check if it's a CustomRequest; the value can be deserialized into your own custom types.
@@ -115,6 +137,14 @@ fn handle_message(message_payload: &str) -> std::result::Result<(), AppError> {
115137
ServerNotification::LoggingMessageNotification(logging_message_notification) => {
116138
dbg!(logging_message_notification);
117139
}
140+
#[cfg(any(feature = "2025_11_25", feature = "draft"))]
141+
ServerNotification::TaskStatusNotification(task_status_notification) => {
142+
dbg!(task_status_notification);
143+
}
144+
#[cfg(any(feature = "2025_11_25", feature = "draft"))]
145+
ServerNotification::ElicitationCompleteNotification(elicitation_complete_notification) => {
146+
dbg!(elicitation_complete_notification);
147+
}
118148
}
119149
}
120150
// Check if it's a CustomNotification; the value can be deserialized into your custom types.
@@ -156,6 +186,22 @@ fn handle_message(message_payload: &str) -> std::result::Result<(), AppError> {
156186
ServerResult::CompleteResult(complete_result) => {
157187
dbg!(complete_result);
158188
}
189+
#[cfg(any(feature = "2025_11_25", feature = "draft"))]
190+
ServerResult::GetTaskResult(get_task_result) => {
191+
dbg!(get_task_result);
192+
}
193+
#[cfg(any(feature = "2025_11_25", feature = "draft"))]
194+
ServerResult::GetTaskPayloadResult(get_task_payload_result) => {
195+
dbg!(get_task_payload_result);
196+
}
197+
#[cfg(any(feature = "2025_11_25", feature = "draft"))]
198+
ServerResult::CancelTaskResult(cancel_task_result) => {
199+
dbg!(cancel_task_result);
200+
}
201+
#[cfg(any(feature = "2025_11_25", feature = "draft"))]
202+
ServerResult::ListTasksResult(list_tasks_result) => {
203+
dbg!(list_tasks_result);
204+
}
159205
},
160206
// Check if it's a CustomResult; the value can be deserialized into your custom types.
161207
ResultFromServer::CustomResult(value) => {

examples/mcp_server_handle_message.rs

Lines changed: 43 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ mod schema {
44
pub use rust_mcp_schema::*;
55
}
66

7+
#[cfg(feature = "2025_06_18")]
8+
mod schema {
9+
pub use rust_mcp_schema::mcp_2025_06_18::schema_utils::*;
10+
pub use rust_mcp_schema::mcp_2025_06_18::*;
11+
}
12+
713
#[cfg(feature = "2024_11_05")]
814
mod schema {
915
pub use rust_mcp_schema::mcp_2024_11_05::schema_utils::*;
@@ -68,53 +74,58 @@ fn handle_message(message_payload: &str) -> std::result::Result<(), AppError> {
6874
ClientRequest::InitializeRequest(initialize_request) => {
6975
dbg!(initialize_request);
7076
}
71-
7277
ClientRequest::PingRequest(ping_request) => {
7378
dbg!(ping_request);
7479
}
7580
ClientRequest::ListResourcesRequest(list_resources_request) => {
7681
dbg!(list_resources_request);
7782
}
78-
7983
ClientRequest::ListResourceTemplatesRequest(list_resource_templates_request) => {
8084
dbg!(list_resource_templates_request);
8185
}
82-
8386
ClientRequest::ReadResourceRequest(read_resource_request) => {
8487
dbg!(read_resource_request);
8588
}
86-
8789
ClientRequest::SubscribeRequest(subscribe_request) => {
8890
dbg!(subscribe_request);
8991
}
90-
9192
ClientRequest::UnsubscribeRequest(unsubscribe_request) => {
9293
dbg!(unsubscribe_request);
9394
}
94-
9595
ClientRequest::ListPromptsRequest(list_prompts_request) => {
9696
dbg!(list_prompts_request);
9797
}
98-
9998
ClientRequest::GetPromptRequest(get_prompt_request) => {
10099
dbg!(get_prompt_request);
101100
}
102-
103101
ClientRequest::ListToolsRequest(list_tools_request) => {
104102
dbg!(list_tools_request);
105103
}
106-
107104
ClientRequest::CallToolRequest(call_tool_request) => {
108105
dbg!(call_tool_request);
109106
}
110-
111107
ClientRequest::SetLevelRequest(set_level_request) => {
112108
dbg!(set_level_request);
113109
}
114-
115110
ClientRequest::CompleteRequest(complete_request) => {
116111
dbg!(complete_request);
117112
}
113+
#[cfg(any(feature = "2025_11_25", feature = "draft"))]
114+
ClientRequest::GetTaskRequest(get_task_request) => {
115+
dbg!(get_task_request);
116+
}
117+
#[cfg(any(feature = "2025_11_25", feature = "draft"))]
118+
ClientRequest::GetTaskPayloadRequest(get_task_payload_request) => {
119+
dbg!(get_task_payload_request);
120+
}
121+
#[cfg(any(feature = "2025_11_25", feature = "draft"))]
122+
ClientRequest::CancelTaskRequest(cancel_task_request) => {
123+
dbg!(cancel_task_request);
124+
}
125+
#[cfg(any(feature = "2025_11_25", feature = "draft"))]
126+
ClientRequest::ListTasksRequest(list_tasks_request) => {
127+
dbg!(list_tasks_request);
128+
}
118129
},
119130

120131
// Check if it's a CustomRequest; the value can be deserialized into your own custom types.
@@ -132,18 +143,19 @@ fn handle_message(message_payload: &str) -> std::result::Result<(), AppError> {
132143
ClientNotification::CancelledNotification(cancelled_notification) => {
133144
dbg!(cancelled_notification);
134145
}
135-
136146
ClientNotification::InitializedNotification(initialized_notification) => {
137147
dbg!(initialized_notification);
138148
}
139-
140149
ClientNotification::ProgressNotification(progress_notification) => {
141150
dbg!(progress_notification);
142151
}
143-
144152
ClientNotification::RootsListChangedNotification(progress_notification) => {
145153
dbg!(progress_notification);
146154
}
155+
#[cfg(any(feature = "2025_11_25", feature = "draft"))]
156+
ClientNotification::TaskStatusNotification(task_status_notification) => {
157+
dbg!(task_status_notification);
158+
}
147159
}
148160
}
149161

@@ -166,10 +178,26 @@ fn handle_message(message_payload: &str) -> std::result::Result<(), AppError> {
166178
ClientResult::ListRootsResult(list_roots_result) => {
167179
dbg!(list_roots_result);
168180
}
169-
#[cfg(any(feature = "2025_06_18", feature = "draft"))]
181+
#[cfg(any(feature = "2025_06_18", feature = "2025_11_25", feature = "draft"))]
170182
ClientResult::ElicitResult(elicit_result) => {
171183
dbg!(elicit_result);
172184
}
185+
#[cfg(any(feature = "2025_11_25", feature = "draft"))]
186+
ClientResult::GetTaskResult(get_task_result) => {
187+
dbg!(get_task_result);
188+
}
189+
#[cfg(any(feature = "2025_11_25", feature = "draft"))]
190+
ClientResult::GetTaskPayloadResult(get_task_payload_result) => {
191+
dbg!(get_task_payload_result);
192+
}
193+
#[cfg(any(feature = "2025_11_25", feature = "draft"))]
194+
ClientResult::CancelTaskResult(cancel_task_result) => {
195+
dbg!(cancel_task_result);
196+
}
197+
#[cfg(any(feature = "2025_11_25", feature = "draft"))]
198+
ClientResult::ListTasksResult(list_tasks_result) => {
199+
dbg!(list_tasks_result);
200+
}
173201
},
174202

175203
// Check if it's a CustomResult; the value can be deserialized into your custom types.

rust-toolchain.toml

Lines changed: 0 additions & 3 deletions
This file was deleted.

scripts/run_clippy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
COMMON_FEATURES=("schema_utils")
55

66
# schema versions features (passed to clippy one at a time)
7-
SCHEMA_VERSION_FEATURES=("2025_06_18", "2025_03_26", "2024_11_05", "draft")
7+
SCHEMA_VERSION_FEATURES=("2025_11_25", "2025_06_18", "2025_03_26", "2024_11_05", "draft")
88

99
# space-separated string
1010
COMMON_FEATURES_STR="${COMMON_FEATURES[*]}"

scripts/run_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
COMMON_FEATURES=("schema_utils")
55

66
# schema versions features (tested one at a time)
7-
SCHEMA_VERSION_FEATURES=("2025_06_18", "2025_03_26", "2024_11_05") #// TODO: add the "draft" tests back
7+
SCHEMA_VERSION_FEATURES=("2025_11_25", "2025_06_18", "2025_03_26", "2024_11_05") #// TODO: add the "draft" tests back
88

99
# space-separated string
1010
COMMON_FEATURES_STR="${COMMON_FEATURES[*]}"

src/generated_schema.rs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ macro_rules! define_schema_version {
3131
};
3232
}
3333

34-
/// Latest MCP Protocol 2025_06_18
35-
#[cfg(feature = "2025_06_18")]
36-
pub use mcp_2025_06_18::*;
34+
/// Latest MCP Protocol 2025_11_25
35+
#[cfg(feature = "2025_11_25")]
36+
pub use mcp_2025_11_25::*;
3737

3838
#[cfg(feature = "2025_06_18")]
3939
define_schema_version!(
@@ -68,6 +68,17 @@ define_schema_version!(
6868
__int_utils_2024_11_05
6969
);
7070

71+
#[cfg(feature = "2025_11_25")]
72+
define_schema_version!(
73+
"2025_11_25",
74+
mcp_2025_11_25,
75+
"generated_schema/2025_11_25/mcp_schema.rs",
76+
"generated_schema/2025_11_25/schema_utils.rs",
77+
"generated_schema/2025_11_25/validators.rs",
78+
__int_2025_11_25,
79+
__int_utils_2025_11_25
80+
);
81+
7182
#[cfg(feature = "draft")]
7283
define_schema_version!(
7384
"draft",

0 commit comments

Comments
 (0)