[Schema][Client][Server] Add the Tasks extension (SEP-2663) - #428
Open
chr-hertel wants to merge 1 commit into
Open
[Schema][Client][Server] Add the Tasks extension (SEP-2663)#428chr-hertel wants to merge 1 commit into
chr-hertel wants to merge 1 commit into
Conversation
chr-hertel
requested review from
CodeWithKyrian,
Nyholm and
soyuka
as code owners
August 17, 2026 23:29
chr-hertel
force-pushed
the
feat-ext-tasks
branch
2 times, most recently
from
August 17, 2026 23:55
8f72d47 to
027d67d
Compare
`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.
chr-hertel
force-pushed
the
feat-ext-tasks
branch
from
August 18, 2026 00:12
027d67d to
5d6ba73
Compare
chr-hertel
added a commit
to chr-hertel/php-sdk
that referenced
this pull request
Aug 18, 2026
Squashed WIP: the modern (SEP-2575) stateless lifecycle end to end - server dispatcher, per-era wire codec, standard header validation, multi round-trip requests, subscriptions, cache policy, the generic extensions framework, and a client that speaks it. Tasks (SEP-2663) is carved out to modelcontextprotocol#428. To be decomposed before review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
io.modelcontextprotocol/tasks(SEP-2663), server and client, without the core learning about it.Generic seams (core, extension-agnostic)
MethodProvidingExtensionInterface: an extension's message classes go to theMessageFactory, its handlers to the server, viaBuilder::enableExtension().ArgumentProvidingExtensionInterface: an extension hands handlers objects of its own — injected byReferenceHandlerlike aRequestContext, left out of generated input schemas bySchemaGenerator.CallToolHandler/GetPromptHandler/ReadResourceHandlerpass anyResultInterfacea handler returns through untouched.MissingRequiredClientCapabilityExceptionthrown from handler code is answered as-32021(handlers andProtocol).Client::request()sends any request; the typed API is unchanged.Response/RequestHandlerInterfacecovariant in their result type; extension settings serialize as{}rather than[]when empty.Tasks extension (on those seams)
Task(fromArray()),TaskStatus,ResultType::Task,CreateTaskResult/TaskResult(flat),TasksGet/Update/CancelRequest.TasksExtension(Server\Task):tasks/get/tasks/update/tasks/cancelhandlers gated with-32021,TaskStoreInterfacewithInMemoryTaskStore(bounded) andPsr16TaskStore, and aTaskContextprovided to handlers:isSupported(),create()(stores before handing out; refuses undeclared clients),getStore(). Advancing a task is the application's job.Client\Builder::enableExtension(new TasksExtension())declares it;Client\Task\TaskClientspeaks it —callTool()/getPrompt()/readResource()returningCreateTaskResultwhen the server answered with a task,get()/update()/cancel().tests/Integration/TasksTestruns the loop against a stdio fixture: handle → poll → completed,input_required→update→ completed, failed, cancel, both-32021refusals, sync fallback, unknown task, prompt-as-task.docs/extensions.md(server and client), CHANGELOG.Design decisions vs. the original issue sketches are recorded in the rewritten #345–#349.