Skip to content

Commit 6cbc3da

Browse files
authored
feat!: update crates to default to the latest MCP schema version. (#35)
* refactor: introduce middleware , sessionId generation * chore: dynamic route for messages * chore add tests * feat: accpt custom session id generator * feat: implement shutdown signal to server - improved sse architecture
1 parent 5a3638f commit 6cbc3da

File tree

27 files changed

+912
-150
lines changed

27 files changed

+912
-150
lines changed

Cargo.lock

Lines changed: 19 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ rust-mcp-sdk = { path = "crates/rust-mcp-sdk", default-features = false }
2121
rust-mcp-macros = { version = "0.2.1", path = "crates/rust-mcp-macros" }
2222

2323
# External crates
24-
rust-mcp-schema = { version = "0.4" }
24+
rust-mcp-schema = { version = "0.5" }
2525
futures = { version = "0.3" }
2626
tokio = { version = "1.4", features = ["full"] }
2727
serde = { version = "1.0", features = ["derive", "serde_derive"] }

crates/rust-mcp-macros/Cargo.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,16 @@ workspace = true
2828

2929
[lib]
3030
proc-macro = true
31+
32+
33+
[features]
34+
# defalt features
35+
default = ["2025_03_26"] # Default features
36+
37+
# activates the latest MCP schema version, this will be updated once a new version of schema is published
38+
latest = ["2025_03_26"]
39+
40+
# enabled mcp schema version 2025_03_26
41+
2025_03_26 = ["rust-mcp-schema/2025_03_26"]
42+
# enabled mcp schema version 2024_11_05
43+
2024_11_05 = ["rust-mcp-schema/2024_11_05"]

crates/rust-mcp-macros/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ The `mcp_tool` macro generates an implementation for the annotated struct that i
1919
#[mcp_tool(
2020
name = "write_file",
2121
description = "Create a new file or completely overwrite an existing file with new content."
22+
destructive_hint = false
23+
idempotent_hint = false
24+
open_world_hint = false
25+
read_only_hint = false
2226
)]
2327
#[derive(rust_mcp_macros::JsonSchema)]
2428
pub struct WriteFileTool {
@@ -60,3 +64,11 @@ fn main() {
6064
<img align="top" src="assets/rust-mcp-stack-icon.png" width="24" style="border-radius:0.2rem;"> Check out [rust-mcp-sdk](https://github.com/rust-mcp-stack/rust-mcp-sdk) , a high-performance, asynchronous toolkit for building MCP servers and clients. Focus on your app's logic while [rust-mcp-sdk](https://github.com/rust-mcp-stack/rust-mcp-sdk) takes care of the rest!
6165

6266
---
67+
68+
69+
**Note**: The following attributes are available only in version `2025_03_26` and later of the MCP Schema, and their values will be used in the [annotations](https://github.com/rust-mcp-stack/rust-mcp-schema/blob/main/src/generated_schema/2025_03_26/mcp_schema.rs#L5557) attribute of the *[Tool struct](https://github.com/rust-mcp-stack/rust-mcp-schema/blob/main/src/generated_schema/2025_03_26/mcp_schema.rs#L5554-L5566).
70+
71+
- `destructive_hint`
72+
- `idempotent_hint`
73+
- `open_world_hint`
74+
- `read_only_hint`

0 commit comments

Comments
 (0)