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
Copy file name to clipboardExpand all lines: docs/specification/draft/basic/transports.mdx
+11-3Lines changed: 11 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -111,7 +111,7 @@ MCP endpoint.
111
111
at any time in order to avoid holding a long-lived connection. The client
112
112
**SHOULD** then "poll" the SSE stream by attempting to reconnect.
113
113
- If the server does close the _connection_ prior to terminating the _SSE stream_,
114
-
it **SHOULD** send an SSE event with a standard `retry` field before
114
+
it **SHOULD** send an SSE event with a standard [`retry`](https://html.spec.whatwg.org/multipage/server-sent-events.html#:~:text=field%20name%20is%20%22retry%22) field before
115
115
closing the connection. The client **MUST** respect the `retry` field,
116
116
waiting the given number of milliseconds before attempting to reconnect.
117
117
- The SSE stream **SHOULD** eventually include a JSON-RPC _response_ for the
@@ -148,6 +148,9 @@ MCP endpoint.
148
148
[resuming](#resumability-and-redelivery) a stream associated with a previous client
149
149
request.
150
150
- The server **MAY** close the SSE stream at any time.
151
+
- If the server closes the _connection_ without terminating the _stream_, it
152
+
**SHOULD** follow the same polling behavior as described for POST requests:
153
+
sending a `retry` field and allowing the client to reconnect.
151
154
- The client **MAY** close the SSE stream at any time.
152
155
153
156
### Multiple Connections
@@ -168,15 +171,20 @@ lost:
168
171
- If present, the ID **MUST** be globally unique across all streams within that
169
172
[session](#session-management)—or all streams with that specific client, if session
170
173
management is not in use.
171
-
2. If the client wishes to resume after a broken connection, it **SHOULD** issue an HTTP
172
-
GET to the MCP endpoint, and include the
174
+
- Event IDs **SHOULD** encode sufficient information to identify the originating
175
+
stream, enabling the server to correlate a `Last-Event-ID` to the correct stream.
176
+
2. If the client wishes to resume after a disconnection (whether due to network failure
177
+
or server-initiated closure), it **SHOULD** issue an HTTP GET to the MCP endpoint,
Copy file name to clipboardExpand all lines: docs/specification/draft/basic/utilities/tasks.mdx
+73-12Lines changed: 73 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -108,15 +108,15 @@ The set of capabilities in `capabilities.tasks.requests` is exhaustive. If a req
108
108
109
109
### Tool-Level Negotiation
110
110
111
-
Tool calls are given special consideration for the purpose of task augmentation. In the result of `tools/list`, tools declare support for tasks via `annotations.taskHint`, which if present can have a value of `"always"`, `"optional"`, or `"never"`.
111
+
Tool calls are given special consideration for the purpose of task augmentation. In the result of `tools/list`, tools declare support for tasks via `execution.taskSupport`, which if present can have a value of `"required"`, `"optional"`, or `"forbidden"`.
112
112
113
113
This is to be interpreted as a fine-grained layer in addition to capabilities, following these rules:
114
114
115
-
1. If a server's capabilities include `tasks.requests.tools.call: false`, then clients **MUST NOT** attempt to use task augmentation on that server's tools, regardless of the `taskHint` value.
116
-
1. If a server's capabilities include `tasks.requests.tools.call: true`, then clients consider the value of `taskHint`, and handle it accordingly:
117
-
1. If `taskHint` is not present or `"never"`, clients **MUST NOT** attempt to invoke the tool as a task. Servers **SHOULD** return a `-32601` (Method not found) error if a client attempts to do so. This is the default behavior.
118
-
1. If `taskHint` is `"optional"`, clients **MAY** invoke the tool as a task or as a normal request.
119
-
1. If `taskHint` is `"always"`, clients **SHOULD** invoke the tool as a task. Servers **MAY** return a `-32601` (Method not found) error if a client does not attempt to do so.
115
+
1. If a server's capabilities do not include `tasks.requests.tools.call`, then clients **MUST NOT** attempt to use task augmentation on that server's tools, regardless of the `execution.taskSupport` value.
116
+
1. If a server's capabilities include `tasks.requests.tools.call`, then clients consider the value of `execution.taskSupport`, and handle it accordingly:
117
+
1. If `execution.taskSupport` is not present or `"forbidden"`, clients **MUST NOT** attempt to invoke the tool as a task. Servers **SHOULD** return a `-32601` (Method not found) error if a client attempts to do so. This is the default behavior.
118
+
1. If `execution.taskSupport` is `"optional"`, clients **MAY** invoke the tool as a task or as a normal request.
119
+
1. If `execution.taskSupport` is `"required"`, clients **MUST** invoke the tool as a task. Servers **MUST** return a `-32601` (Method not found) error if a client does not attempt to do so.
120
120
121
121
## Protocol Messages
122
122
@@ -182,10 +182,18 @@ This guidance is non-binding and is provisional logic intended to account for th
182
182
183
183
### Getting Tasks
184
184
185
+
<Note>
186
+
187
+
In the Streamable HTTP (SSE) transport, clients **MAY** disconnect from an SSE stream opened by the server in response to a `tasks/get` request at any time.
188
+
189
+
While this note is not prescriptive regarding the specific usage of SSE streams, all implementations **MUST** continue to comply with the existing [Streamable HTTP transport specification](../transports#sending-messages-to-the-server).
190
+
191
+
</Note>
192
+
185
193
Requestors poll for task completion by sending [`tasks/get`](/specification/draft/schema#tasks%2Fget) requests.
186
194
Requestors **SHOULD** respect the `pollInterval` provided in responses when determining polling frequency.
187
195
188
-
Requestors **SHOULD** continue polling until the task reaches a terminal status (`completed`, `failed`, or `cancelled`), or until encountering the [`input_required`](#input-required-status) status.
196
+
Requestors **SHOULD** continue polling until the task reaches a terminal status (`completed`, `failed`, or `cancelled`), or until encountering the [`input_required`](#input-required-status) status. Note that invoking `tasks/result` does not imply that the requestor needs to stop polling - requestors **SHOULD** continue polling the task status via `tasks/get` if they are not actively waiting for `tasks/result` to complete.
189
197
190
198
**Request:**
191
199
@@ -219,10 +227,20 @@ Requestors **SHOULD** continue polling until the task reaches a terminal status
219
227
220
228
### Retrieving Task Results
221
229
230
+
<Note>
231
+
232
+
In the Streamable HTTP (SSE) transport, clients **MAY** disconnect from an SSE stream opened by the server in response to a `tasks/result` request at any time.
233
+
234
+
While this note is not prescriptive regarding the specific usage of SSE streams, all implementations **MUST** continue to comply with the existing [Streamable HTTP transport specification](../transports#sending-messages-to-the-server).
235
+
236
+
</Note>
237
+
222
238
After a task completes the operation result is retrieved via [`tasks/result`](/specification/draft/schema#tasks%2Fresult). This is distinct from the initial `CreateTaskResult` response, which contains only task data. The result structure matches the original request type (e.g., `CallToolResult` for `tools/call`).
223
239
224
240
To retrieve the result of a completed task, requestors can send a `tasks/result` request:
225
241
242
+
While `tasks/result` blocks until the task reaches a terminal status, requestors can continue polling via `tasks/get` in parallel if they are not actively blocked waiting for the result, such as if their previous `tasks/result` request failed or was cancelled. This allows requestors to monitor status changes or display progress updates while the task executes, even after invoking `tasks/result`.
243
+
226
244
**Request:**
227
245
228
246
```json
@@ -412,7 +430,9 @@ stateDiagram-v2
412
430
413
431
With the Streamable HTTP (SSE) transport, servers often close SSE streams after delivering a response message, which can lead to ambiguity regarding the stream used for subsequent task messages.
414
432
415
-
Implementations have flexibility in how they manage SSE streams during task polling and result retrieval.
433
+
Servers can handle this by enqueueing messages to the client to side-channel task-related messages alongside other responses.
434
+
435
+
Servers have flexibility in how they manage SSE streams during task polling and result retrieval, and clients **SHOULD** expect messages to be delivered on any SSE stream, including the HTTP GET stream.
416
436
One possible approach is maintaining an SSE stream on `tasks/result` (see notes on the `input_required` status).
417
437
Where possible, servers **SHOULD NOT** upgrade to an SSE stream in response to a `tasks/get` request, as the client has indicated it wishes to poll for a result.
Copy file name to clipboardExpand all lines: docs/specification/draft/changelog.mdx
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ the previous revision, [2025-06-18](/specification/2025-06-18).
14
14
3. Enhance authorization flows with incremental scope consent via `WWW-Authenticate` ([SEP-835](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/835))
15
15
4. Provide guidance on tool names ([SEP-986](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/1603))
16
16
5. Update `ElicitResult` and `EnumSchema` to use a more standards-based approach and support titled, untitled, single-select, and multi-select enums ([SEP-1330](https://github.com/modelcontextprotocol/modelcontextprotocol/issues/1330)).
17
-
6. Added support for [URL mode elicitation](/specification/draft/client/elicitation#url-elicitation-requests)([SEP-1036](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/887))
17
+
6. Added support for [URL mode elicitation](/specification/draft/client/elicitation#url-elicitation-requests)([SEP-1036](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/887))
18
18
7. Add tool calling support to sampling via `tools` and `toolChoice` parameters ([SEP-1577](https://github.com/modelcontextprotocol/modelcontextprotocol/issues/1577))
19
19
8. Add support for OAuth Client ID Metadata Documents as a recommended client registration mechanism ([SEP-991](https://github.com/modelcontextprotocol/modelcontextprotocol/issues/991), PR [#1296](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/1296))
20
20
9. Add experimental support for [tasks](/specification/draft/basic/utilities/tasks) to enable tracking durable requests with polling and deferred result retrieval ([SEP-1686](https://github.com/modelcontextprotocol/modelcontextprotocol/issues/1686)).
@@ -26,9 +26,10 @@ the previous revision, [2025-06-18](/specification/2025-06-18).
26
26
3. Updated the [Security Best Practices guidance](https://modelcontextprotocol.io/specification/draft/basic/security_best_practices).
27
27
4. Clarify that input validation errors should be returned as Tool Execution Errors rather than Protocol Errors to enable model self-correction ([SEP-1303](https://github.com/modelcontextprotocol/modelcontextprotocol/issues/1303)).
28
28
5. Support polling SSE streams by allowing servers to disconnect at will ([SEP-1699](https://github.com/modelcontextprotocol/modelcontextprotocol/issues/1699)).
29
-
6. Align OAuth 2.0 Protected Resource Metadata discovery with RFC 9728, making `WWW-Authenticate` header optional with fallback to `.well-known` endpoint ([SEP-985](https://github.com/modelcontextprotocol/modelcontextprotocol/issues/985)).
30
-
7. Add support for default values in all primitive types (string, number, enum) for elicitation schemas ([SEP-1034](https://github.com/modelcontextprotocol/modelcontextprotocol/issues/1034)).
31
-
8. Establish JSON Schema 2020-12 as the default dialect for MCP schema definitions ([SEP-1613](https://github.com/modelcontextprotocol/modelcontextprotocol/issues/1613)).
29
+
6. Clarify SEP-1699: GET streams support polling, resumption always via GET regardless of stream origin, event IDs should encode stream identity, disconnection includes server-initiated closure (Issue [#1847](https://github.com/modelcontextprotocol/modelcontextprotocol/issues/1847)).
30
+
7. Align OAuth 2.0 Protected Resource Metadata discovery with RFC 9728, making `WWW-Authenticate` header optional with fallback to `.well-known` endpoint ([SEP-985](https://github.com/modelcontextprotocol/modelcontextprotocol/issues/985)).
31
+
8. Add support for default values in all primitive types (string, number, enum) for elicitation schemas ([SEP-1034](https://github.com/modelcontextprotocol/modelcontextprotocol/issues/1034)).
32
+
9. Establish JSON Schema 2020-12 as the default dialect for MCP schema definitions ([SEP-1613](https://github.com/modelcontextprotocol/modelcontextprotocol/issues/1613)).
0 commit comments