Remove Tasks (SEP-1686) from the SDK#2714
Draft
maxisbey wants to merge 1 commit into
Draft
Conversation
Tasks have been removed from the MCP specification and will return as a
separate extension in a future release. This removes all task-related
code, types, examples, tests, and documentation from the SDK.
Removed:
- All Task* types, capability fields, Tool.execution, and union members
from mcp.types
- mcp.{client,server,shared}.experimental packages
- mcp.server.lowlevel.experimental and mcp.shared.response_router
- experimental properties on ClientSession, ServerSession, Server, and
the experimental field on ServerRequestContext
- ServerSession._build_*_request helpers, send_message, and the tasks
capability check (task-only consumers)
- BaseSession.add_response_router and the router-dispatch loop in
_handle_response (the method extraction itself is kept)
- tests/experimental/ and the tasks:* entries in
tests/interaction/_requirements.py
- examples/{clients,servers}/simple-task* and their uv.lock workspace
members
- docs/experimental/ and the mkdocs nav section
Kept:
- CancelledNotificationParams.request_id stays optional to match the
draft schema; only the docstring was updated
- server/validation.py (non-task sampling-validation refactor)
- _handle_response extraction in BaseSession
Added a test for ServerSession.check_client_capability since the
experimental task tests were its only coverage.
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.
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