Skip to content

mcp: bump ModelContextProtocol to 2.4.0 - #216

Open
carldebilly wants to merge 1 commit into
mainfrom
dev/cdb/mcp-sdk-2-4
Open

carldebilly wants to merge 1 commit into
mainfrom
dev/cdb/mcp-sdk-2-4

Conversation

@carldebilly

@carldebilly carldebilly commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Closes #165.

Bumps ModelContextProtocol and ModelContextProtocol.AspNetCore from 2.2.0 to 2.4.0, the current release. Sample 10 and docs/mcp-reference.md are updated to match.

Consumer impact

Repl.Mcp's dependency floor moves to ModelContextProtocol 2.4.0, and its transitive floors move with it (for example Microsoft.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.Mcp now requires the 2.4.0 SDK. Upgrade ModelContextProtocol.AspNetCore at the same time.
  • An application that also uses the SDK's McpClient gets its one breaking change, ServerInfo becoming nullable.

SDK changes checked against Repl.Mcp

SDK change Effect on Repl.Mcp
Insertion order of tools, prompts and resources (#1924) Suite passes.
Modern HTTP responses defer their headers (#1810, #1837) The only header write, in sample 10's HttpBoundary, happens before next.
Discovery probes no longer commit the version (#1956) None.
Legacy output schemas of delegating tools (#1928) None: Repl's tools derive from McpServerTool.
Protocol property names bound case-sensitively (#1934) Affects only clients that send non-canonical names.
list_changed send path Re-read in 2.4.0: still no await before the transport, so the absence assertion in When_OneLegacySessionConsumesItsShimIntro_Then_NoOtherSessionIsNotified still holds.

The both-eras test

When_OneConnectionIsServedBothEras_Then_EachGetsItsOwnCatalog sent a modern request, then an initialize, 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:

  • Modern request mid-build, then 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 _meta as opaque.
  • A modern request and an initialize admitted 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: initialize assigns 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_ItIsServedTheLegacyCatalog
  • When_InitializeArrivesWhileAModernRequestIsServed_Then_TheHandshakeIsRefused

The storage-level When_BothErasPublishOnOneSession_Then_EachKeepsItsOwnEntry stays. Its description and the McpSessionContext comment 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

  • Build: 0 warnings.
  • Full suite on both targets: 5668 tests, 0 failed.
  • Pack: the Repl.Mcp nuspec depends on ModelContextProtocol 2.4.0.
  • The MCP Inspector job runs in this PR's CI.

Devin Review

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
@carldebilly carldebilly added this to the 0.13.0 milestone Nov 18, 2026
@carldebilly carldebilly added the enhancement New feature or request label Nov 18, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T03:15:37.064946Z 407bc69 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@autocarl autocarl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mcp: bump ModelContextProtocol to 2.4.0

2 participants