Skip to content

Conversation

@milarze
Copy link
Contributor

@milarze milarze commented Aug 31, 2025

Fixes transport-streamable-http-server feature which requires transport-worker feature.

Motivation and Context

When adding rmcp with the transport-streamable-http-server feature, cargo build fails with the following error:

error[E0432]: unresolved imports `crate::transport::WorkerTransport`, `crate::transport::worker`
  --> /home/user/rust-sdk/crates/rmcp/src/transport/streamable_http_server/session/local.rs:25:9
   |
25 |         WorkerTransport,
   |         ^^^^^^^^^^^^^^^ no `WorkerTransport` in `transport`
26 |         common::server_side_http::{SessionId, session_id},
27 |         worker::{Worker, WorkerContext, WorkerQuitReason, WorkerSendRequest},
   |         ^^^^^^ could not find `worker` in `transport`
   |
note: found an item that was configured out
  --> /home/user/rust-sdk/crates/rmcp/src/transport.rs:82:17
   |
82 | pub use worker::WorkerTransport;
   |                 ^^^^^^^^^^^^^^^
note: the item is gated behind the `transport-worker` feature
  --> /home/user/rust-sdk/crates/rmcp/src/transport.rs:80:7
   |
80 | #[cfg(feature = "transport-worker")]
   |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: found an item that was configured out
  --> /home/user/rust-sdk/crates/rmcp/src/transport.rs:79:9
   |
79 | pub mod worker;
   |         ^^^^^^
note: the item is gated behind the `transport-worker` feature
  --> /home/user/rust-sdk/crates/rmcp/src/transport.rs:77:7
   |
77 | #[cfg(feature = "transport-worker")]
   |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0433]: failed to resolve: could not find `worker` in `transport`
   --> /home/user/rust-sdk/crates/rmcp/src/transport/streamable_http_server/session/local.rs:720:43
    |
720 |     fn config(&self) -> crate::transport::worker::WorkerConfig {
    |                                           ^^^^^^ could not find `worker` in `transport`
    |
note: found an item that was configured out
   --> /home/user/rust-sdk/crates/rmcp/src/transport.rs:79:9
    |
79  | pub mod worker;
    |         ^^^^^^
note: the item is gated behind the `transport-worker` feature
   --> /home/user/rust-sdk/crates/rmcp/src/transport.rs:77:7
    |
77  | #[cfg(feature = "transport-worker")]
    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0433]: failed to resolve: could not find `worker` in `transport`
   --> /home/user/rust-sdk/crates/rmcp/src/transport/streamable_http_server/session/local.rs:721:27
    |
721 |         crate::transport::worker::WorkerConfig {
    |                           ^^^^^^ could not find `worker` in `transport`
    |
note: found an item that was configured out
   --> /home/user/rust-sdk/crates/rmcp/src/transport.rs:79:9
    |
79  | pub mod worker;
    |         ^^^^^^
note: the item is gated behind the `transport-worker` feature
   --> /home/user/rust-sdk/crates/rmcp/src/transport.rs:77:7
    |
77  | #[cfg(feature = "transport-worker")]
    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

How Has This Been Tested?

cargo build with the same transport-streamable-http-server feature succeeds with this change.

Breaking Changes

No

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

@github-actions github-actions bot added T-dependencies Dependencies related changes T-config Configuration file changes labels Aug 31, 2025
@4t145 4t145 merged commit b0e2c11 into modelcontextprotocol:main Sep 1, 2025
10 of 11 checks passed
@4t145
Copy link
Collaborator

4t145 commented Sep 1, 2025

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-config Configuration file changes T-dependencies Dependencies related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants