Repository navigation
mcp: bump ModelContextProtocol to 2.4.0 - #216
carldebilly wants to merge 1 commit into
Conversation
Repl.Mcp now requires ModelContextProtocol 2.4.0. Nothing in Repl's own API changes; the SDK's one breaking change in this range (McpClient.ServerInfo becoming nullable) is client-side. SDK 2.3+ keeps a connection in the era it starts in: once a modern request has been admitted, initialize is refused (-32601), and after initialize a request's modern _meta is opaque and it is served in the legacy era. The end-to-end test that served one connection a modern request and then an initialize can no longer run. It is replaced by two raw-pipe tests that pin those two admission rules (both fail on 2.2.0), so an SDK that loosens them again is noticed. Both eras on one connection remain reachable through concurrent admission, so the per-era snapshot slots stay; the storage test that pins them and the McpSessionContext comment now say so. Closes #165
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
autocarl
left a comment
There was a problem hiding this comment.
Reviewed exact head 407bc6927454211fe1bd0e21453bf233208be283 against base a8310ac4ff7a2a1b411bdb130d2ec2bcf957c42c. No blocking correctness, security, or compatibility findings.
Validation:
- Inspected the complete dependency/test/documentation delta and the SDK source revision recorded in the resolved 2.4.0 package (
4cbf42ef107763f0bc75c358af8cb2dfe47a769a), including protocol admission and notification send boundaries. - Local Release build of Repl.McpTests and dependencies for net10.0/net11.0 completed with 0 warnings and 0 errors.
- Local MCP suite: 392 passed, 0 failed, 2 external-Inspector opt-in tests skipped on each runtime (394 discovered per runtime). This was the MCP subsystem, not a local full-solution rerun.
- Exact-head CI and Documentation sample workflows succeeded; the CI Inspector job also passed.
- Independent bounded review found no medium-or-higher blocker.
The simultaneous mixed-era handler admission case remains an explicitly acknowledged end-to-end coverage gap. The new tests pin the SDK admission rules, while the storage-level guard preserves separate era slots; I do not treat those as end-to-end proof of the race. This is not an introduced product defect and does not block this dependency bump.
Approved; no merge performed.
Closes #165.
Bumps
ModelContextProtocolandModelContextProtocol.AspNetCorefrom 2.2.0 to 2.4.0, the current release. Sample 10 anddocs/mcp-reference.mdare updated to match.Consumer impact
Repl.Mcp's dependency floor moves toModelContextProtocol2.4.0, and its transitive floors move with it (for exampleMicrosoft.Extensions.AI.Abstractions). Repl's own API does not change, and package validation against 0.12.1 passes. The 0.13 release notes should say:Repl.Mcpnow requires the 2.4.0 SDK. UpgradeModelContextProtocol.AspNetCoreat the same time.McpClientgets its one breaking change,ServerInfobecoming nullable.SDK changes checked against Repl.Mcp
HttpBoundary, happens beforenext.McpServerTool.list_changedsend pathWhen_OneLegacySessionConsumesItsShimIntro_Then_NoOtherSessionIsNotifiedstill holds.The both-eras test
When_OneConnectionIsServedBothEras_Then_EachGetsItsOwnCatalogsent a modern request, then aninitialize, on one connection. From 2.3.0 the SDK keeps a connection in the era it starts in. Raw-pipe probes against Repl's handler on 2.4.0 show:initialize: the handshake is refused with -32601. This is deterministic.initialize, then a modern-tagged request: the request is served in the legacy era, because the SDK treats its modern_metaas opaque.initializeadmitted at the same moment: both are served, so a modern build can still publish after legacy requests have run. One timing-dependent run showed it, and the SDK source explains it:initializeassigns the negotiated version without a compare-and-swap.So the per-era snapshot slots are still needed, but the mixed case is a race that cannot be driven on demand. The end-to-end test is replaced by two tests that pin the admission rules above. Both fail on 2.2.0 and pass 10 times out of 10 on 2.4.0, so an SDK that loosens them again is noticed:
When_AModernTaggedRequestFollowsInitialize_Then_ItIsServedTheLegacyCatalogWhen_InitializeArrivesWhileAModernRequestIsServed_Then_TheHandshakeIsRefusedThe storage-level
When_BothErasPublishOnOneSession_Then_EachKeepsItsOwnEntrystays. Its description and theMcpSessionContextcomment now explain concurrent admission.Known gap
No test now checks end to end that the handler picks the right slot for each era: the reads are pinned per era, but not the two eras together on one connection. Driving it would need hand-built SDK
MessageContexts rather than the pipe. I can file this as a follow-up issue.Verification
Repl.Mcpnuspec depends onModelContextProtocol2.4.0.