Skip to content

Commit 4001c48

Browse files
committed
Resumability should operate on a per-stream basis
1 parent 732fdd2 commit 4001c48

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

docs/specification/draft/basic/transports.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ URL like `https://example.com/mcp`.
120120
1. The client **MAY** remain connected to multiple SSE streams simultaneously.
121121
2. The server **MUST** send each of its JSON-RPC messages on only one of the connected
122122
streams; that is, it **MUST NOT** broadcast the same message across multiple streams.
123-
- The risk of message loss can be mitigated by making the stream [resumable](#resumability-and-redelivery).
123+
- The risk of message loss can be mitigated by making the stream
124+
[resumable](#resumability-and-redelivery).
124125

125126
### Resumability and Redelivery
126127

@@ -132,16 +133,18 @@ lost:
132133
- If present, the ID **MUST** be globally unique across all streams within that
133134
[session](#session-management)—or all streams with that specific client, if session
134135
management is not in use.
135-
2. After a broken connection, clients **MAY** include a
136+
2. If the client wishes to resume after a broken connection, it **SHOULD** issue an HTTP
137+
GET to the MCP endpoint, and include the
136138
[`Last-Event-ID`](https://html.spec.whatwg.org/multipage/server-sent-events.html#the-last-event-id-header)
137-
header when opening a new SSE stream, to indicate the last event ID they received.
138-
- The server **MAY** use this header to replay messages that were sent after the last
139-
event ID, and to resume the stream from that point.
140-
3. Clients **MUST NOT** include a `Last-Event-ID` header when connecting _additional_ SSE
141-
streams within the session, while at least one remains connected.
142-
- The server **SHOULD** interpret the presence of this header as indicating that any
143-
other streams which _nominally_ remain open are in fact dead, and should be
144-
terminated.
139+
header to indicate the last event ID it received.
140+
- The server **MAY** use this header to replay messages that would have been sent
141+
after the last event ID, _on the stream that was disconnected_, and to resume the
142+
stream from that point.
143+
- The server **MUST NOT** replay messages that would have been delivered on a
144+
different stream.
145+
146+
In other words, these event IDs should be assigned by servers on a _per-stream_ basis, to
147+
act as a cursor within that particular stream.
145148

146149
### Session Management
147150

0 commit comments

Comments
 (0)