-
Notifications
You must be signed in to change notification settings - Fork 431
Description
Description
In the spring-ai-examples repository, specifically in the model-context-protocol/weather/manual-webflux-server example, there's a version compatibility issue between spring-ai-bom and mcp-bom that causes a runtime error.
Current Behavior
The current pom.xml in the 1.1.x branch uses:
spring-ai-bomversion 1.1.0mcp-bomversion 0.10.0
This version mismatch causes the following runtime error when starting the application:
java.lang.NoSuchMethodError: 'io.modelcontextprotocol.spec.McpSchema$Tool$Builder io.modelcontextprotocol.spec.McpSchema$Tool.builder()'
Expected Behavior
The application should start without errors and the MCP tools should be properly initialized.
Root Cause
The spring-ai-bom 1.1.0 expects newer API methods from the MCP library that are not available in mcp-bom 0.10.0. Specifically, the Tool.builder() method was added in a later version of the MCP library.
Solution
The mcp-bom version should be upgraded to 0.16.0 or higher to maintain compatibility with spring-ai-bom 1.1.0.
Steps to Reproduce
- Clone the
spring-ai-examplesrepository - Checkout the
1.1.xbranch - Navigate to
model-context-protocol/weather/manual-webflux-server - Run
mvn clean spring-boot:run - The application fails to start with the
NoSuchMethodError
Environment
- Spring AI Version: 1.1.0
- MCP BOM Version: 0.10.0 (current, problematic)
- Java Version: Any supported version
- Build Tool: Maven
Additional Context
This issue affects all MCP-based examples in the repository that use the 1.1.x branch. The version upgrade is necessary to maintain API compatibility and ensure the examples work correctly for developers trying to learn MCP integration with Spring AI.
Suggested Fix
Update the mcp-bom version from 0.10.0 to 0.16.0 or later in the dependency management section of the affected POM files.