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-bom version 1.1.0
mcp-bom version 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-examples repository
- Checkout the
1.1.x branch
- 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.
Description
In the
spring-ai-examplesrepository, specifically in themodel-context-protocol/weather/manual-webflux-serverexample, there's a version compatibility issue betweenspring-ai-bomandmcp-bomthat causes a runtime error.Current Behavior
The current
pom.xmlin the1.1.xbranch uses:spring-ai-bomversion 1.1.0mcp-bomversion 0.10.0This version mismatch causes the following runtime error when starting the application:
Expected Behavior
The application should start without errors and the MCP tools should be properly initialized.
Root Cause
The
spring-ai-bom1.1.0 expects newer API methods from the MCP library that are not available inmcp-bom0.10.0. Specifically, theTool.builder()method was added in a later version of the MCP library.Solution
The
mcp-bomversion should be upgraded to 0.16.0 or higher to maintain compatibility withspring-ai-bom1.1.0.Steps to Reproduce
spring-ai-examplesrepository1.1.xbranchmodel-context-protocol/weather/manual-webflux-servermvn clean spring-boot:runNoSuchMethodErrorEnvironment
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-bomversion from0.10.0to0.16.0or later in the dependency management section of the affected POM files.