Skip to content

Java client accepts responses with jsonrpc: "1.0" #1156

Open

Description

@anilloutombam

Bug description

The Java client accepts a response with "jsonrpc": "1.0" instead of rejecting it.

I reproduced this with SDK 2.0.1 over stdio and Streamable HTTP. The tool call returned normally in all three runs on each transport. A ping immediately afterward also succeeded.

Environment

  • MCP Java SDK: 2.0.1
  • Java: 21.0.9
  • Maven: 3.9.11
  • Protocol version: 2025-11-25
  • Client: Synchronous
  • Transports: stdio and Streamable HTTP
  • Server: mcp-failure-lab@0.11.0
  • OS: Linux arm64 container
  • Spring AI: Not used
  • Vector store: Not applicable

Steps to reproduce

  1. Initialize a synchronous Java SDK client.
  2. Call a tool that returns a matching response with "jsonrpc": "1.0".
  3. Observe that callTool returns the tool result instead of rejecting the response.

I used Failure Lab’s malformed_message tool with the invalid-jsonrpc-version variant.

Expected behavior

The client should reject the response because the jsonrpc value is not "2.0".

Minimal Complete Reproducible example

The pinned test harness is here:

https://github.com/anilloutombam/mcp-failure-lab/tree/main/experiments/java-sdk

Run it with:

git clone https://github.com/anilloutombam/mcp-failure-lab.git
cd mcp-failure-lab
docker build -t mcp-failure-lab-java-sdk ./experiments/java-sdk
mkdir -p work/java-sdk-results
docker run --rm \
  -v "$PWD/work/java-sdk-results:/results" \
  mcp-failure-lab-java-sdk

The relevant test is invalid-jsonrpc-version-recovery:

https://github.com/anilloutombam/mcp-failure-lab/blob/main/experiments/java-sdk/src/main/java/dev/mcplab/JavaSdkCompatibility.java#L93-L100

Full results:

https://github.com/anilloutombam/mcp-failure-lab/blob/main/docs/compatibility/java-sdk-2.0.1.md

Activity

  1. added
    P3
    on Oct 5, 2026
  2. Ben-Home commented on Oct 6, 2026

    @Ben-Home
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3area/client

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions