feat: add progress token support and extend Request interface #352
+1,318
−847
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
McpSchema
to 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
McpSchema
to provide the foundational schema support needed for progress tracking in long-running MCP operations. By adding meta parameter support and extending theRequest
interface, 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
PaginatedRequest
andReadResourceRequest
to theRequest
sealed interface permits list. This is a breaking change because:Request
types will need to handle the new casesRequest
implementations will need updatesRecommended Migration:
Request
typesRequest
implementationsNon-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
McpSchema
class 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:
PaginatedRequest
andReadResourceRequest
to the sealed interface permits list_meta
field 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 usageProgressNotification
with optionalmessage
field for contextual updatesMigration Guide:
For users with existing switch statements on
Request
types:Before:
After: