Align task response types with MCP spec#658
Merged
alexhancock merged 1 commit intomodelcontextprotocol:mainfrom Feb 13, 2026
Merged
Align task response types with MCP spec#658alexhancock merged 1 commit intomodelcontextprotocol:mainfrom
alexhancock merged 1 commit intomodelcontextprotocol:mainfrom
Conversation
b56b579 to
8c5f491
Compare
alexhancock
approved these changes
Feb 13, 2026
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.
Closes #637, Closes #640
Motivation and Context
The task response types don't match the MCP 2025-11-25 spec. The
tasks/getresponse nested the task under ataskkey instead of flattening it. Thetasks/resultresponse used fields that aren't in the spec, rather than passing through the original request's result. Thetasks/cancelhandler didn't return anything instead of the final task state. Also, theTaskstruct hadlast_updated_atas optional and omittedttlwhen it was null, but both should always be included. This PR fixes these response types and updates the#[task_handler]proc macro to generate code that matches the new signatures.How Has This Been Tested?
All library and integration tests pass. Schema snapshots were regenerated.
Breaking Changes
Most users won't be affected because the
#[task_handler]proc macro generates these methods automatically. Only manualServerHandlerimplementations need the changes below.To ease migration,
GetTaskInfoResultis kept as a deprecated type alias toGetTaskResult, and bothGetTaskResultandCancelTaskResultimplementFrom<Task>, so handlers can returnOk(task.into())without constructing the wrapper structs directly.TaskResultis removed without a deprecation shim because its fields (content_type,value,summary) have no equivalent in the spec. This should provide a clean break, which is more straightforward than a conversion that quietly drops fields.Types of changes
Checklist
Additional context
Schema references: