Skip to content

[Server] Add the Tasks extension (SEP-2663), experimental - #776

Open
soyuka wants to merge 2 commits into
modelcontextprotocol:mainfrom
soyuka:feat/tasks-extension
Open

soyuka wants to merge 2 commits into
modelcontextprotocol:mainfrom
soyuka:feat/tasks-extension

Conversation

@soyuka

@soyuka soyuka commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Builds on #428 by @chr-hertel, his commit is kept as is, the rework is on top.

Marked experimental: SEP-3570 (promote tasks into core, targets 2027) will rework the input loop through MRTR, so this ships the part that survives it.

What changed compared to #428:

  • TaskManager held by the application (create(RequestContext $context)) instead of injecting a TaskContext through a new ArgumentProvidingExtensionInterface, no more changes to ReferenceHandler, SchemaGenerator or Builder
  • tools/call only (SEP §Supported Methods), prompt/resource tasks removed
  • no tasks/update nor input_required for now, same as the python SDK
  • served on 2026-07-28 only, the SEP says the extension does not exist on 2025-11-25 (tasks/* answer -32601 there)
  • tasks bound to the OAuth client id and subject of the access token (SEP §Security MUST), mismatch answers -32602 like an unknown task; ids are always UUIDv4, without auth the id is the bearer
  • terminal states are final, a worker can't overwrite a cancel
  • Psr16TaskStore::save() throws when the cache write fails (durable creation MUST), null ttlMs means no expiry
  • Client::callTool() throws on a task result and points to TaskClient::callTool()
  • schema moved under Mcp\Schema\Extension\Tasks, TaskResult, TaskCapabilityGuard and TaskInputHandlerInterface removed

Closes #428, closes #347, closes #348
Partially addresses #345, #346 and #349: no tasks/update nor inputRequests until SEP-3570 settles the input loop through MRTR. Umbrella #335.

chr-hertel and others added 2 commits November 26, 2026 15:12
`io.modelcontextprotocol/tasks`: `Task` and `TaskStatus`, `ResultType::Task`,
the `CreateTaskResult` / `TaskResult` wire shapes, the `tasks/get` /
`tasks/update` / `tasks/cancel` handlers behind `TasksExtension`,
`TaskStoreInterface` with in-memory and PSR-16 stores, and a `TaskContext`
handed to handlers for creating tasks — refused with -32021 for a client that
did not declare the extension.

The core stays extension-agnostic: `MethodProvidingExtensionInterface` and
`ArgumentProvidingExtensionInterface` let an extension register its messages,
handlers and injectable handler arguments; the core handlers pass any
`ResultInterface` through; a `MissingRequiredClientCapabilityException` from
handler code becomes -32021; `Client::request()` sends any request. On the
client, `TaskClient` speaks the extension. Covered end to end by an integration
test against a stdio fixture server. Extension settings serialize as `{}`
rather than `[]` when empty.
Scope it to what survives SEP-3570 and fix the SEP-2663 deviations:
- TaskManager held by the application replaces the argument provider seam
- tools/call only, no tasks/update nor input_required until MRTR lands
- served on 2026-07-28 only, tasks bound to the OAuth client and subject
- terminal states are final, PSR-16 writes are checked
- Client::callTool() refuses a task result, use TaskClient
- marked experimental

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants