Repository navigation
Remove Tasks (SEP-1686) from the SDK - #2714
Merged
Merged
Conversation
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.
Tasks (SEP-1686) have been removed from the MCP specification (modelcontextprotocol/modelcontextprotocol#2663) and will return as a separate extension. This removes all task-related code, types, examples, tests, and documentation from the SDK.
Motivation and Context
The original Tasks SEP that landed in the
2025-11-25spec has been pulled from the draft schema and is moving to an extension. Keeping the experimental implementation around would mean maintaining ~13k lines against a moving target that no longer matches the spec, so this strips it entirely. When the extension lands it can be re-added against the new shape.How Has This Been Tested?
./scripts/test— full suite, 100% coverage,strict-no-covercleanpyright,ruff, pre-commit hooks all passuv lockregenerated to drop the foursimple-task*workspace membersBreaking Changes
Yes (v2 only —
mainis already a breaking-change branch). Documented indocs/migration.md:Task*/*TasksCapabilitytypes,ToolExecution, andTool.executionremoved frommcp.typesRequestParams.task,ClientCapabilities.tasks,ServerCapabilities.tasksremovedmcp.{client,server,shared}.experimentalandmcp.server.lowlevel.experimentalpackages removedexperimentalproperties removed fromClientSession/ServerSession/Server;experimentalfield removed fromServerRequestContextBaseSession.add_response_routerandmcp.shared.response_routerremovedTypes of changes
Checklist
Additional context
A few non-obvious decisions:
CancelledNotificationParams.request_idstaysRequestId | None. The Tasks PR made it optional, but the draft schema kept it that way after removing tasks, so only the task-referencing docstring was changed.BaseSession._handle_responseis kept (with the router-dispatch loop stripped). The extraction from_receive_loopplus the null-ID error handling is a standalone improvement that doesn't depend on tasks.server/validation.pyis kept. It's a non-task refactor of sampling-tools validation that SEP-1686: Tasks #1645 happened to extract; only the "task-augmented" wording in the module docstring was dropped.ResponseRouter,ServerSession.send_message, and the_build_*_requesthelpers are deleted rather than kept as "generic plumbing" — they had zero non-task callers, and keeping them would have required either pragmas or synthetic tests for the 100% coverage requirement.tests/server/test_session.py::test_check_client_capabilitybecause the experimental task tests were the only thing exercising that public method.AI Disclaimer