Skip to content

Bump MCP Java SDK to 2.0.1 - #6999

Draft
vdm24 wants to merge 1 commit into
spring-projects:mainfrom
vdm24:bump-mcp-sdk-2.0.1
Draft

vdm24 wants to merge 1 commit into
spring-projects:mainfrom
vdm24:bump-mcp-sdk-2.0.1

Conversation

@vdm24

@vdm24 vdm24 commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Bumps mcp.sdk.version from 2.0.0 to 2.0.1.

mcp-core 2.0.1 includes the fix for unregistered/unknown JSON-RPC methods
returning HTTP 500 on stateless transports instead of a proper JSON-RPC
-32601 (Method not found) response
(modelcontextprotocol/java-sdk#784,
fixed by modelcontextprotocol/java-sdk#800).

WebFluxStatelessServerTransport and WebMvcStatelessServerTransport need no
code changes of their own: both only return 500 today because the handler's
Mono errors for an unregistered method, and they .block() it and map any
error to 500. mcp-core 2.0.1 makes the handler return a normal
JSONRPCResponse carrying -32601 instead of erroring, so both transports
take their regular 200 OK success path once the dependency is bumped.

Fixes #6998

The mcp-core 2.0.1 release fixes unregistered/unknown JSON-RPC
methods returning HTTP 500 on stateless transports instead of a
proper JSON-RPC -32601 (Method not found) response
(modelcontextprotocol/java-sdk#784, fixed by
modelcontextprotocol/java-sdk#800).

WebFluxStatelessServerTransport and WebMvcStatelessServerTransport
need no code changes of their own: they only return 500 when the
handler's Mono errors, and mcp-core 2.0.1 makes the handler return
a normal JSONRPCResponse instead.

Fixes spring-projects#6998

Signed-off-by: Vadim Shurmialiou <153723461+vdm24@users.noreply.github.com>
Co-authored-by: Junie <junie@jetbrains.com>
@vdm24
vdm24 force-pushed the bump-mcp-sdk-2.0.1 branch from b759d84 to 3a4122d Compare September 15, 2026 17:09
@vdm24

vdm24 commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

Hi @tzolov,

The MCP integration tests check failed on the new test inherited from AbstractMcpClientServerIntegrationTests in MCP Java SDK 2.0.1: testRejectsWhenContentLengthHeaderExceedsLimit.

The test expects the server to reject request bodies larger than 2048 bytes with HTTP 413 Payload Too Large. Currently, Spring AI transports (WebFlux and WebMvc) do not enforce request body size limits, so requests succeed with 200 OK.

How would you prefer to handle this for this PR?

  1. Implement bounded request size handling in Spring AI server transports to reject oversized bodies with HTTP 413.
  2. Disable/override testRejectsWhenContentLengthHeaderExceedsLimit in the transport integration tests (e.g., via @Disabled) to keep this PR strictly scoped to the SDK 2.0.1 version bump, and address bounded reads in a follow-up issue.

Which option do you think is better for this PR?

@vdm24
vdm24 marked this pull request as draft September 16, 2026 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bump mcp.sdk.version to 2.0.1+ — unregistered/unknown JSON-RPC methods return HTTP 500 on stateless transports

2 participants