modelcontextprotocol / modelcontextprotocol/php-sdk
[Server] SEP-2663 Tasks: Handlers return task handles; the application advances the task
未关闭
还没有人认领这个 Issue。
2026-07-28
enhancement
improves spec compliance
needs design
Server
- 主要语言
- PHP
- 星标
- 1.6k
- 派生
- 173
- 平均合并
- 2 天 49 分钟
- 30 天内合并 PR
- 23
描述
Execution model for SEP-2663 for the 2026-07-28 release. Tracked by umbrella #335.
Decision
The SDK owns storage and the tasks/* surface; advancing a task is the application's job. PHP has no in-process background executor to build on, and picking a queue or process model on the user's behalf would be the wrong call for a framework-agnostic SDK.
Scope
- Any tool, prompt or resource handler may return a
CreateTaskResult(viaTaskContext::create()) instead of its usual result; the core handlers pass anyResultInterfacea handler returns through untouched, so no core code knows about tasks. - What happens next is application code: enqueue something a worker picks up, and have the worker call
$store->save($task->with(...))as it progresses.TaskContext::getStore()gives a handler the store for a task it did not create in this request. TaskInputHandlerInterfaceis the hook for what an answer to a parked (input_required) task means;TasksUpdateHandlerdelegatesinputResponsesto it.- No
#[McpTool]task-eligibility marker and no early-return path inReferenceHandler: whether to create a task is the handler's decision, made per request.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先阅读 TaskContext::create()、TaskContext::getStore()、TaskInputHandlerInterface 和 TasksUpdateHandler。跟踪 handler 如何返回 ResultInterface 值,以及 store 如何保存任务进度;完成的标准是任务结果能够传递下去、parked-task 输入能够正确委托,并且应用代码无需 core 中特定于任务的逻辑即可推进任务。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- php
- 领域
- api, backend
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100