feat: supported McpServerSessionListener on SseSession events. #233
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.
Motivation and Context
#59
#77
feat:
In the development of MCP in business systems, the SSE server usually needs to obtain client identity information, such as user information, when processing with the @tool tool. Currently, most MCP clients support passing user information through HTTP Headers, such as API KEY. However, the MCP SDK cannot pass HTTP Headers to the @tool method. Therefore, this change mainly supports this requirement.
fix:
In addition, it also fixes the issue where the keys and corresponding values of the sessions variable in WebMvcSseServerTransportProvider are inconsistent with the sessionId.
How Has This Been Tested?
with Spring-AI
McpWebFluxServerAutoConfiguration.java
ToolProviderAutoConfiguration.java
WeatherToolProvider.java
Breaking Changes
No need, add an interface, implementation is not necessary.
Types of changes
Checklist
Additional context
After the change is merged, I will submit the auto configure code for spring-ai.