Repository navigation
feat(initialize): add http-protocol-version-header check for post-init HTTP requests - #609
Open
seedfunded wants to merge 1 commit into
Open
seedfunded wants to merge 1 commit into
seedfunded wants to merge 1 commit into
Conversation
…t HTTP requests Add the client-side `http-protocol-version-header` check to the existing `initialize` scenario (2025-06-18 through 2025-11-25) per the Streamable HTTP transport spec: clients MUST include `MCP-Protocol-Version` matching the negotiated protocol version on all subsequent HTTP requests after initialization. - Records `MCP-Protocol-Version` on every post-initialize HTTP request (`POST` notifications/requests, `GET`, `DELETE`) and fails if any request omits the header or sends a mismatched version. - Emits `untestableCheck(..., 'FAILURE')` per modelcontextprotocol#248 if no subsequent HTTP request arrives after `initialize`. - Makes `getChecks()` idempotent and resets state in `start()`. - Adds 4 unit and negative tests in `src/scenarios/client/initialize.test.ts` (conformant SDK client pass + idempotency, missing header, mismatched version, and no post-init request). Updates modelcontextprotocol#102
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Updates #102 (companion to #608, which covers server-side
server-version-echoandserver-version-negotiate; together they cover all three checks requested in #102).Following
AGENTS.md("fewer scenarios, more checks"), this extends the existing clientinitializescenario (2025-06-18–2025-11-25) with thehttp-protocol-version-headercheck (MUST/FAILURE):MCP-Protocol-Versionon every subsequent HTTP request received afterinitialize(POSTnotifications/requests,GET,DELETE) and verifies it matches the negotiatedprotocolVersion.untestableCheck(..., 'FAILURE')per Standardize how scenarios report setup/execution failures #248 if no subsequent HTTP request arrives afterinitialize.start()and keepsgetChecks()idempotent.Testing
src/scenarios/client/initialize.test.ts(4 tests: conformant@modelcontextprotocol/sdkClient+StreamableHTTPClientTransportpass & idempotency, missing header failure, wrong version failure, and untestable failure when no post-init request arrives).npm run check,npm run build, andnpm test(49 test files, 645 tests passing).