Repository navigation
fix: negotiate supported MCP handshake revisions - #77
Merged
alexshapalov merged 1 commit intoSep 27, 2026
Merged
Conversation
Initialize echoed any requested protocol revision, including malformed or future values and the newer lifecycle this server does not implement. Accept the four compatible initialize-era revisions and counter-offer the existing default otherwise. Preserve malformed-parameter fallback and the ordinary tool, prompt and resource request surfaces. Verification: real Serve regressions fail on 282ffe8 for unknown, malformed and unsupported modern revisions; the complete MCP race suite passes 20 repetitions. No dependencies, SQL or database schema changes.
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.
What and why
Closes #76.
The initialize handler acknowledged arbitrary client-provided protocol revisions. Negotiate the compatible stable handshake revisions explicitly and counter-offer the existing default for unsupported values. In particular, do not pretend the modern
2026-07-28lifecycle is implemented.This follows the MCP version-negotiation contract. Successful existing handshake revisions retain their requested value; malformed-parameter fallback and ordinary tools, prompts and resources remain unchanged.
Verification
Verified commit:
69248627df377e8808ea43af495d20b8bbfc3464.Server.Serveregressions fail on upstream282ffe8fdd7acdd7b6e1dbd8cf04c155401d3a92for unknown, malformed and unsupported modern revisions.go test -race ./internal/mcp -count=20: passed the full package suite.bash scripts/gate.sh: passed on committed HEAD, including build, vet, pinned lint, unit tests and all six release-target builds.go test -race ./...: passed; formatting andgit diff --checkclean.Scope and risk
No dependencies, collector SQL, database migrations or model JSON fields change. Protocol tests drive pgbot's actual wire loop. No third-party SDK interoperability process was run, and no modern stateless support is claimed. Clients requesting an unknown revision now receive an honest counter-offer rather than false agreement. Revert the commit to restore the previous negotiation behavior.
Checklist