Skip to content

feat: dual-era MCP 2026-07-28 modern protocol profile - #314

Open
romanbsd wants to merge 7 commits into
modelcontextprotocol:mainfrom
romanbsd:feature/mcp-2026-07-28
Open

romanbsd wants to merge 7 commits into
modelcontextprotocol:mainfrom
romanbsd:feature/mcp-2026-07-28

Conversation

@romanbsd

@romanbsd romanbsd commented Oct 25, 2026 •

Copy link
Copy Markdown

Summary

  • Add dual-era support for MCP 2026-07-28 alongside the legacy initialize path (≤2025-11-25): server/discover, per-request _meta (protocol version / client capabilities), modern resultType, and -32022 unsupported-version errors.
  • Implement modern subscriptions/listen over stateful HTTP SSE (filtered fan-out, no legacy GET mix on modern sessions), with cancel closing the parked stream on both client and server so listen refresh does not leak connections or duplicate notifications.
  • Extend client/server HTTP transports and conformance harness; cover discover, version negotiation, listen filter/cancel, and complete-listen in ModernProtocolTests.

Test plan

  • swift test --filter ModernProtocolTests
  • swift test (full package)
  • Manual: modern client discover → subscriptions/listen → resource subscribe refresh cancels prior listen without duplicate onNotification
  • Manual: legacy initialize session still works; modern session rejects legacy GET notification stream
  • Confirm HTTP 400 body for unsupported modern version includes JSON-RPC -32022 with data.requested / data.supported

@romanbsd
romanbsd requested a review from a team as a code owner October 25, 2026 21:04
@romanbsd
romanbsd force-pushed the feature/mcp-2026-07-28 branch 2 times, most recently from 0ffb9e5 to 3454dd3 Compare October 29, 2026 10:12
@EhsanAzish80

EhsanAzish80 commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Hi @romanbsd, I tested the current head (3454dd3) locally. The focused modern tests pass (16/16), and the full Swift suite passes (582/582).

I also ran the frozen July server conformance suite (modelcontextprotocol/conformance@7169291) against this PR's mcp-everything-server. The scored scenarios had 63 passing checks, 46 failures, and 6 warnings. server-stateless alone had 12 passes and 18 failures.

The bundled client fixture had 270 passing and 44 failing scored checks. It creates HTTPClientTransport without selecting the modern version, so this run does not isolate the modern client implementation; the fixture needs to exercise that path before we can use it as July evidence.

The main gap I see is the HTTP path: modern POSTs create a session ID, while StatelessHTTPServerTransport rejects subscriptions/listen. July removes protocol sessions and uses a long-lived POST response for listen. The suite also catches metadata, error response, caching, and input-required gaps. Some failures may be in the conformance fixture, so I'd fix the stateless HTTP path first and rerun before advertising July in Version.supported.

I have a local opt-in July candidate with stateless listen and tests. It passed the scored server checks on the same frozen harness, though it is on an older base. I'm happy to help adapt the relevant pieces here instead of opening a competing PR.

@romanbsd
romanbsd force-pushed the feature/mcp-2026-07-28 branch from 3454dd3 to 215e03b Compare November 1, 2026 09:53
Add Discover/listen/per-request `_meta` alongside the legacy initialize
era, and close parked listen SSE on cancel so refresh cannot fan-out
duplicates or leak HTTP connections.
@romanbsd
romanbsd force-pushed the feature/mcp-2026-07-28 branch from 215e03b to 28a2865 Compare November 1, 2026 11:49
@romanbsd

romanbsd commented Nov 1, 2026

Copy link
Copy Markdown
Author

@EhsanAzish80 thanks for the feedback! I fixed the incompatibilities and did some refactoring along the way.

@EhsanAzish80

Copy link
Copy Markdown
Contributor

Thanks Roman, I retested 28a2865. The focused modern tests pass 26/26, the full Swift suite passes 639/639, and the frozen July server requirements now pass all 120 scored checks. The stateless HTTP change fixed the main issue I raised.

One test gate remains: mcp-everything-client still creates HTTPClientTransport with its default legacy version and does not use MCP_CONFORMANCE_PROTOCOL_VERSION. The July client run reports 43 scored failures, but that fixture is not selecting the modern client path. Could we make it select July for the requirements run and rerun? Then we can see whether anything remains in the modern client implementation. I'm happy to help with that.

@romanbsd

romanbsd commented Nov 1, 2026

Copy link
Copy Markdown
Author

pushed another commit, is that what you had in mind?

@EhsanAzish80

Copy link
Copy Markdown
Contributor

Yes, that’s what I had in mind. Thanks for the quick update! The client test now reaches the July path.

@romanbsd
romanbsd force-pushed the feature/mcp-2026-07-28 branch from 1c5c531 to e29d794 Compare November 2, 2026 08:29
@romanbsd

romanbsd commented Nov 2, 2026

Copy link
Copy Markdown
Author

more fixes pushed

@EhsanAzish80

Copy link
Copy Markdown
Contributor

@romanbsd finished checking the July client run. With #293 applied locally, the auth checks pass. I also confirmed eight header/schema failures come from missing conformance fixture actions. Five MRTR request-state checks still fail and need the client flow and fixture exercised together.

@romanbsd

romanbsd commented Nov 2, 2026

Copy link
Copy Markdown
Author

it's converging :)

@EhsanAzish80

Copy link
Copy Markdown
Contributor

Thank you!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants