Repository navigation
CAMEL-27241: camel-mcp-server-starter - the MCP Java SDK notifies the removal of a resource template - #2115
Merged
Conversation
… removal of a resource template Spring AI 2.1.0 brings MCP Java SDK 2.2.0, which sends notifications/resources/list_changed when it removes a resource template, so the engine no longer sends a second one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
CAMEL-27241
Needs apache/camel#30444 (Spring AI 2.1.0). Until a Camel snapshot with that change is deployed, this build still resolves Spring AI 2.0.2 and MCP Java SDK 2.1.0 from the Camel parent, and
testResourceAndPromptChangeNotificationsAreDeliveredfails (one notification instead of two).Description
Spring AI 2.1.0 brings MCP Java SDK 2.2.0, which sends
notifications/resources/list_changeditself when it removes a resource template and the server advertiseslistChanged. SDK 2.1.0 did not, soSpringAiMcpServerEngine.resourceTemplateRemovedsent the notification after the removal. With SDK 2.2.0 clients would get it twice, so the engine no longer sends it. camel-mcp-server did the same for its own engines in CAMEL-27145.SpringAiMcpServerEngine: removes only a registered template, and leaves the notification to the SDK.SpringAiMcpServerEngineTest: the engine never sends the notification itself.SpringBootMcpServerTest.testResourceAndPromptChangeNotificationsAreDelivered: after the template removal and a later prompt change, the client has received exactly two resource notifications. The notifications of a session arrive in order, so a duplicate would arrive before the prompt notification.Tests
mvn test -pl components-starter/camel-mcp-server-starterwith-Dspring-ai-version=2.1.0 -Dspring-boot-version=4.2.0 -Dspring-version=7.1.0(MCP Java SDK 2.2.0): 55 tests pass. With the previous engine code on the same versions, the notification test fails with three resource notifications instead of two.Claude Code on behalf of Croway