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_|
435
433
436
434
`ServerContext` convenience methods (new in v2, no v1 equivalent):
437
435
@@ -482,24 +480,24 @@ If a `*Schema` constant was used for **runtime validation** (not just as a `requ
482
480
483
481
`isCallToolResult(value)` still works, but `isSpecType` covers every spec type by name.
484
482
485
-
## 12. Experimental: `TaskCreationParams.ttl` no longer accepts `null`
483
+
## 12. Experimental tasks interception removed
486
484
487
-
`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.
485
+
The 2025-11 task side-channel through `Protocol` is removed (was always `@experimental`). No mechanical migration; remove usages.
> These task APIs are `@experimental` and may change without notice.
500
+
`TaskStore` / `InMemoryTaskStore` / `CreateTaskOptions` / `isTerminal` (storage layer) and `TaskCreationParams` are also removed; they will return with the SEP-2663 server-directed plugin.
const result =awaitclient.callTool({ name: 'my-tool', arguments: {} });
494
494
```
495
495
496
-
The return type is now inferred from the method name via `ResultTypeMap`. For example, `client.request({ method: 'tools/call', ... })` returns `Promise<CallToolResult | CreateTaskResult>`.
496
+
The return type is now inferred from the method name via `ResultTypeMap`. For example, `client.request({ method: 'tools/call', ... })` returns `Promise<CallToolResult>`.
497
497
498
498
For **custom (non-spec)** methods, keep the result-schema argument — see [Sending custom-method requests](#sending-custom-method-requests). Only drop the schema when calling a spec method.
499
499
@@ -599,9 +599,7 @@ The `RequestHandlerExtra` type has been replaced with a structured context type
599
599
|`extra.closeSSEStream`|`ctx.http?.closeSSE` (only on `ServerContext`) |
600
600
|`extra.closeStandaloneSSEStream`|`ctx.http?.closeStandaloneSSE` (only on `ServerContext`) |
-**`sessionId?`** — transport session identifier (top-level)
633
630
634
631
`BaseContext` is the common base type shared by both `ServerContext` and `ClientContext`. `ServerContext` extends each group with server-specific additions via type intersection.
635
632
@@ -870,46 +867,24 @@ try {
870
867
}
871
868
```
872
869
873
-
### Experimental: `TaskCreationParams.ttl` no longer accepts `null`
870
+
### Experimental tasks interception removed
874
871
875
-
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
876
-
the server decide the lifetime.
872
+
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:
877
873
878
-
This also narrows the type of `requestedTtl` in `TaskContext`, `CreateTaskServerContext`, and `TaskServerContext` from `number | null | undefined` to `number | undefined`.
874
+
-`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
880
+
- streaming methods (`requestStream`, `callToolStream`, `createMessageStream`, `elicitInputStream`) and the `ResponseMessage` types they yielded
**Also removed:** the storage layer (`TaskStore`, `InMemoryTaskStore`, `CreateTaskOptions`, `isTerminal`) and `TaskCreationParams`. They will return as part of the SEP-2663 server-directed plugin in a follow-up.
911
886
912
-
> **Note:** These task APIs are marked `@experimental`and may change without notice.
887
+
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`.
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