Skip to content

Commit c8d7401

Browse files
[SEP-2663] refactor!: remove 2025-11 experimental tasks (#2128)
1 parent 600ba75 commit c8d7401

73 files changed

Lines changed: 423 additions & 18280 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/fix-failed-task-result-retrieval.md

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@modelcontextprotocol/core': major
3+
'@modelcontextprotocol/server': major
4+
'@modelcontextprotocol/client': major
5+
---
6+
SEP-2663: remove 2025-11 experimental tasks (TaskManager, experimental.tasks.* accessors). Tasks are now Extensions Track.

CLAUDE.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,7 @@ The repo also ships “middleware” packages under `packages/middleware/` (e.g.
104104

105105
### Experimental Features
106106

107-
Located in `packages/*/src/experimental/`:
108-
109-
- **Tasks**: Long-running task support with polling/resumption (`packages/core/src/experimental/tasks/`)
107+
Located in `packages/*/src/experimental/`. Currently empty.
110108

111109
### Zod Schemas
112110

@@ -201,7 +199,6 @@ The `ctx` parameter in handlers provides a structured context:
201199
- `notify(notification)`: Send related notification back
202200
- `http?`: HTTP transport info (undefined for stdio)
203201
- `authInfo?`: Validated auth token info
204-
- `task?`: Task context (`{ id?, store, requestedTtl? }`) when task storage is configured
205202

206203
**`ServerContext`** extends `BaseContext.mcpReq` and `BaseContext.http?` via type intersection:
207204

docs/client.md

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ All requests have a 60-second default timeout. Pass a custom `timeout` in the op
544544
```ts source="../examples/client/src/clientGuide.examples.ts#errorHandling_timeout"
545545
try {
546546
const result = await client.callTool(
547-
{ name: 'slow-task', arguments: {} },
547+
{ name: 'slow-operation', arguments: {} },
548548
{ timeout: 120_000 } // 2 minutes instead of the default 60 seconds
549549
);
550550
console.log(result.content);
@@ -581,7 +581,7 @@ let lastToken: string | undefined;
581581
const result = await client.request(
582582
{
583583
method: 'tools/call',
584-
params: { name: 'long-running-task', arguments: {} }
584+
params: { name: 'long-running-operation', arguments: {} }
585585
},
586586
{
587587
resumptionToken: lastToken,
@@ -596,18 +596,6 @@ console.log(result);
596596

597597
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).
598598

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-
611599
## See also
612600

613601
- [`examples/client/`](https://github.com/modelcontextprotocol/typescript-sdk/tree/main/examples/client) — Full runnable client examples

docs/migration-SKILL.md

Lines changed: 72 additions & 71 deletions
Large diffs are not rendered by default.

docs/migration.md

Lines changed: 68 additions & 81 deletions
Large diffs are not rendered by default.

docs/server.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -495,19 +495,6 @@ server.registerTool(
495495
);
496496
```
497497

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-
511498
## Shutdown
512499

513500
For stateful multi-session HTTP servers, capture the `http.Server` from `app.listen()` so you can stop accepting connections, then close each session transport:

examples/client/README.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,17 @@ Most clients expect a server to be running. Start one from [`../server/README.md
2424

2525
## Example index
2626

27-
| Scenario | Description | File |
28-
| --------------------------------------------------- | ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
29-
| 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) |
32-
| Parallel tool calls | Runs multiple tool calls in parallel. | [`src/parallelToolCallsClient.ts`](src/parallelToolCallsClient.ts) |
33-
| Multiple clients in parallel | Connects multiple clients concurrently to the same server. | [`src/multipleClientsParallel.ts`](src/multipleClientsParallel.ts) |
34-
| OAuth client (interactive) | OAuth-enabled client (dynamic registration, auth flow). | [`src/simpleOAuthClient.ts`](src/simpleOAuthClient.ts) |
35-
| OAuth provider helper | Demonstrates reusable OAuth providers. | [`src/simpleOAuthClientProvider.ts`](src/simpleOAuthClientProvider.ts) |
36-
| Client credentials (M2M) | Machine-to-machine OAuth client credentials example. | [`src/simpleClientCredentials.ts`](src/simpleClientCredentials.ts) |
37-
| URL elicitation client | Drives URL-mode elicitation flows (sensitive input in a browser). | [`src/elicitationUrlExample.ts`](src/elicitationUrlExample.ts) |
38-
| Task interactive client | Demonstrates task-based execution + interactive server→client requests. | [`src/simpleTaskInteractiveClient.ts`](src/simpleTaskInteractiveClient.ts) |
27+
| Scenario | Description | File |
28+
| --------------------------------------------------- | ---------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
29+
| 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) |
32+
| Parallel tool calls | Runs multiple tool calls in parallel. | [`src/parallelToolCallsClient.ts`](src/parallelToolCallsClient.ts) |
33+
| Multiple clients in parallel | Connects multiple clients concurrently to the same server. | [`src/multipleClientsParallel.ts`](src/multipleClientsParallel.ts) |
34+
| OAuth client (interactive) | OAuth-enabled client (dynamic registration, auth flow). | [`src/simpleOAuthClient.ts`](src/simpleOAuthClient.ts) |
35+
| OAuth provider helper | Demonstrates reusable OAuth providers. | [`src/simpleOAuthClientProvider.ts`](src/simpleOAuthClientProvider.ts) |
36+
| Client credentials (M2M) | Machine-to-machine OAuth client credentials example. | [`src/simpleClientCredentials.ts`](src/simpleClientCredentials.ts) |
37+
| URL elicitation client | Drives URL-mode elicitation flows (sensitive input in a browser). | [`src/elicitationUrlExample.ts`](src/elicitationUrlExample.ts) |
3938

4039
## URL elicitation example (server + client)
4140

examples/client/src/clientGuide.examples.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ async function errorHandling_timeout(client: Client) {
490490
//#region errorHandling_timeout
491491
try {
492492
const result = await client.callTool(
493-
{ name: 'slow-task', arguments: {} },
493+
{ name: 'slow-operation', arguments: {} },
494494
{ timeout: 120_000 } // 2 minutes instead of the default 60 seconds
495495
);
496496
console.log(result.content);
@@ -530,7 +530,7 @@ async function resumptionToken_basic(client: Client) {
530530
const result = await client.request(
531531
{
532532
method: 'tools/call',
533-
params: { name: 'long-running-task', arguments: {} }
533+
params: { name: 'long-running-operation', arguments: {} }
534534
},
535535
{
536536
resumptionToken: lastToken,

examples/client/src/simpleOAuthClient.ts

Lines changed: 8 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { createServer } from 'node:http';
44
import { createInterface } from 'node:readline';
55
import { URL } from 'node:url';
66

7-
import type { CallToolResult, ListToolsRequest, OAuthClientMetadata } from '@modelcontextprotocol/client';
7+
import type { ListToolsRequest, OAuthClientMetadata } from '@modelcontextprotocol/client';
88
import { Client, StreamableHTTPClientTransport, UnauthorizedError } from '@modelcontextprotocol/client';
99
import open from 'open';
1010

@@ -209,7 +209,7 @@ class InteractiveOAuthClient {
209209
console.log('Commands:');
210210
console.log(' list - List available tools');
211211
console.log(' call <tool_name> [args] - Call a tool');
212-
console.log(' stream <tool_name> [args] - Call a tool with streaming (shows task status)');
212+
console.log(' stream <tool_name> [args] - (disabled; returns when the SEP-2663 tasks extension lands)');
213213
console.log(' quit - Exit the client');
214214
console.log();
215215

@@ -232,7 +232,7 @@ class InteractiveOAuthClient {
232232
} else if (command.startsWith('stream ')) {
233233
await this.handleStreamTool(command);
234234
} else {
235-
console.log("❌ Unknown command. Try 'list', 'call <tool_name>', 'stream <tool_name>', or 'quit'");
235+
console.log("❌ Unknown command. Try 'list', 'call <tool_name>', or 'quit'");
236236
}
237237
} catch (error) {
238238
if (error instanceof Error && error.message === 'SIGINT') {
@@ -358,62 +358,11 @@ class InteractiveOAuthClient {
358358
return;
359359
}
360360

361-
try {
362-
// Using the experimental tasks API - WARNING: may change without notice
363-
console.log(`\n🔧 Streaming tool '${toolName}'...`);
364-
365-
const stream = this.client.experimental.tasks.callToolStream(
366-
{
367-
name: toolName,
368-
arguments: toolArgs
369-
},
370-
{
371-
task: {
372-
taskId: `task-${Date.now()}`,
373-
ttl: 60_000
374-
}
375-
}
376-
);
377-
378-
// Iterate through all messages yielded by the generator
379-
for await (const message of stream) {
380-
switch (message.type) {
381-
case 'taskCreated': {
382-
console.log(`✓ Task created: ${message.task.taskId}`);
383-
break;
384-
}
385-
386-
case 'taskStatus': {
387-
console.log(`⟳ Status: ${message.task.status}`);
388-
if (message.task.statusMessage) {
389-
console.log(` ${message.task.statusMessage}`);
390-
}
391-
break;
392-
}
393-
394-
case 'result': {
395-
console.log('✓ Completed!');
396-
const toolResult = message.result as CallToolResult;
397-
for (const content of toolResult.content) {
398-
if (content.type === 'text') {
399-
console.log(content.text);
400-
} else {
401-
console.log(content);
402-
}
403-
}
404-
break;
405-
}
406-
407-
case 'error': {
408-
console.log('✗ Error:');
409-
console.log(` ${message.error.message}`);
410-
break;
411-
}
412-
}
413-
}
414-
} catch (error) {
415-
console.error(`❌ Failed to stream tool '${toolName}':`, error);
416-
}
361+
// The streaming-tool demo (callToolStream) was removed with the 2025-11
362+
// experimental tasks (SEP-2663); it returns when the tasks extension lands.
363+
void toolName;
364+
void toolArgs;
365+
console.log('Streaming tool demo removed with the 2025-11 experimental tasks (SEP-2663); returns when the tasks extension lands.');
417366
}
418367

419368
close(): void {

0 commit comments

Comments
 (0)