Skip to content

Version Compatibility Issue: spring-ai-bom 1.1.0 with mcp-bom 0.10.0 Causes NoSuchMethodError #91

@JIANqiao19931029

Description

@JIANqiao19931029

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

  1. Clone the spring-ai-examples repository
  2. Checkout the 1.1.x branch
  3. Navigate to model-context-protocol/weather/manual-webflux-server
  4. Run mvn clean spring-boot:run
  5. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions