fix(protocol): align HTTP headers with the negotiated MCP version - #115
Open
galatanovidiu wants to merge 1 commit into
Open
galatanovidiu wants to merge 1 commit into
galatanovidiu wants to merge 1 commit into
Conversation
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.
The proxy forwarded the client's initialization version but always sent
MCP-Protocol-Version: 2025-06-18. When WordPress negotiated2025-11-25, subsequent HTTP requests still advertised the older revision.Use the offered version for initialization headers and the negotiated WordPress version for subsequent requests. Default to
2025-11-25, preserve supported older client versions, and pin the supported revisions independently of SDK upgrades: newer or unknown client revisions offer2025-11-25, while unsupported backend revisions are rejected. This does not add support for a 2026 revision.Custom headers cannot override the protocol header, regardless of casing. Preserve the existing
2025-06-18fallback when the backend omits its version. Session refresh reuses the initialization offer and requires the backend to keep the negotiated version; a version change requires reconnecting the client.Validation:
npm run check— passed formatting and TypeScript checks.npx jest tests/unit/ tests/integration/ --no-coverage— all 234 tests across 15 suites passed. Added coverage for JSON-RPC and simple transport headers, older-server negotiation, unknown client revisions, unsupported backend revisions, missing-version fallback, custom-header precedence, and session refresh.npm run build— passed; generated the 2.43 MB proxy bundle.No package version bump or release is included.