Skip to content

Commit 2e7993e

Browse files
committed
build(workspace): migrate to Rust edition 2024 with centralized deps
Workspace configuration: - Upgrade Cargo resolver from "2" to "3" for edition 2024 - Add rust-version = "1.93" to [workspace.package] - Centralize shared deps under [workspace.dependencies] - Use dotted-key syntax for member package metadata - Remove redundant license-file from workspace package Toolchain and linting: - Bump rust-toolchain.toml channel from 1.90 to 1.93 - Bump clippy.toml MSRV from 1.85 to 1.93 - Add **/bun.lock to .gitignore Dependency declarations: - Convert inline version specs to workspace refs in 10 tomls - Migrate conformance, simple-chat-client to edition 2024 - Specify explicit axum/reqwest features where needed - Remove unused tracing::error import in auth module Edition 2024 let-chain refactors: - Replace nested if-let with let-chains across the codebase - Flatten conditionals in SSE retry and HTTP handling - Simplify proc-macro pattern matching helpers - Refactor elicitation schema nested validation - Use let-chains in test_custom_headers assertions Code modernization: - Use derive(Default) + #[default] for ToolChoiceMode - Fix doc comments to current type names (Params) - Convert conformance handler to async fn syntax - Add #[allow(dead_code)] for deserialized-only fields - Clean up trailing blank lines and whitespace
1 parent 876da50 commit 2e7993e

38 files changed

+1395
-1316
lines changed

.githooks/commit-msg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ if echo "$commit_msg" | grep -qE "^Merge "; then
1414
fi
1515

1616
# Try to use commitlint via npx if Node.js is available
17-
if command -v npx >/dev/null 2>&1; then
17+
if command -v bunx >/dev/null 2>&1; then
1818
# Run commitlint with config-conventional rules (same as CI)
19-
echo "$commit_msg" | npx --yes @commitlint/cli@latest --extends @commitlint/config-conventional
19+
echo "$commit_msg" | bunx --bun @commitlint/cli@latest --extends @commitlint/config-conventional
2020
exit $?
2121
fi
2222

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ target/
66
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
77
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
88
Cargo.lock
9-
9+
**/bun.lock
1010
# These are backup files generated by rustfmt
1111
**/*.rs.bk
1212

Cargo.toml

Lines changed: 84 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,100 @@
11
[workspace]
22
members = ["crates/rmcp", "crates/rmcp-macros", "examples/*", "conformance"]
33
default-members = ["crates/rmcp", "crates/rmcp-macros"]
4-
resolver = "2"
4+
resolver = "3"
55

66
[workspace.dependencies]
7+
# Internal crates
78
rmcp = { version = "0.17.0", path = "./crates/rmcp" }
89
rmcp-macros = { version = "0.17.0", path = "./crates/rmcp-macros" }
910

11+
# Serialization
12+
serde = "1.0"
13+
serde_json = "1.0"
14+
serde_urlencoded = "0.7"
15+
16+
# Async runtime
17+
tokio = "1"
18+
tokio-util = "0.7"
19+
tokio-stream = "0.1"
20+
futures = "0.3"
21+
async-trait = "0.1"
22+
pin-project-lite = "0.2"
23+
24+
# Error handling
25+
thiserror = "2"
26+
anyhow = "1.0"
27+
28+
# Logging
29+
tracing = "0.1"
30+
tracing-subscriber = "0.3"
31+
tracing-appender = "0.2"
32+
33+
# HTTP / networking
34+
reqwest = { version = "0.13.2", default-features = false }
35+
http = "1"
36+
http-body = "1"
37+
http-body-util = "0.1"
38+
axum = { version = "0.8", default-features = false }
39+
tower = "0.5"
40+
tower-service = "0.3"
41+
tower-http = "0.6"
42+
hyper = "1"
43+
hyper-util = "0.1"
44+
sse-stream = "0.2"
45+
url = "2"
46+
47+
# Encoding
48+
base64 = "0.22"
49+
bytes = "1"
50+
51+
# Schema
52+
schemars = "1.2"
53+
54+
# Utility
55+
rand = "0.10"
56+
uuid = "1"
57+
chrono = { version = "0.4.44", default-features = false }
58+
clap = "4.5"
59+
toml = "1.0"
60+
61+
# Process
62+
process-wrap = "9.0"
63+
64+
# Auth
65+
oauth2 = { version = "5.0", default-features = false }
66+
67+
# Proc macros
68+
syn = "2"
69+
quote = "1"
70+
proc-macro2 = "1"
71+
darling = "0.23"
72+
pastey = "0.2.1"
73+
74+
# Template
75+
askama = "0.15"
76+
77+
# Crypto
78+
p256 = "0.13"
79+
80+
# WebSocket
81+
tokio-tungstenite = "0.28.0"
82+
83+
# URL encoding
84+
urlencoding = "2"
85+
86+
# WASI
87+
wasi = "0.14.7"
88+
89+
# AI integration
90+
rig-core = "0.31.0"
91+
1092
[workspace.package]
1193
edition = "2024"
94+
rust-version = "1.93"
1295
version = "0.17.0"
1396
authors = ["4t145 <u4t145@163.com>"]
1497
license = "Apache-2.0"
15-
license-file = "LICENSE"
1698
repository = "https://github.com/modelcontextprotocol/rust-sdk/"
1799
description = "Rust SDK for Model Context Protocol"
18100
keywords = ["mcp", "sdk", "tokio", "modelcontextprotocol"]

clippy.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
msrv = "1.85"
1+
msrv = "1.93"
22
too-many-arguments-threshold = 10
33
check-private-items = false

conformance/Cargo.toml

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
[package]
22
name = "mcp-conformance"
33
version = "0.1.0"
4-
edition = "2021"
4+
edition.workspace = true
5+
rust-version.workspace = true
56
publish = false
67

78
[[bin]]
@@ -13,24 +14,41 @@ name = "conformance-client"
1314
path = "src/bin/client.rs"
1415

1516
[dependencies]
16-
rmcp = { path = "../crates/rmcp", features = [
17+
rmcp = { workspace = true, features = [
1718
"server",
1819
"client",
1920
"elicitation",
2021
"auth",
2122
"transport-streamable-http-server",
2223
"transport-streamable-http-client-reqwest",
2324
] }
24-
tokio = { version = "1", features = ["full"] }
25-
tokio-util = { version = "0.7" }
26-
serde = { version = "1", features = ["derive"] }
27-
serde_json = "1"
28-
tracing = "0.1"
29-
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
30-
axum = { version = "0.8", features = ["macros"] }
31-
anyhow = "1"
32-
reqwest = { version = "0.13", features = ["json"] }
33-
urlencoding = "2"
34-
url = "2"
35-
p256 = { version = "0.13", features = ["ecdsa"] }
36-
base64 = "0.22"
25+
tokio = { workspace = true, features = ["full"] }
26+
tokio-util = { workspace = true }
27+
serde = { workspace = true, features = ["derive"] }
28+
serde_json = { workspace = true }
29+
tracing = { workspace = true }
30+
tracing-subscriber = { workspace = true, features = ["env-filter"] }
31+
axum = { workspace = true, features = [
32+
"form",
33+
"http1",
34+
"json",
35+
"matched-path",
36+
"original-uri",
37+
"query",
38+
"tokio",
39+
"tower-log",
40+
"tracing",
41+
"macros",
42+
] }
43+
anyhow = { workspace = true }
44+
reqwest = { workspace = true, features = [
45+
"default-tls",
46+
"charset",
47+
"http2",
48+
"system-proxy",
49+
"json",
50+
] }
51+
urlencoding = { workspace = true }
52+
url = { workspace = true }
53+
p256 = { workspace = true, features = ["ecdsa"] }
54+
base64 = { workspace = true }

0 commit comments

Comments
 (0)