feat: add progress token support and extend Request interface #352
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.
Update
McpSchemato enable progress tracking capabilities for long-running MCP operations.Add progress token support and extend Request interface with meta parameter functionality. Related to the MCP Progression Specification
Related to #300, #351
Motivation and Context
This change updates the
McpSchemato provide the foundational schema support needed for progress tracking in long-running MCP operations. By adding meta parameter support and extending theRequestinterface, this enables future implementation of progress notifications for operations like resource reading, tool execution, and message creation. This schema update is a prerequisite for implementing progress tracking functionality that will improve user experience during long-running operations.How Has This Been Tested?
Breaking Changes
Yes, this contains breaking changes:
Sealed Interface Extension: Added
PaginatedRequestandReadResourceRequestto theRequestsealed interface permits list. This is a breaking change because:Requesttypes will need to handle the new casesRequestimplementations will need updatesRecommended Migration:
RequesttypesRequestimplementationsNon-breaking schema additions:
meta()andprogressToken()methods return null when not setTypes of changes
Checklist
Additional context
Schema Updates Overview:
This PR focuses solely on updating the
McpSchemaclass to provide the necessary schema foundation for progress tracking. The actual progress tracking implementation will be built on top of these schema changes.Key Schema Changes:
PaginatedRequestandReadResourceRequestto the sealed interface permits list_metafield support to all major request types for carrying progress tokens and other metadataprogressToken()method that extracts progress tokens from meta parametersmeta()andprogressToken()methods for fluent API usageProgressNotificationwith optionalmessagefield for contextual updatesMigration Guide:
For users with existing switch statements on
Requesttypes:Before:
After: