Skip to content

Using adk with spring boot ai 2.0.x does not seem to work as expected due to differing io.modelcontextprotocol.sdk versions#1453

Description

@dbaxa

**Please make sure you read the contribution guide and file the issues in the
right place. **
Contribution guide.

馃敶 Required Information

*Please ensure all items in this section are completed to allow for efficient
triaging. Requests without complete information may be rejected / deprioritized.
If an item is not applicable to you - please mark it as N/A

Describe the Bug:

adk-java uses io.modelcontextprotocol.sdk mcp/mcp-core version 1.1.2 where as spring-ai 2.0.x uses version 2.0.0 (https://github.com/spring-projects/spring-ai/blob/v2.0.1/pom.xml#L255).

Steps to Reproduce:
Please provide a numbered list of steps to reproduce the behavior:

  1. Try to use spring-ai 2.0.1 and adk-java
  2. Observe that if AbstractMcpTool.declaration(AbstractMcpTool.java:90) (JsonSchema inputSchema = this.mcpTool.inputSchema();) as inputSchema is no longer JsonSchema but Map. You can verify this by comparing https://github.com/modelcontextprotocol/java-sdk/blob/v1.1.2/mcp-core/src/main/java/io/modelcontextprotocol/spec/McpSchema.java against the v2.0.0 version. This change is documented at https://github.com/modelcontextprotocol/java-sdk/blob/v2.0.0/MIGRATION-2.0.md#toolinputschema-is-mapstring-object-not-jsonschema .

Expected Behavior:

ADK works as expected.

Observed Behavior:

Caused by: java.lang.NoSuchMethodError: 'io.modelcontextprotocol.spec.McpSchema$JsonSchema io.modelcontextprotocol.spec.McpSchema$Tool.inputSchema()'
at com.google.adk.tools.mcp.AbstractMcpTool.declaration(AbstractMcpTool.java:90)

Environment Details:

  • ADK Library Version (see maven dependency): 1.8.0
  • OS: [e.g., macOS, Linux, Windows] macOS
  • TS Version (tsc --version): Not installed

Model Information:

  • Which model is being used: (e.g., gemini-2.5-pro)

Not applicable in this case.


馃煛 Optional Information

Providing this information greatly speeds up the resolution process.

Regression:
Did this work in a previous version of ADK? No.

Logs:
Please attach relevant logs. Wrap them in code blocks (```) or attach a
text file.

Caused by: java.lang.NoSuchMethodError: 'io.modelcontextprotocol.spec.McpSchema$JsonSchema io.modelcontextprotocol.spec.McpSchema$Tool.inputSchema()'
at com.google.adk.tools.mcp.AbstractMcpTool.declaration(AbstractMcpTool.java:90)

Screenshots / Video:
If applicable, add screenshots or screen recordings to help explain
your problem.

Additional Context:
Add any other context about the problem here.

Minimal Reproduction Code:
Please provide a code snippet or a link to a Gist/repo that isolates the issue.

// Code snippet here

How often has this issue occurred?:

  • Always (100%)
  • Often (50%+)
  • Intermittently (<50%)
  • Once / Rare

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions