Skip to content

"Transport error: Error decoding response body" when connecting to streamable http endpointΒ #455

@dingfeli

Description

@dingfeli

Describe the bug
When connecting to certain endpoints with streamable http transport, the following error is thrown:

TransportError { error: DynamicTransportError { transport_name: "rmcp::transport::worker::WorkerTransport<rmcp::transport::streamable_http_client::StreamableHttpClientWorker<reqwest::async_impl::client::Client>>", transport_type_id: TypeId(0x32b1c270444201caf977817085727746), error: TransportChannelClosed }, context: "send initialized notification" }.

This was preceded by the following:

rmcp::transport::worker: 128: worker quit with fatal: Client error: error decoding response body, when send initialized notification

The endpoint I used to discover this fault was https://www.javadocs.dev/mcp.
Some info about this endpoint:

  • It uses streamable http
  • It is open and does not require auth
  • It uses https://github.com/softwaremill/chimp for the server
  • It works with MCP inspector
  • Server protocol version: 2025-03-26

To Reproduce
Steps to reproduce the behavior:

  1. Go to the streamable http example and change the endpoint to "https://www.javadocs.dev/mcp": https://github.com/modelcontextprotocol/rust-sdk/blob/main/examples/clients/src/streamable_http.rs#L19.
  2. Run the example with cargo run --example clients_streamable_http.

Expected behavior
Tools should be fetched

Logs
The following was outputted from the example:

2025-09-25T20:37:08.944863Z TRACE transport_worker{name="StreamableHttpClientWorker"}: hyper_util::client::legacy::pool: checkout waiting for idle connection: ("https", www.javadocs.dev)
2025-09-25T20:37:08.944929Z DEBUG transport_worker{name="StreamableHttpClientWorker"}: reqwest::connect: starting new connection: https://www.javadocs.dev/
2025-09-25T20:37:08.944964Z TRACE transport_worker{name="StreamableHttpClientWorker"}: hyper_util::client::legacy::connect::http: Http::connect; scheme=Some("https"), host=Some("www.javadocs.dev"), port=None
2025-09-25T20:37:09.048052Z DEBUG transport_worker{name="StreamableHttpClientWorker"}: hyper_util::client::legacy::connect::http: connecting to 15.197.149.68:443
2025-09-25T20:37:09.129384Z DEBUG transport_worker{name="StreamableHttpClientWorker"}: hyper_util::client::legacy::connect::http: connected to 15.197.149.68:443
2025-09-25T20:37:09.314160Z TRACE transport_worker{name="StreamableHttpClientWorker"}: hyper_util::client::legacy::client: http1 handshake complete, spawning background dispatcher task
2025-09-25T20:37:09.314348Z TRACE transport_worker{name="StreamableHttpClientWorker"}: hyper_util::client::legacy::client: waiting for connection to be ready
2025-09-25T20:37:09.314628Z TRACE transport_worker{name="StreamableHttpClientWorker"}: hyper_util::client::legacy::client: connection is ready
2025-09-25T20:37:09.314689Z TRACE transport_worker{name="StreamableHttpClientWorker"}: hyper_util::client::legacy::pool: checkout dropped for ("https", www.javadocs.dev)
2025-09-25T20:37:09.393272Z TRACE transport_worker{name="StreamableHttpClientWorker"}: hyper_util::client::legacy::pool: put; add idle connection for ("https", www.javadocs.dev)
2025-09-25T20:37:09.393373Z DEBUG transport_worker{name="StreamableHttpClientWorker"}: hyper_util::client::legacy::pool: pooling idle connection for ("https", www.javadocs.dev)
2025-09-25T20:37:09.393452Z TRACE transport_worker{name="StreamableHttpClientWorker"}: reqwest::retry: shouldn't retry!
2025-09-25T20:37:09.394605Z TRACE transport_worker{name="StreamableHttpClientWorker"}: hyper_util::client::legacy::pool: take? ("https", www.javadocs.dev): expiration = Some(90s)
2025-09-25T20:37:09.394687Z DEBUG transport_worker{name="StreamableHttpClientWorker"}: hyper_util::client::legacy::pool: reuse idle connection for ("https", www.javadocs.dev)
2025-09-25T20:37:09.475093Z TRACE transport_worker{name="StreamableHttpClientWorker"}: hyper_util::client::legacy::pool: put; add idle connection for ("https", www.javadocs.dev)
2025-09-25T20:37:09.475187Z DEBUG transport_worker{name="StreamableHttpClientWorker"}: hyper_util::client::legacy::pool: pooling idle connection for ("https", www.javadocs.dev)
2025-09-25T20:37:09.475242Z TRACE transport_worker{name="StreamableHttpClientWorker"}: reqwest::retry: shouldn't retry!
2025-09-25T20:37:09.475841Z ERROR clients_streamable_http: client error: TransportError { error: DynamicTransportError { transport_name: "rmcp::transport::worker::WorkerTransport<rmcp::transport::streamable_http_client::StreamableHttpClientWorker<reqwest::async_impl::client::Client>>", transport_type_id: TypeId(0x8a3d8550d26d791f0ae89dea6f935c32), error: TransportChannelClosed }, context: "send initialized notification" }
2025-09-25T20:37:09.475906Z ERROR rmcp::transport::worker: worker quit with fatal: Client error: error decoding response body, when send initialized notification
Error: Send message error Transport [rmcp::transport::worker::WorkerTransport<rmcp::transport::streamable_http_client::StreamableHttpClientWorker<reqwest::async_impl::client::Client>>] error: Transport channel closed, when send initialized notification

Additional context
None.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions