From f5642241da183bbc45d06de846ce3acb7962734f Mon Sep 17 00:00:00 2001 From: Andrew Gazelka Date: Tue, 3 Feb 2026 07:23:28 -0800 Subject: [PATCH 1/2] 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. --- crates/rmcp/Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/crates/rmcp/Cargo.toml b/crates/rmcp/Cargo.toml index b9c0baa2..1062e416 100644 --- a/crates/rmcp/Cargo.toml +++ b/crates/rmcp/Cargo.toml @@ -97,7 +97,6 @@ server-side-http = [ "dep:http-body-util", "dep:bytes", "dep:sse-stream", - "dep:axum", "tower", ] From 2a29c55cecf3a1a07200f3686686a5cdbf98ff1c Mon Sep 17 00:00:00 2001 From: Andrew Gazelka Date: Tue, 3 Feb 2026 17:32:56 -0800 Subject: [PATCH 2/2] 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. --- crates/rmcp/Cargo.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/rmcp/Cargo.toml b/crates/rmcp/Cargo.toml index 1062e416..0579c6ac 100644 --- a/crates/rmcp/Cargo.toml +++ b/crates/rmcp/Cargo.toml @@ -54,7 +54,6 @@ process-wrap = { version = "9.0", features = ["tokio1"], optional = true } # tokio-tungstenite ={ version = "0.26", optional = true } # for http-server transport -axum = { version = "0.8", features = [], optional = true } rand = { version = "0.9", optional = true } tokio-stream = { version = "0.1", optional = true } uuid = { version = "1", features = ["v4"], optional = true } @@ -133,7 +132,7 @@ schemars = ["dep:schemars"] [dev-dependencies] tokio = { version = "1", features = ["full"] } schemars = { version = "1.1.0", features = ["chrono04"] } - +axum = { version = "0.8", default-features = false, features = ["http1", "tokio"] } anyhow = "1.0" tracing-subscriber = { version = "0.3", features = [ "env-filter",