Uh oh!
There was an error while loading. Please reload this page.
refactor: remove unused axum dependency from server-side-http feature - #642
Conversation
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.
There was a problem hiding this comment.
I was actually about to open a PR but didn't realize the dependency is unused. If we aren't removing this dependency definition, could you incorporate my would-be change?
| axum = { version = "0.8", default-features = false, features = ["http1", "tokio"], optional = true } |
There was a problem hiding this comment.
@andrewgazelka@ofek Yeah something like this makes sense.
It looks like it might only be used in crates/rmcp/tests?
- 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.
andrewgazelka
commented
Feb 4, 2026
🦾: Thanks for the feedback! 2a29c55 After looking closer, I realized [dev-dependencies]
axum = { version = "0.8", default-features = false, features = ["http1", "tokio"] }This way:
Verified:
|
any thoughts on adding proper CI to |
Uh oh!
There was an error while loading. Please reload this page.
ofek
commented
Feb 12, 2026
Thanks a lot! |
Summary
The
server-side-httpfeature includeddep:axumbut axum was never actually used in the rmcp library source code (verified: 0 references found via grep).The
StreamableHttpServiceis a tower service that works with any HTTP server framework. Users can choose to use:Router::nest_service()orfallback_service())hyper_util::service::TowerToHyperService)Motivation
This came up while integrating rmcp into nushell (PR #17161) - a reviewer raised concerns about adding axum as a dependency. After investigation, we found that:
StreamableHttpServiceonly usestower_service::ServicetraitChanges
dep:axumfrom theserver-side-httpfeature incrates/rmcp/Cargo.tomlTesting
cargo build -p rmcp --features "transport-streamable-http-server"✓cargo test -p rmcp --all-features✓Impact
Users who want to use axum can add it as a direct dependency (as the examples do). Users who prefer hyper or another tower-compatible server no longer have axum as a transitive dependency.