Skip to content

Conversation

tzolov
Copy link
Collaborator

@tzolov tzolov commented Aug 22, 2025

Add support for @McpProgressToken annotation across all MCP callback types to enable progress token injection for tracking long-running operations.

  • Add @McpProgressToken annotation for marking progress token parameters
  • Implement progress token detection and injection in AbstractSyncMcpToolMethodCallback
  • Implement progress token detection and injection in AbstractAsyncMcpToolMethodCallback
  • Update JsonSchemaGenerator to exclude @McpProgressToken parameters from schemas
  • Add progress token support to AbstractMcpResourceMethodCallback (sync and async)
  • Add progress token support to AbstractMcpPromptMethodCallback (sync and async)
  • Add progress token support to AbstractMcpCompleteMethodCallback (sync and async)
  • Update README.md with @McpProgressToken documentation

Parameter Handling:

  • Progress token parameters are automatically injected from request.requestToken()
  • Parameters annotated with @McpProgressToken are excluded from rawArguments
  • Null is injected when no progress token is present in the request
  • Fixed validation logic to correctly count progress token parameters separately

Testing:

  • Add tests for tool callbacks with @McpProgressToken
  • Add tests for resource callbacks with progress token support
  • Add tests for prompt callbacks with progress token support
  • Add tests for complete callbacks with progress token support

Add support for @McpProgressToken annotation across all MCP callback types
to enable progress token injection for tracking long-running operations.

- Add @McpProgressToken annotation for marking progress token parameters
- Implement progress token detection and injection in AbstractSyncMcpToolMethodCallback
- Implement progress token detection and injection in AbstractAsyncMcpToolMethodCallback
- Update JsonSchemaGenerator to exclude @McpProgressToken parameters from schemas
- Add progress token support to AbstractMcpResourceMethodCallback (sync and async)
- Add progress token support to AbstractMcpPromptMethodCallback (sync and async)
- Add progress token support to AbstractMcpCompleteMethodCallback (sync and async)
- Update README.md with @McpProgressToken documentation

Parameter Handling:
- Progress token parameters are automatically injected from request.requestToken()
- Parameters annotated with @McpProgressToken are excluded from rawArguments
- Null is injected when no progress token is present in the request
- Fixed validation logic to correctly count progress token parameters separately

Testing:
- Add tests for tool callbacks with @McpProgressToken
- Add tests for resource callbacks with progress token support
- Add tests for prompt callbacks with progress token support
- Add tests for complete callbacks with progress token support

Signed-off-by: Christian Tzolov <[email protected]>
@tzolov tzolov merged commit bf2c423 into spring-ai-community:main Aug 22, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant