Repository navigation
mcp: do not check metatada on notifications - #1215
Merged
Merged
Conversation
…hem without protocol versioning
yarolegovich
approved these changes
Sep 1, 2026
guglielmo-san
enabled auto-merge (squash)
September 1, 2026 13:28
This was referenced Nov 5, 2026
guglielmo-san
pushed a commit
that referenced
this pull request
Nov 5, 2026
The 2026-07-28 spec requires Mcp-Method on all requests and leaves header requirements for notification POSTs undefined. validateMcpHeaders applied the presence check to notifications too, so a stateless server answers 400 (-32020) to header-less notifications, which the TypeScript SDK accepts with 202. Claude Code 2.1.316 to 2.1.318 sends these. This skips only the presence check for notifications. A header that is present must still match the body, the same exemption #1215 made for the _meta check. The existing "missing Mcp-Method header" test case built a request with no ID, so it was actually exercising a notification; it now has an ID. Tests: unit cases for header-less and mismatched notifications in TestValidateMcpHeaders, and an HTTP-level 202 case in TestStreamableMcpHeaderValidation. go test ./... passes. Fixes #1503 Written with AI assistance (Claude Code); I reviewed every line and can explain the change. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
Fixes #1212