Skip to content

fix(mcp): fail fast for invalid stateless tools#6371

Open
gaoxiaolei-s59 wants to merge 1 commit into
spring-projects:mainfrom
gaoxiaolei-s59:codex/gh-5373-stateless-tool-fail-fast
Open

fix(mcp): fail fast for invalid stateless tools#6371
gaoxiaolei-s59 wants to merge 1 commit into
spring-projects:mainfrom
gaoxiaolei-s59:codex/gh-5373-stateless-tool-fail-fast

Conversation

@gaoxiaolei-s59

Copy link
Copy Markdown

Summary

  • fail fast when stateless MCP tool providers discover session-scoped parameters
  • surface an actionable error that points developers to McpTransportContext or a stateful server
  • cover both sync and async stateless tool providers with regression tests

Fixes #5373

Testing

  • ./mvnw -pl mcp/mcp-annotations -Dtest=McpPredicatesTests,SyncStatelessMcpToolProviderTests,AsyncStatelessMcpToolProviderTests test

@gaoxiaolei-s59 gaoxiaolei-s59 marked this pull request as ready for review June 10, 2026 07:13
Signed-off-by: gaoxiaolei-s59 <2995484417@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tools with McpSyncServerExchange/McpSyncRequestContext parameters are silently ignored in stateless mode

2 participants