Remove Tasks (SEP-1686) from the SDK
Merged
MA
5mo ago+63+63+01234567890123456789-12963-12963-01234567890123456789012345678901234567890123456789
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-25 spec 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 members
Breaking Changes
Yes (v2 only — main is already a breaking-change branch). Documented in docs/migration.md:
- All
Task*/*TasksCapabilitytypes,ToolExecution, andTool.executionremoved frommcp.types RequestParams.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_routerremoved
Types of changes
- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)
- Breaking change (fix or feature that would cause existing functionality to change)
- Documentation update
Checklist
- I have read the MCP Documentation
- My code follows the repository's style guidelines
- New and existing tests pass locally
- I have added appropriate error handling
- I have added or updated documentation as needed
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 #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.- Added
tests/server/test_session.py::test_check_client_capabilitybecause the experimental task tests were the only thing exercising that public method.