Skip to content

Conversation

tzolov
Copy link
Collaborator

@tzolov tzolov commented Oct 15, 2025

Add support for McpSyncRequestContext and McpAsyncRequestContext parameters in Complete, Prompt, and Resource method callbacks, providing a unified interface for accessing MCP request context.

  • Add McpSyncRequestContext and McpAsyncRequestContext parameter support to AbstractMcpCompleteMethodCallback, AbstractMcpPromptMethodCallback, and AbstractMcpResourceMethodCallback

  • Implement validation to ensure correct context type matches method synchronicity (sync methods use McpSyncRequestContext, async methods use McpAsyncRequestContext)

  • Add validation to prevent duplicate request context parameters

  • Fix @McpProgressToken to properly inject progress token from requests (previously returned null for CompleteRequest)

  • Update README.md documentation to clarify that McpSyncRequestContext, McpAsyncRequestContext, and @McpProgressToken are supported in Complete, Prompt, Resource, and Tool methods

  • Add test coverage for request context parameters in sync and async Complete, Prompt, and Resource methods

  • Add tests for request context with URI variables and arguments

  • Add validation tests for duplicate and mismatched context types

  • Add tests for non-null progress token handling

… methods

Add support for McpSyncRequestContext and McpAsyncRequestContext parameters
in Complete, Prompt, and Resource method callbacks, providing a unified
interface for accessing MCP request context.

- Add McpSyncRequestContext and McpAsyncRequestContext parameter support
  to AbstractMcpCompleteMethodCallback, AbstractMcpPromptMethodCallback,
  and AbstractMcpResourceMethodCallback
- Implement validation to ensure correct context type matches method
  synchronicity (sync methods use McpSyncRequestContext, async methods
  use McpAsyncRequestContext)
- Add validation to prevent duplicate request context parameters
- Fix @McpProgressToken to properly inject progress token from requests
  (previously returned null for CompleteRequest)
- Update README.md documentation to clarify that McpSyncRequestContext,
  McpAsyncRequestContext, and @McpProgressToken are supported in Complete,
  Prompt, Resource, and Tool methods

- Add test coverage for request context parameters in
  sync and async Complete, Prompt, and Resource methods
- Add tests for request context with URI variables and arguments
- Add validation tests for duplicate and mismatched context types
- Add tests for non-null progress token handling

Signed-off-by: Christian Tzolov <[email protected]>
@tzolov tzolov added this to the 0.6.0 milestone Oct 15, 2025
Signed-off-by: Christian Tzolov <[email protected]>
@tzolov tzolov merged commit 2ef64aa into spring-ai-community:main Oct 15, 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