Skip to content

Move the MCP server to ModelContextProtocol 2.4 - #4836

Merged
Mpdreamz merged 18 commits into
mainfrom
chore/bump-modelcontextprotocol
Nov 16, 2026
Merged

Mpdreamz merged 18 commits into
mainfrom
chore/bump-modelcontextprotocol

Conversation

@Mpdreamz

@Mpdreamz Mpdreamz commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Moves the remote MCP server from ModelContextProtocol 1.4 to 2.4 and lets it offer every protocol version. None of the 2.x breaking changes reaches our code. A client on the initialize handshake sees the same six tools with the same schemas, in a different order, without the execution.taskSupport field. A client on the 2026-07-28 protocol is now served too.

Affects: MCP

Prompt summary: Take the ModelContextProtocol 2 release as its own change, list its breaking changes, and say which ones affect us.

Why

The major release was held out of the dependency bump in #4834 because it changes the tools/list response. This PR takes it alone, with the difference measured and the upstream breaking changes checked against our code.

What

What a client sees

I compared the tools/list response of the two versions field by field, ignoring order.

  • Same: the six tools (search_docs, find_related_docs, get_document_by_url, analyze_document_structure, check_docs_coherence, find_docs_inconsistencies), every description, every input schema and every annotation. The initialize result is the same too.
  • Different, order: tools/list returns the tools in another order. The old order started with find_docs_inconsistencies and ended with analyze_document_structure. The new one starts with search_docs and ends with find_docs_inconsistencies. Our code declares no order. A client that picks the first tool, or shows the tools in list order, sees the change.
  • Different, tasks: each tool no longer carries "execution": { "taskSupport": "optional" }. Tasks moved out of the core package (breaking change 3 below), and we do not register the extension. Under the 2025-11-25 spec a tool without the field is forbidden for task-augmented calls. A client that ran these tools as tasks would stop. Normal tools/call is unaffected.

The breaking changes of 2.x and whether they affect us

The 2.0.0 release notes list ten. 2.3.0 adds one. 2.1, 2.2, 2.3.1 and 2.4 list none.

Change Affects us?
1. HTTP is stateless by default, and clients probe server/discover first No for stateless: Program.cs already sets Stateless = true. The probe is now served, because the protocol pin is gone (see Protocol versions).
2. Roots, Sampling and Logging APIs are deprecated (MCP9005) No. We call none of them, and the build has no MCP9xxx warning.
3. Tasks moved to ModelContextProtocol.Extensions.Tasks Only through the missing taskSupport field above. We never registered tasks.
4. OAuth callback and issuer validation No. This is the client; we have no OAuth code.
5. Non-object structured tool results are emitted raw No. No tool sets UseStructuredContent.
6. Tool.inputSchema is required when a Tool is deserialized No. We deserialize no Tool. The tests read the raw JSON.
7. PKCE S256 must be advertised in OAuth metadata No. Client OAuth only.
8. Dynamic client registration sends application_type No. Client OAuth only.
9. SSE connection errors keep their original exception type No. We use no McpClient and no SSE client.
10. OAuth step-up fails when a challenge adds no scopes No. Client OAuth only.
2.3.0: McpClient.ServerInfo is nullable No. We use no McpClient.

Protocol versions

Program.cs no longer pins ProtocolVersion to 2025-11-25; #4837 made the change in this branch. With the pin, a 2026-07-28 client got a 400 and an older client got 2025-11-25 whatever it asked for. Without it, the server is dual-era as the spec describes: initialize clients keep working, and 2026-07-28 clients are served through server/discover.

Client Before After
initialize asking for 2025-11-25 2025-11-25 Same
initialize asking for 2024-11-05 2025-11-25 2024-11-05
server/discover, tools/list and tools/call on 2026-07-28 400, -32022 200

mcp-protocol-versions.http pins these behaviours. The server/discover result has a tools capability and no logging capability, and the results carry no caching hints.

Risk: an older client now negotiates the version it asks for. I did not check how a real old client behaves without the 2025-11-25 features. Try Claude Desktop and VS Code against the preview before merging.

Snapshots

Both handshake transcripts, Mcp.Remote.Tests and the journeys project, take the change. The journeys transcript only loses the six execution blocks.

Verify

mise run test
dotnet test --project tests/Elastic.Documentation.Journeys.Tests --treenode-filter "/*/*/McpHttp/*"

Stack: on top of #4834.

Mpdreamz and others added 10 commits November 12, 2026 14:01
Curb 0.14 formats XML with the editorconfig indent. The 16 project files
and the solution file change in whitespace only.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Snapshots 0.11, Argh and Make.Fs 0.29, Proc 0.22, Cdp 0.11, Mermaider 0.17,
curb 0.14 and the release-notes tool. The 0.11 snapshot engine keeps whitespace
inside pre, so those verified files now show the real markup, and the MCP
event stream snapshot lists the JSON of each event.

ScopedFileSystem stays on 0.6.0, Snapshots on 0.11.0 and Pagefind.Net on 0.5.0.
The newer releases need System.IO.Abstractions 23, whose Testably interface
adds IFile.CreateHardLink, and ScopedFileSystem 0.7.1 does not implement it.

Docker targets now fail up front when docker is missing (needsTool).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…an.Snapshots

The snapshot library now pretty-prints event-stream bodies itself, so the
SSE scrubber is a no-op and the prose mask no longer matched. Mask the prose
in the new format and regenerate the verified file.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
AWSSDK 4.1, Elastic.Clients.Elasticsearch 9.5, Elastic.Transport 1.1,
Elastic.Ingest 0.56, HtmlSanitizer 11, AngleSharp 1.10, Markdig 1.6, OpenTelemetry
1.21, TUnit 1.83, WireMock 2, Spectre.Console 0.57, Slugify 5, MinVer 8, husky
and the other packages that had a newer release. Slugify 5 no longer takes a
null, so Slugify() passes an empty string for one.

Four stay behind. RazorSlices 0.12 writes empty attributes, which changes the
HTML of 77 snapshots. ModelContextProtocol 2 changes the tool annotations and
input schemas that the MCP server returns. Elastic.OpenTelemetry 1.7 ships a
ReadOnlyMemoryStream that collides with the one in the net11 BCL. Elastic.Transport 8
breaks the client code that uses JsonResponse.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Slugify 5 rejects a null argument and Slugify() takes a nullable string. A
null-coalescing workaround would hide a behaviour change, so the package stays
until the repo has its own slug method.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… the API tests

Elastic.OpenTelemetry 1.7 ships a public System.IO.ReadOnlyMemoryStream in its
netstandard2.1 asset. The net11 runtime has a type of that name too, so the API
test projects, which reference the package, fail with CS0433. The tests read a
byte array, so a read-only MemoryStream does the same job.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
RazorSlices 0.12 writes an attribute bound to an empty string as name="", where
0.11 left it out. The tab and applies-switch radios bound checked to "checked" or
"", so every radio would have been checked. The templates now bind null instead,
through NullIfEmpty and JoinOrNull, so the HTML stays the same and no snapshot
changes.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Slugify.Core 4.0.1 throws a NullReferenceException for null although Slugify()
takes a string?. The guard lives in our method, so it holds for any version of
the package or a replacement (see the issue about our own slug method).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The six tools, their descriptions, input schemas and annotations are the same.
tools/list now returns them in a different order and no longer advertises
execution.taskSupport. Both handshake snapshots follow.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@Mpdreamz
Mpdreamz requested a review from a team as a code owner November 12, 2026 13:29
@Mpdreamz
Mpdreamz requested a review from reakaleek November 12, 2026 13:29
The server pinned ProtocolVersion to 2025-11-25, which refuses clients on the
2026-07-28 protocol and overrides the version older clients ask for. Leaving it
null makes the server dual-era: initialize clients get the version they ask for
and 2026-07-28 clients are served through server/discover.

A new http test pins the three behaviours. The handshake tests now send
2025-11-25, which is what clients send today.

Co-authored-by: Claude Sonnet 5.5 <[email protected]>
Mpdreamz and others added 2 commits November 16, 2026 10:42
Main took the nullean bumps (#4833) and some of the same package updates from
Dependabot. Where both changed a version, this branch has the newer one.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Mpdreamz and others added 2 commits November 16, 2026 12:02
The protocol versions test sent server/discover and tools/list on 2026-07-28 but
no call that runs a tool. A get_document_by_url call with an empty URL now goes
through the per-request path and snapshots the tool result.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Base automatically changed from chore/bump-dependencies to main November 16, 2026 11:19
The tools/call request in the protocol versions test still reached
Elasticsearch: the gateway searches even for an empty URL. The test host now
replaces IDocumentGateway with one that echoes the URL, so the test does not
depend on a cluster and its snapshot shows that the argument arrived.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

Main took ScopedFileSystem, Snapshots and System.IO.Abstractions in #4864. This
branch keeps main's versions and its own ModelContextProtocol 2.4.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
With two .http files the cases run in parallel, and each sets and restores the
process-wide MCP_SERVER_PROFILE, so one could restore it while the other host
starts. They now share a NotInParallel key.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@Mpdreamz
Mpdreamz merged commit d185848 into main Nov 16, 2026
43 checks passed
@Mpdreamz
Mpdreamz deleted the chore/bump-modelcontextprotocol branch November 16, 2026 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant