Skip to content

Add all protocol versions to StdioServerTransportProvider#849

Open
rameshreddy-adutla wants to merge 1 commit intomodelcontextprotocol:mainfrom
rameshreddy-adutla:fix/751-stdio-protocol-versions
Open

Add all protocol versions to StdioServerTransportProvider#849
rameshreddy-adutla wants to merge 1 commit intomodelcontextprotocol:mainfrom
rameshreddy-adutla:fix/751-stdio-protocol-versions

Conversation

@rameshreddy-adutla
Copy link

Summary

Fixes #751

StdioServerTransportProvider.protocolVersions() only reported MCP_2024_11_05, causing version negotiation to fail with newer clients. Since the stdio transport layer is unchanged across all protocol versions, it should advertise support for all of them — matching the behavior of HttpServletStreamableServerTransportProvider.

Changes

  • StdioServerTransportProvider.java: Updated protocolVersions() to return all four protocol versions (2024-11-05, 2025-03-26, 2025-06-18, 2025-11-25).

Before/After

// Before — only the original version
return List.of(ProtocolVersions.MCP_2024_11_05);

// After — all supported versions (matches Streamable HTTP transport)
return List.of(ProtocolVersions.MCP_2024_11_05, ProtocolVersions.MCP_2025_03_26,
        ProtocolVersions.MCP_2025_06_18, ProtocolVersions.MCP_2025_11_25);

Testing

All 9 StdioServerTransportProviderTests pass.

StdioServerTransportProvider only reported MCP_2024_11_05 as its
supported protocol version. Since the stdio transport is unchanged
across all protocol versions, it should advertise support for all of
them so version negotiation works correctly with newer clients.

Without this fix, a client requesting 2025-06-18 or later would receive
2024-11-05 as the server's highest supported version, potentially
causing a version mismatch.

Fixes modelcontextprotocol#751

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Does StdioServerTransportProvider support protocol version 2025-06-18 ?

1 participant