refactor: remove unused axum dependency from server-side-http feature#642
Open
andrewgazelka wants to merge 2 commits intomodelcontextprotocol:mainfrom
Open
refactor: remove unused axum dependency from server-side-http feature#642andrewgazelka wants to merge 2 commits intomodelcontextprotocol:mainfrom
andrewgazelka wants to merge 2 commits intomodelcontextprotocol:mainfrom
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.
ofek
reviewed
Feb 3, 2026
crates/rmcp/Cargo.toml
Outdated
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?
Suggested change
| axum = { version = "0.8", default-features = false, features = ["http1", "tokio"], optional = true } |
Collaborator
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?
6 tasks
- 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.
Author
|
🦾: 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:
|
Author
|
any thoughts on adding proper CI to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.