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
Removes the 2025-11 experimental tasks side-channel through Protocol:
TaskManager, processInbound*/processOutbound*, task interception, the
experimental.tasks.* client/server accessors, and all task-augmented
request handling.
Also extends beyond the implementation deletion to scrub remaining
references in examples, docs, and comments. The only task-related
symbol remaining in packages/*.ts is `taskSupport` in ToolExecutionSchema,
kept solely to match spec.types.ts (which still declares it); both are
removed together in the next commit (spec regen).
CHANGELOG entries are preserved (historical record). Migration docs
retain a brief removal note. `microtask`/`platformBackgroundTask` are
JS/platform terminology, not MCP tasks.
Satisfies: SEP-2663 (core-removal half; tasks are now Extensions Track).
For an end-to-end example of server-initiated SSE disconnection and automatic client reconnection with event replay, see [`ssePollingClient.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/examples/client/src/ssePollingClient.ts).
598
598
599
-
## Tasks (experimental)
600
-
601
-
> [!WARNING]
602
-
> The tasks API is experimental and may change without notice.
603
-
604
-
Task-based execution enables "call-now, fetch-later" patterns for long-running operations (see [Tasks](https://modelcontextprotocol.io/specification/latest/basic/utilities/tasks) in the MCP specification). Instead of returning a result immediately, a tool creates a task that can be polled or resumed later. To use tasks:
605
-
606
-
- Call {@linkcode@modelcontextprotocol/client!experimental/tasks/client.ExperimentalClientTasks#callToolStream | client.experimental.tasks.callToolStream(...)} to start a tool call that may create a task and emit status updates over time.
607
-
- Call {@linkcode@modelcontextprotocol/client!experimental/tasks/client.ExperimentalClientTasks#getTask | client.experimental.tasks.getTask(...)} and {@linkcode@modelcontextprotocol/client!experimental/tasks/client.ExperimentalClientTasks#getTaskResult | getTaskResult(...)} to check status and fetch results after reconnecting.
608
-
609
-
For a full runnable example, see [`simpleTaskInteractiveClient.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/examples/client/src/simpleTaskInteractiveClient.ts).
610
-
611
599
## See also
612
600
613
601
-[`examples/client/`](https://github.com/modelcontextprotocol/typescript-sdk/tree/main/examples/client) — Full runnable client examples
|`extra.taskStore` / `taskId` / `taskRequestedTtl`|_removed; see §12_|
426
424
427
425
`ServerContext` convenience methods (new in v2, no v1 equivalent):
428
426
@@ -473,24 +471,26 @@ If a `*Schema` constant was used for **runtime validation** (not just as a `requ
473
471
474
472
`isCallToolResult(value)` still works, but `isSpecType` covers every spec type by name.
475
473
476
-
## 12. Experimental: `TaskCreationParams.ttl` no longer accepts `null`
474
+
## 12. Experimental tasks interception removed
477
475
478
-
`TaskCreationParams.ttl` changed from `z.union([z.number(), z.null()]).optional()` to `z.number().optional()`. Per the MCP spec, `null` TTL (unlimited lifetime) is only valid in server responses (`Task.ttl`), not in client requests. Omit `ttl` to let the server decide.
476
+
The 2025-11 task side-channel through `Protocol` is removed (was always `@experimental`). No mechanical migration; remove usages.
### Experimental: `TaskCreationParams.ttl` no longer accepts `null`
854
+
### Experimental tasks interception removed
857
855
858
-
The `ttl` field in `TaskCreationParams` (used when requesting the server to create a task) no longer accepts `null`. Per the MCP spec, `null` TTL (meaning unlimited lifetime) is only valid in server responses (`Task.ttl`), not in client requests. Clients should omit `ttl` to let
859
-
the server decide the lifetime.
856
+
The 2025-11 experimental tasks side-channel woven through `Protocol` has been removed in preparation for the SEP-2663 Tasks Extension. The following are gone with no in-place replacement:
860
857
861
-
This also narrows the type of `requestedTtl` in `TaskContext`, `CreateTaskServerContext`, and `TaskServerContext` from `number | null | undefined` to `number | undefined`.
858
+
-`ProtocolOptions.tasks` (the `{ taskStore, taskMessageQueue }` constructor option)
-`client.experimental.tasks.*` / `server.experimental.tasks.*` / `mcpServer.experimental.tasks.*` accessors and the `Experimental{Client,Server,McpServer}Tasks` classes
864
+
- streaming methods (`requestStream`, `callToolStream`, `createMessageStream`, `elicitInputStream`) and the `ResponseMessage` types they yielded
**Unchanged:** the storage layer (`TaskStore`, `InMemoryTaskStore`, `CreateTaskOptions`, `isTerminal`). It will be consumed by the SEP-2663 server-directed plugin in a follow-up.
There is no migration path for the removed surface; it was always `@experimental`. Under SEP-2663, tasks reattach via a `DispatchMiddleware` (`mcp.use(tasksPlugin({ store }))`) and handlers read task context from `ctx.ext.task` instead of `ctx.task`.
878
872
879
-
**After (v2):**
880
-
881
-
```typescript
882
-
// Omit ttl to let the server decide (server may return null for unlimited)
#### `TaskCreationParams.ttl` no longer accepts `null`
894
874
895
-
> **Note:** These task APIs are marked `@experimental` and may change without notice.
875
+
`TaskCreationParams.ttl` (the storage-layer creation parameter) is now `number | undefined`; `null` is no longer accepted. Per the MCP spec, `null` TTL (unlimited lifetime) is only valid in server responses (`Task.ttl`), not in creation requests. Omit `ttl` to let the store decide. This is a storage-interface change and is independent of the Protocol-level removals above.
Copy file name to clipboardExpand all lines: docs/server.md
-13Lines changed: 0 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -495,19 +495,6 @@ server.registerTool(
495
495
);
496
496
```
497
497
498
-
## Tasks (experimental)
499
-
500
-
> [!WARNING]
501
-
> The tasks API is experimental and may change without notice.
502
-
503
-
Task-based execution enables "call-now, fetch-later" patterns for long-running operations (see [Tasks](https://modelcontextprotocol.io/specification/latest/basic/utilities/tasks) in the MCP specification). Instead of returning a result immediately, a tool creates a task that can be polled or resumed later. To use tasks:
504
-
505
-
- Provide a {@linkcode@modelcontextprotocol/server!index.TaskStore | TaskStore} implementation that persists task metadata and results (see {@linkcode@modelcontextprotocol/server!index.InMemoryTaskStore | InMemoryTaskStore} for reference).
506
-
- Enable the `tasks` capability when constructing the server.
507
-
- Register tools with {@linkcode@modelcontextprotocol/server!experimental/tasks/mcpServer.ExperimentalMcpServerTasks#registerToolTask | server.experimental.tasks.registerToolTask(...)}.
508
-
509
-
For a full runnable example, see [`simpleTaskInteractive.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/examples/server/src/simpleTaskInteractive.ts).
510
-
511
498
## Shutdown
512
499
513
500
For stateful multi-session HTTP servers, capture the `http.Server` from `app.listen()` so you can stop accepting connections, then close each session transport:
| Interactive Streamable HTTP client | CLI client that exercises tools/resources/prompts, notifications, elicitation, and tasks. |[`src/simpleStreamableHttp.ts`](src/simpleStreamableHttp.ts)|
30
-
| Backwards-compatible client (Streamable HTTP → SSE) | Tries Streamable HTTP first, falls back to legacy SSE on 4xx responses. |[`src/streamableHttpWithSseFallbackClient.ts`](src/streamableHttpWithSseFallbackClient.ts)|
31
-
| SSE polling client (legacy) | Polls a legacy HTTP+SSE server and demonstrates notification handling. |[`src/ssePollingClient.ts`](src/ssePollingClient.ts)|
| Multiple clients in parallel | Connects multiple clients concurrently to the same server. |[`src/multipleClientsParallel.ts`](src/multipleClientsParallel.ts)|
| Interactive Streamable HTTP client | CLI client that exercises tools/resources/prompts, notifications, and elicitation. |[`src/simpleStreamableHttp.ts`](src/simpleStreamableHttp.ts)|
30
+
| Backwards-compatible client (Streamable HTTP → SSE) | Tries Streamable HTTP first, falls back to legacy SSE on 4xx responses. |[`src/streamableHttpWithSseFallbackClient.ts`](src/streamableHttpWithSseFallbackClient.ts)|
31
+
| SSE polling client (legacy) | Polls a legacy HTTP+SSE server and demonstrates notification handling. |[`src/ssePollingClient.ts`](src/ssePollingClient.ts)|
| Multiple clients in parallel | Connects multiple clients concurrently to the same server. |[`src/multipleClientsParallel.ts`](src/multipleClientsParallel.ts)|
0 commit comments