You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tightens the duplicated per-method association section from eleven lines
to five, and trims the marker and SessionManager docs to the same
information in fewer words.
Copy file name to clipboardExpand all lines: crates/rmcp/src/service/server.rs
+32-72Lines changed: 32 additions & 72 deletions
Original file line number
Diff line number
Diff line change
@@ -771,15 +771,10 @@ impl Peer<RoleServer> {
771
771
772
772
/// # SEP-2260: request association
773
773
///
774
-
/// From protocol version `2026-07-28`, this request must be issued while
775
-
/// handling a client request — call it on the [`Peer`] from a
776
-
/// [`RequestContext`], from the handler's
777
-
/// own task. Calling it outside a handler returns an
778
-
/// `invalid_request` error. Note that task-local association does not
779
-
/// cross `tokio::spawn`: a task spawned inside a handler is treated as
780
-
/// outside the handler — use the task manager for long-running work.
781
-
/// Requests issued in-handler are delivered on the originating request's
782
-
/// SSE stream in the streamable HTTP transport.
774
+
/// From protocol version `2026-07-28` this must be issued while handling a
775
+
/// client request; outside a handler it returns an `invalid_request` error.
776
+
/// The association does not cross `tokio::spawn`, so use the task manager
777
+
/// for long-running work.
783
778
#[deprecated(
784
779
since = "1.8.0",
785
780
note = "Sampling is deprecated by SEP-2577 and will be removed in a future release. See https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2577"
@@ -816,15 +811,10 @@ impl Peer<RoleServer> {
816
811
method!(
817
812
/// # SEP-2260: request association
818
813
///
819
-
/// From protocol version `2026-07-28`, this request must be issued while
820
-
/// handling a client request — call it on the [`Peer`] from a
821
-
/// [`RequestContext`], from the handler's
822
-
/// own task. Calling it outside a handler returns an
823
-
/// `invalid_request` error. Note that task-local association does not
824
-
/// cross `tokio::spawn`: a task spawned inside a handler is treated as
825
-
/// outside the handler — use the task manager for long-running work.
826
-
/// Requests issued in-handler are delivered on the originating request's
827
-
/// SSE stream in the streamable HTTP transport.
814
+
/// From protocol version `2026-07-28` this must be issued while handling a
815
+
/// client request; outside a handler it returns an `invalid_request` error.
816
+
/// The association does not cross `tokio::spawn`, so use the task manager
817
+
/// for long-running work.
828
818
#[deprecated(
829
819
since = "1.8.0",
830
820
note = "Roots is deprecated by SEP-2577 and will be removed in a future release. See https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2577"
@@ -835,30 +825,20 @@ impl Peer<RoleServer> {
835
825
method!(
836
826
/// # SEP-2260: request association
837
827
///
838
-
/// From protocol version `2026-07-28`, this request must be issued while
839
-
/// handling a client request — call it on the [`Peer`] from a
840
-
/// [`RequestContext`], from the handler's
841
-
/// own task. Calling it outside a handler returns an
842
-
/// `invalid_request` error. Note that task-local association does not
843
-
/// cross `tokio::spawn`: a task spawned inside a handler is treated as
844
-
/// outside the handler — use the task manager for long-running work.
845
-
/// Requests issued in-handler are delivered on the originating request's
846
-
/// SSE stream in the streamable HTTP transport.
828
+
/// From protocol version `2026-07-28` this must be issued while handling a
829
+
/// client request; outside a handler it returns an `invalid_request` error.
830
+
/// The association does not cross `tokio::spawn`, so use the task manager
0 commit comments