fix: reject initialize protocol version conflicts#2639
Conversation
|
Pushed a test-only follow-up for the coverage gate. The HTTP mismatch path was already covered through the live server test, but that path runs out of process, so I added an in-process regression test for the 400 response branch. Verified locally:
|
0b83197 to
2cb41c3
Compare
2cb41c3 to
95fe1b8
Compare
|
Rebased this onto current upstream/main and resolved the StreamableHTTP in-process transport test refactor conflict. The mismatch coverage is now in the current async in-process style, so the old socket/requests test shape was not brought back. Validated locally on Windows:
|
95fe1b8 to
9ab85e1
Compare
|
Follow-up after the Ubuntu matrix failure: the tests themselves passed, but strict-no-cover caught an old I removed that stale pragma and revalidated locally on Windows:
|
Summary
initializerequests when themcp-protocol-versionheader conflicts withinitialize.params.protocolVersionFixes #2618
To verify
.\.venv\Scripts\python.exe -m pytest tests\shared\test_streamable_http.py -q -k "protocol_version".\.venv\Scripts\python.exe -m ruff check src\mcp\server\streamable_http.py tests\shared\test_streamable_http.py.\.venv\Scripts\python.exe -m ruff format --check src\mcp\server\streamable_http.py tests\shared\test_streamable_http.py.\.venv\Scripts\pyright.exe src\mcp\server\streamable_http.py tests\shared\test_streamable_http.pygit diff --check upstream/main..HEAD