Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 2.1k
[SEP-2663] refactor!: remove 2025-11 experimental tasks#2128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
adb443e65dcf1e8064c37b1ada31File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| '@modelcontextprotocol/core': major | ||
| '@modelcontextprotocol/server': major | ||
| '@modelcontextprotocol/client': major | ||
| --- | ||
| SEP-2663: remove 2025-11 experimental tasks (TaskManager, experimental.tasks.* accessors). Tasks are now Extensions Track. | ||
felixweinberger marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -544,7 +544,7 @@ All requests have a 60-second default timeout. Pass a custom `timeout` in the op | ||
| ```ts source="../examples/client/src/clientGuide.examples.ts#errorHandling_timeout" | ||
| try { | ||
| const result = await client.callTool( | ||
| { name: 'slow-task', arguments: {} }, | ||
| { name: 'slow-operation', arguments: {} }, | ||
| { timeout: 120_000 } // 2 minutes instead of the default 60 seconds | ||
| ); | ||
| console.log(result.content); | ||
claude[bot] marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| @@ -581,7 +581,7 @@ let lastToken: string | undefined; | ||
| const result = await client.request( | ||
| { | ||
| method: 'tools/call', | ||
| params: { name: 'long-running-task', arguments: {} } | ||
| params: { name: 'long-running-operation', arguments: {} } | ||
| }, | ||
| { | ||
| resumptionToken: lastToken, | ||
| @@ -596,18 +596,6 @@ console.log(result); | ||
| 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). | ||
| ## Tasks (experimental) | ||
| > [!WARNING] | ||
| > The tasks API is experimental and may change without notice. | ||
| 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: | ||
| - 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. | ||
| - 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. | ||
| For a full runnable example, see [`simpleTaskInteractiveClient.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/examples/client/src/simpleTaskInteractiveClient.ts). | ||
| ## See also | ||
| - [`examples/client/`](https://github.com/modelcontextprotocol/typescript-sdk/tree/main/examples/client) — Full runnable client examples | ||
Large diffs are not rendered by default.
Uh oh!
There was an error while loading. Please reload this page.
Large diffs are not rendered by default.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -4,7 +4,7 @@ import { createServer } from 'node:http'; | ||
| import { createInterface } from 'node:readline'; | ||
| import { URL } from 'node:url'; | ||
| import type { CallToolResult, ListToolsRequest, OAuthClientMetadata } from '@modelcontextprotocol/client'; | ||
| import type { ListToolsRequest, OAuthClientMetadata } from '@modelcontextprotocol/client'; | ||
| import { Client, StreamableHTTPClientTransport, UnauthorizedError } from '@modelcontextprotocol/client'; | ||
| import open from 'open'; | ||
| @@ -209,7 +209,7 @@ class InteractiveOAuthClient { | ||
| console.log('Commands:'); | ||
| console.log(' list - List available tools'); | ||
| console.log(' call <tool_name> [args] - Call a tool'); | ||
| console.log(' stream <tool_name> [args] - Call a tool with streaming (shows task status)'); | ||
| console.log(' stream <tool_name> [args] - (disabled; returns when the SEP-2663 tasks extension lands)'); | ||
| console.log(' quit - Exit the client'); | ||
| console.log(); | ||
| @@ -232,7 +232,7 @@ class InteractiveOAuthClient { | ||
| } else if (command.startsWith('stream ')) { | ||
| await this.handleStreamTool(command); | ||
| } else { | ||
| console.log("❌ Unknown command. Try 'list', 'call <tool_name>', 'stream <tool_name>', or 'quit'"); | ||
| console.log("❌ Unknown command. Try 'list', 'call <tool_name>', or 'quit'"); | ||
| } | ||
| } catch (error) { | ||
| if (error instanceof Error && error.message === 'SIGINT') { | ||
| @@ -358,62 +358,11 @@ class InteractiveOAuthClient { | ||
| return; | ||
| } | ||
| try { | ||
| // Using the experimental tasks API - WARNING: may change without notice | ||
| console.log(`\n🔧 Streaming tool '${toolName}'...`); | ||
| const stream = this.client.experimental.tasks.callToolStream( | ||
| { | ||
| name: toolName, | ||
| arguments: toolArgs | ||
| }, | ||
| { | ||
| task: { | ||
| taskId: `task-${Date.now()}`, | ||
| ttl: 60_000 | ||
| } | ||
| } | ||
| ); | ||
| // Iterate through all messages yielded by the generator | ||
| for await (const message of stream) { | ||
| switch (message.type) { | ||
| case 'taskCreated': { | ||
| console.log(`✓ Task created: ${message.task.taskId}`); | ||
| break; | ||
| } | ||
| case 'taskStatus': { | ||
| console.log(`⟳ Status: ${message.task.status}`); | ||
| if (message.task.statusMessage) { | ||
| console.log(` ${message.task.statusMessage}`); | ||
| } | ||
| break; | ||
| } | ||
| case 'result': { | ||
| console.log('✓ Completed!'); | ||
| const toolResult = message.result as CallToolResult; | ||
| for (const content of toolResult.content) { | ||
| if (content.type === 'text') { | ||
| console.log(content.text); | ||
| } else { | ||
| console.log(content); | ||
| } | ||
| } | ||
| break; | ||
| } | ||
| case 'error': { | ||
| console.log('✗ Error:'); | ||
| console.log(` ${message.error.message}`); | ||
| break; | ||
| } | ||
| } | ||
| } | ||
| } catch (error) { | ||
| console.error(`❌ Failed to stream tool '${toolName}':`, error); | ||
| } | ||
| // The streaming-tool demo (callToolStream) was removed with the 2025-11 | ||
| // experimental tasks (SEP-2663); it returns when the tasks extension lands. | ||
| void toolName; | ||
| void toolArgs; | ||
| console.log('Streaming tool demo removed with the 2025-11 experimental tasks (SEP-2663); returns when the tasks extension lands.'); | ||
| } | ||
| close(): void { | ||
claude[bot] marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.