modelcontextprotocol / modelcontextprotocol/php-sdk
[Server] SEP-2663 Tasks: TasksExtension, capability gate, tasks/* handlers
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 1.6k
- Forks
- 173
- Avg merge
- 2d 49m
- Merged PRs (30d)
- 23
Description
Server-side handler portion of SEP-2663 for the 2026-07-28 release. Tracked by umbrella #335; sits on the SEP-2133 extensions framework (#344).
Scope
Mcp\Server\Task\TasksExtensionimplementsMethodProvidingExtensionInterfaceandArgumentProvidingExtensionInterface(new, generic: an extension registers its message classes, handlers and injectable handler arguments throughBuilder::enableExtension(); the core never names the extension). Enable withnew TasksExtension($store, $inputHandler)and thetasks/get/tasks/update/tasks/cancelsurface appears; no separatesetTaskStore()builder knob.- Handlers under
Mcp\Server\Task\Handler\:TasksGetHandler,TasksUpdateHandler,TasksCancelHandler. - Capability gate:
TaskCapabilityGuardreads whatinitializeleft in the session and refuses thetasks/*methods with-32021(missing required client capability) for a client that did not declare the extension. - Handlers get a
TaskContextby declaring the parameter:isSupported()so a handler that can work either way asks first,create()stores the task before returning theCreateTaskResult(so the firsttasks/getcannot arrive before the task exists) and refuses an undeclared client with-32021,getStore().
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the SEP-2133 extensions framework in #344 and the Builder::enableExtension() path, then inspect TasksExtension and the handlers under Mcp\Server\Task\Handler. Trace TaskCapabilityGuard and TaskContext to verify the declared-client checks, task creation ordering, and store access. Done means the tasks/* surface is registered through TasksExtension and missing client capability returns -32021 as specified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100