You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ec34539
Browse filesBrowse the repository at this point in the historyBrowse files
fix(transport): exempt initialize requests from MCP-Protocol-Version checks
Per the Streamable HTTP spec the MCP-Protocol-Version header is required only after initialization completes; version selection for initialize happens through body-level negotiation, not header validation.
* Client: stop sending MCP-Protocol-Version on initialize requests
* Servlet servers: skip strict header validation for initialize so clients advertising an unsupported version negotiate instead of getting 400
* Tests: pin client omission and server tolerance for initialize; make version-negotiation test contextExtractor null-safe for absent headers
Copy file name to clipboardExpand all lines: mcp-core/src/main/java/io/modelcontextprotocol/server/transport/HttpServletStreamableServerTransportProvider.java
Copy file name to clipboardExpand all lines: mcp-test/src/test/java/io/modelcontextprotocol/common/HttpClientStreamableHttpVersionNegotiationIntegrationTests.java
+5-2Lines changed: 5 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,7 @@
6
6
7
7
importjava.util.List;
8
8
importjava.util.Map;
9
+
importjava.util.Objects;
9
10
importjava.util.function.BiFunction;
10
11
11
12
importio.modelcontextprotocol.client.McpClient;
@@ -42,8 +43,10 @@ class HttpClientStreamableHttpVersionNegotiationIntegrationTests {
0 commit comments