Skip to content

Commit bb534a7

Browse files
refactor: remove unused axum dependency from server-side-http feature (#642)
* refactor: remove unused axum dependency from server-side-http feature The `server-side-http` feature included `dep:axum` but axum was never actually used in the rmcp library source code (0 references found). The `StreamableHttpService` is a tower service that works with any HTTP server framework. Users can choose to use: - axum (via `Router::nest_service()` or `fallback_service()`) - hyper directly (via `hyper_util::service::TowerToHyperService`) - any other tower-compatible HTTP server This change removes the unnecessary transitive dependency, giving users more flexibility in their choice of HTTP server framework. Examples that use axum already have their own explicit axum dependency in their Cargo.toml, so they continue to work unchanged. * refactor: move axum to dev-dependencies with minimal features - Remove axum from library dependencies (not used in library source) - Add axum to dev-dependencies for tests with minimal features: default-features = false, features = ["http1", "tokio"] - Examples have their own axum dependency and are unaffected This addresses review feedback from @ofek to use minimal features, while ensuring axum is only bundled for running rmcp's own tests, not for downstream users.
1 parent 61845d6 commit bb534a7

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

crates/rmcp/Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ process-wrap = { version = "9.0", features = ["tokio1"], optional = true }
5454
# tokio-tungstenite ={ version = "0.26", optional = true }
5555

5656
# for http-server transport
57-
axum = { version = "0.8", features = [], optional = true }
5857
rand = { version = "0.9", optional = true }
5958
tokio-stream = { version = "0.1", optional = true }
6059
uuid = { version = "1", features = ["v4"], optional = true }
@@ -99,7 +98,6 @@ server-side-http = [
9998
"dep:http-body-util",
10099
"dep:bytes",
101100
"dep:sse-stream",
102-
"dep:axum",
103101
"tower",
104102
]
105103

@@ -136,7 +134,7 @@ schemars = ["dep:schemars"]
136134
[dev-dependencies]
137135
tokio = { version = "1", features = ["full"] }
138136
schemars = { version = "1.1.0", features = ["chrono04"] }
139-
137+
axum = { version = "0.8", default-features = false, features = ["http1", "tokio"] }
140138
anyhow = "1.0"
141139
tracing-subscriber = { version = "0.3", features = [
142140
"env-filter",

0 commit comments

Comments
 (0)