feat(mcp): adopt stateless 2026 protocol and harden authoring - #313
Merged
Conversation
DavidBabinec
marked this pull request as ready for review
July 30, 2026 19:00
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
@modelcontextprotocol/serverv2 and stable MCP2026-07-28.createMcpHandler, includingserver/discover, per-request_meta, standard routing headers, cancellation, Origin validation, and no protocol session.Why
This builds on the collaboration foundation merged in #305. The stable MCP 2026-07-28 revision removes protocol-level sessions and the initialize handshake in favor of stateless, self-describing requests. The template-masterclass stress campaign also repeatedly exposed a small set of correctness gaps that fit this protocol/authoring hardening pass.
Official references:
Root causes fixed
moveNodeinserted a missing source ID into the destination before discovering that no source node existed, leaving a dangling child reference. Source and target are now validated before mutation.instatic-outlettag metadata, causing outlets to default tomainand produce nested main landmarks in shared shells. Built-in and custom outlet tags now survive import.--font-*declarations because font variables are generated by a separate framework helper. Token-inclusive reads now compose both outputs.Compatibility and behavior
Mcp-Session-Id.-32022; routing-header mismatches return-32020.Verification
bun run buildbun test— 6,432 passed, 0 failedgit diff --checkRepository-wide
bun run lintadditionally scans ignored local stress scripts under.tmp/template-masterclass; it reports six pre-existing findings in those generated artifacts. Those files are unrelated to and excluded from this PR.