Skip to content

feat: multi protocol version support - phase 1 #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ members = [
# Workspace member crates
rust-mcp-transport = { version = "0.3.3", path = "crates/rust-mcp-transport", default-features = false }
rust-mcp-sdk = { path = "crates/rust-mcp-sdk", default-features = false }
rust-mcp-macros = { version = "0.4.0", path = "crates/rust-mcp-macros" }
rust-mcp-macros = { version = "0.4.0", path = "crates/rust-mcp-macros", default-features = false }

# External crates
rust-mcp-schema = { version = "0.5" }
rust-mcp-schema = { version = "0.5", default-features = false }
futures = { version = "0.3" }
tokio = { version = "1.4", features = ["full"] }
serde = { version = "1.0", features = ["derive", "serde_derive"] }
Expand Down
6 changes: 3 additions & 3 deletions crates/rust-mcp-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ quote = "1.0"
proc-macro2 = "1.0"

[dev-dependencies]
rust-mcp-schema = { workspace = true }
rust-mcp-schema = { workspace = true, default-features = false }

[lints]
workspace = true
Expand All @@ -38,7 +38,7 @@ default = ["2025_03_26"] # Default features
latest = ["2025_03_26"]

# enabled mcp schema version 2025_03_26
2025_03_26 = ["rust-mcp-schema/2025_03_26"]
2025_03_26 = ["rust-mcp-schema/2025_03_26","rust-mcp-schema/schema_utils"]
# enabled mcp schema version 2024_11_05
2024_11_05 = ["rust-mcp-schema/2024_11_05"]
2024_11_05 = ["rust-mcp-schema/2024_11_05","rust-mcp-schema/schema_utils"]
sdk = []
17 changes: 15 additions & 2 deletions crates/rust-mcp-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ license = "MIT"
edition = "2021"

[dependencies]
rust-mcp-schema = { workspace = true }
rust-mcp-schema = { workspace = true, default-features=false }
rust-mcp-transport = { workspace = true, default-features = false, optional = true }
rust-mcp-macros = { workspace = true, optional = true, features = ["sdk"] }
rust-mcp-macros = { workspace = true, optional = true, default-features=false, feature=["sdk"] }

tokio.workspace = true
serde = { workspace = true }
Expand Down Expand Up @@ -46,6 +46,7 @@ default = [
"macros",
"hyper-server",
"ssl",
"2025_03_26"
] # All features enabled by default
server = ["rust-mcp-transport/stdio"] # Server feature
client = ["rust-mcp-transport/stdio", "rust-mcp-transport/sse"] # Client feature
Expand All @@ -59,5 +60,17 @@ hyper-server = [
ssl = ["axum-server/tls-rustls"]
macros = ["rust-mcp-macros/sdk"]

# enabled mcp protocol version 2025_03_26
2025_03_26 = ["rust-mcp-schema/2025_03_26",
"rust-mcp-macros/2025_03_26",
"rust-mcp-transport/2025_03_26",
"rust-mcp-schema/schema_utils"]

# enabled mcp protocol version 2024_11_05
2024_11_05 = ["rust-mcp-schema/2024_11_05",
"rust-mcp-macros/2024_11_05",
"rust-mcp-transport/2024_11_05",
"rust-mcp-schema/schema_utils"]

[lints]
workspace = true
10 changes: 8 additions & 2 deletions crates/rust-mcp-transport/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ license = "MIT"
edition = "2021"

[dependencies]
rust-mcp-schema = { workspace = true }

rust-mcp-schema = { workspace = true, default-features=false}

async-trait = { workspace = true }
futures = { workspace = true }
Expand All @@ -34,7 +35,12 @@ workspace = true

### FEATURES #################################################################
[features]
default = ["stdio", "sse"] # Default features
default = ["stdio", "sse","2025_03_26"] # Default features

stdio = []
sse = ["reqwest"]
# enabled mcp protocol version 2025_03_26
2025_03_26 = ["rust-mcp-schema/2025_03_26","rust-mcp-schema/schema_utils"]

# enabled mcp protocol version 2024_11_05
2024_11_05 = ["rust-mcp-schema/2024_11_05","rust-mcp-schema/schema_utils"]
1 change: 1 addition & 0 deletions examples/hello-world-mcp-server-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ license = "MIT"
rust-mcp-sdk = { workspace = true, default-features = false, features = [
"server",
"macros",
"2025_03_26"
] }

tokio = { workspace = true }
Expand Down
1 change: 1 addition & 0 deletions examples/hello-world-mcp-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ rust-mcp-sdk = { workspace = true, default-features = false, features = [
"macros",
"hyper-server",
"ssl",
"2025_03_26"
] }

tokio = { workspace = true }
Expand Down
1 change: 1 addition & 0 deletions examples/hello-world-server-core-sse/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ rust-mcp-sdk = { workspace = true, default-features = false, features = [
"server",
"macros",
"hyper-server",
"2025_03_26"
] }

tokio = { workspace = true }
Expand Down
1 change: 1 addition & 0 deletions examples/hello-world-server-sse/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ rust-mcp-sdk = { workspace = true, default-features = false, features = [
"server",
"macros",
"hyper-server",
"2025_03_26"
] }

tokio = { workspace = true }
Expand Down
2 changes: 2 additions & 0 deletions examples/simple-mcp-client-core-sse/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ license = "MIT"
rust-mcp-sdk = { workspace = true, default-features = false, features = [
"client",
"macros",
"2025_03_26"

] }

tokio = { workspace = true }
Expand Down
2 changes: 2 additions & 0 deletions examples/simple-mcp-client-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ license = "MIT"
rust-mcp-sdk = { workspace = true, default-features = false, features = [
"client",
"macros",
"2025_03_26"

] }

tokio = { workspace = true }
Expand Down
2 changes: 2 additions & 0 deletions examples/simple-mcp-client-sse/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ license = "MIT"
rust-mcp-sdk = { workspace = true, default-features = false, features = [
"client",
"macros",
"2025_03_26"

] }

tokio = { workspace = true }
Expand Down
2 changes: 2 additions & 0 deletions examples/simple-mcp-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ license = "MIT"
rust-mcp-sdk = { workspace = true, default-features = false, features = [
"client",
"macros",
"2025_03_26"

] }

tokio = { workspace = true }
Expand Down