Skip to content

Commit ba3d8ef

Browse files
committed
feat!: remove SSE transport support
SSE transport has been removed from the MCP specification in favor of streamable HTTP. This removes all SSE-specific transport code: - Remove `transport-sse-client` and `transport-sse-server` features - Remove `SseClientTransport` and `SseServer` types - Remove SSE-specific examples (`counter_sse`, `counter_sse_directly`) - Migrate auth examples from SSE to streamable HTTP - Update tests to remove SSE transport usage - Update documentation BREAKING CHANGE: The following have been removed: - `transport-sse-client` feature - `transport-sse-client-reqwest` feature - `transport-sse-server` feature - `SseClientTransport` type - `SseServer` type - `sse_client` and `sse_server` modules Users should migrate to streamable HTTP transport which provides equivalent functionality. See `StreamableHttpClientTransport` and `StreamableHttpService` for the replacement APIs. Ref: #561 (comment)
1 parent 94428d5 commit ba3d8ef

31 files changed

+164
-1688
lines changed

crates/rmcp/Cargo.toml

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ schemars = { version = "1.0", optional = true, features = ["chrono04"] }
3434
# for image encoding
3535
base64 = { version = "0.22", optional = true }
3636

37-
# for SSE client
37+
# for HTTP client
3838
reqwest = { version = "0.12", default-features = false, features = [
3939
"json",
4040
"stream",
@@ -100,33 +100,23 @@ server-side-http = [
100100
"dep:sse-stream",
101101
"tower",
102102
]
103-
# SSE client
104-
client-side-sse = ["dep:sse-stream", "dep:http"]
105-
106-
transport-sse-client = ["client-side-sse", "transport-worker"]
107-
transport-sse-client-reqwest = ["transport-sse-client", "reqwest"]
108103

109104
transport-worker = ["dep:tokio-stream"]
110105

106+
# SSE stream parsing utilities (used by streamable HTTP client for SSE-formatted responses)
107+
client-side-sse = ["dep:sse-stream", "dep:http"]
111108

112109
# Streamable HTTP client
113110
transport-streamable-http-client = ["client-side-sse", "transport-worker"]
114111
transport-streamable-http-client-reqwest = ["transport-streamable-http-client", "reqwest"]
115112

116-
117113
transport-async-rw = ["tokio/io-util", "tokio-util/codec"]
118114
transport-io = ["transport-async-rw", "tokio/io-std"]
119115
transport-child-process = [
120116
"transport-async-rw",
121117
"tokio/process",
122118
"dep:process-wrap",
123119
]
124-
transport-sse-server = [
125-
"transport-async-rw",
126-
"transport-worker",
127-
"server-side-http",
128-
"dep:axum",
129-
]
130120
transport-streamable-http-server = [
131121
"transport-streamable-http-server-session",
132122
"server-side-http",
@@ -163,8 +153,6 @@ required-features = [
163153
"reqwest",
164154
"server",
165155
"client",
166-
"transport-sse-server",
167-
"transport-sse-client",
168156
"transport-child-process",
169157
]
170158
path = "tests/test_with_python.rs"
@@ -174,7 +162,6 @@ name = "test_with_js"
174162
required-features = [
175163
"server",
176164
"client",
177-
"transport-sse-server",
178165
"transport-child-process",
179166
"transport-streamable-http-server",
180167
"transport-streamable-http-client",

crates/rmcp/README.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,6 @@ RMCP uses feature flags to control which components are included:
203203
- `transport-async-rw`: Async read/write support
204204
- `transport-io`: I/O stream support
205205
- `transport-child-process`: Child process support
206-
- `transport-sse-client` / `transport-sse-server`: SSE support (client agnostic)
207-
- `transport-sse-client-reqwest`: a default `reqwest` implementation of the SSE client
208206
- `transport-streamable-http-client` / `transport-streamable-http-server`: HTTP streaming (client agnostic, see [`StreamableHttpClientTransport`] for details)
209207
- `transport-streamable-http-client-reqwest`: a default `reqwest` implementation of the streamable http client
210208
- `auth`: OAuth2 authentication support
@@ -214,22 +212,19 @@ RMCP uses feature flags to control which components are included:
214212
## Transports
215213

216214
- `transport-io`: Server stdio transport
217-
- `transport-sse-server`: Server SSE transport
218215
- `transport-child-process`: Client stdio transport
219-
- `transport-sse-client`: Client sse transport
220216
- `transport-streamable-http-server` streamable http server transport
221217
- `transport-streamable-http-client` streamable http client transport
222218

223219
<details>
224220
<summary>Transport</summary>
225221
The transport type must implemented [`Transport`] trait, which allow it send message concurrently and receive message sequentially.
226-
There are 3 pairs of standard transport types:
222+
There are 2 pairs of standard transport types:
227223

228224
| transport | client | server |
229225
|:-: |:-: |:-: |
230226
| std IO | [`child_process::TokioChildProcess`] | [`io::stdio`] |
231227
| streamable http | [`streamable_http_client::StreamableHttpClientTransport`] | [`streamable_http_server::session::create_session`] |
232-
| sse | [`sse_client::SseClientTransport`] | [`sse_server::SseServer`] |
233228

234229
#### [IntoTransport](`IntoTransport`) trait
235230
[`IntoTransport`] is a helper trait that implicitly convert a type into a transport type.

crates/rmcp/src/transport.rs

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22
//! The transport type must implemented [`Transport`] trait, which allow it send message concurrently and receive message sequentially.
33
//!
44
//! ## Standard Transport Types
5-
//! There are 3 pairs of standard transport types:
5+
//! There are 2 pairs of standard transport types:
66
//!
77
//! | transport | client | server |
88
//! |:-: |:-: |:-: |
99
//! | std IO | [`child_process::TokioChildProcess`] | [`io::stdio`] |
1010
//! | streamable http | [`streamable_http_client::StreamableHttpClientTransport`] | [`streamable_http_server::StreamableHttpService`] |
11-
//! | sse | [`sse_client::SseClientTransport`] | [`sse_server::SseServer`] |
1211
//!
1312
//!## Helper Transport Types
1413
//! Thers are several helper transport types that can help you to create transport quickly.
@@ -95,20 +94,6 @@ pub mod io;
9594
#[cfg_attr(docsrs, doc(cfg(feature = "transport-io")))]
9695
pub use io::stdio;
9796

98-
#[cfg(feature = "transport-sse-client")]
99-
#[cfg_attr(docsrs, doc(cfg(feature = "transport-sse-client")))]
100-
pub mod sse_client;
101-
#[cfg(feature = "transport-sse-client")]
102-
#[cfg_attr(docsrs, doc(cfg(feature = "transport-sse-client")))]
103-
pub use sse_client::SseClientTransport;
104-
105-
#[cfg(feature = "transport-sse-server")]
106-
#[cfg_attr(docsrs, doc(cfg(feature = "transport-sse-server")))]
107-
pub mod sse_server;
108-
#[cfg(feature = "transport-sse-server")]
109-
#[cfg_attr(docsrs, doc(cfg(feature = "transport-sse-server")))]
110-
pub use sse_server::SseServer;
111-
11297
#[cfg(feature = "auth")]
11398
#[cfg_attr(docsrs, doc(cfg(feature = "auth")))]
11499
pub mod auth;

crates/rmcp/src/transport/auth.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ impl CredentialStore for InMemoryCredentialStore {
7474
}
7575
}
7676

77-
/// sse client with oauth2 authorization
77+
/// HTTP client with OAuth 2.0 authorization
7878
#[derive(Clone)]
7979
pub struct AuthClient<C> {
8080
pub http_client: C,
@@ -91,7 +91,7 @@ impl<C: std::fmt::Debug> std::fmt::Debug for AuthClient<C> {
9191
}
9292

9393
impl<C> AuthClient<C> {
94-
/// create new authorized sse client
94+
/// Create a new authorized HTTP client
9595
pub fn new(http_client: C, auth_manager: AuthorizationManager) -> Self {
9696
Self {
9797
http_client,

crates/rmcp/src/transport/common.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
#[cfg(any(
2-
feature = "transport-streamable-http-server",
3-
feature = "transport-sse-server"
4-
))]
1+
#[cfg(feature = "transport-streamable-http-server")]
52
pub mod server_side_http;
63

74
pub mod http_header;
@@ -10,6 +7,9 @@ pub mod http_header;
107
#[cfg_attr(docsrs, doc(cfg(feature = "reqwest")))]
118
mod reqwest;
129

10+
// Note: This module provides SSE stream parsing and auto-reconnect utilities.
11+
// It's used by the streamable HTTP client (which receives SSE-formatted responses),
12+
// not the removed SSE transport. The name is historical.
1313
#[cfg(feature = "client-side-sse")]
1414
#[cfg_attr(docsrs, doc(cfg(feature = "client-side-sse")))]
1515
pub mod client_side_sse;
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
#[cfg(feature = "transport-streamable-http-client")]
22
#[cfg_attr(docsrs, doc(cfg(feature = "transport-streamable-http-client")))]
33
mod streamable_http_client;
4-
5-
#[cfg(feature = "transport-sse-client")]
6-
#[cfg_attr(docsrs, doc(cfg(feature = "transport-sse-client")))]
7-
mod sse_client;

crates/rmcp/src/transport/common/auth/sse_client.rs

Lines changed: 0 additions & 45 deletions
This file was deleted.
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
#[cfg(feature = "transport-streamable-http-client-reqwest")]
22
#[cfg_attr(docsrs, doc(cfg(feature = "transport-streamable-http-client-reqwest")))]
33
mod streamable_http_client;
4-
5-
#[cfg(feature = "transport-sse-client-reqwest")]
6-
#[cfg_attr(docsrs, doc(cfg(feature = "transport-sse-client-reqwest")))]
7-
mod sse_client;

crates/rmcp/src/transport/common/reqwest/sse_client.rs

Lines changed: 0 additions & 118 deletions
This file was deleted.

0 commit comments

Comments
 (0)