-
Notifications
You must be signed in to change notification settings - Fork 299
Open
Description
Describe the bug
The transport-streamable-http-client
feature makes use of the reqwest
crate, but does not declare it as a component feature in the rmcp Cargo.toml. This prevents a project with rmcp from being compiled if they make use of the feature.
To Reproduce
Steps to reproduce the behavior:
- Create a new rust crate
- Run
cargo add rmcp -F transport-streamable-http-client
- Run
cargo build
Expected behavior
Crate compiles
Actual behavior
Fails to compile, error message given below:
$ cargo build
Compiling rmcp v0.3.0
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `reqwest`
--> C:\Users\dummy\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\rmcp-0.3.0\src\transport\streamable_http_client.rs:51:11
|
51 | impl From<reqwest::Error> for StreamableHttpError<reqwest::Error> {
| ^^^^^^^ use of unresolved module or unlinked crate `reqwest`
|
= help: if you wanted to use a crate named `reqwest`, use `cargo add reqwest` to add it to your `Cargo.toml`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `reqwest`
--> C:\Users\dummy\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\rmcp-0.3.0\src\transport\streamable_http_client.rs:51:51
|
51 | impl From<reqwest::Error> for StreamableHttpError<reqwest::Error> {
| ^^^^^^^ use of unresolved module or unlinked crate `reqwest`
|
= help: if you wanted to use a crate named `reqwest`, use `cargo add reqwest` to add it to your `Cargo.toml`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `reqwest`
--> C:\Users\dummy\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\rmcp-0.3.0\src\transport\streamable_http_client.rs:52:16
|
52 | fn from(e: reqwest::Error) -> Self {
| ^^^^^^^ use of unresolved module or unlinked crate `reqwest`
|
= help: if you wanted to use a crate named `reqwest`, use `cargo add reqwest` to add it to your `Cargo.toml`
For more information about this error, try `rustc --explain E0433`.
error: could not compile `rmcp` (lib) due to 3 previous errors
Proposed fix
The fix should simply be to change this line in the Cargo.toml from:
transport-streamable-http-client = ["client-side-sse", "transport-worker"]
to
transport-streamable-http-client = ["client-side-sse", "transport-worker", "reqwest"]
joulei
Metadata
Metadata
Assignees
Labels
No labels