Repository navigation
Spike the MCP 2026-07-28 modern server on Restlet (gate 0) - #1662
Merged
Merged
Conversation
Gate 0 for MCP 2026-07-28 (#1640): the MCP SDK 2.2.0-M2 modern stateless server behind a test-only Restlet transport that mirrors the SDK's servlet transport: POST only, header checks against the body, JSON replies, errors mapped to their HTTP status, streaming replies over core SSE. Requests are shaped as the revision requires: server/discover, tools/list and tools/call with plain and base64 Mcp-Name, header, version and method errors, legacy GET, notification and initialize. The SDK moves to 2.2.0-M2, a milestone whose modern API is a preview; the classic API ext.mcp uses is unchanged and its tests pass. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The tests do not exercise the modern SDK’s streaming response path over Restlet, leaving SSE content type, notification ordering, final response ID, and stream completion unverified.
1 open issue
What changed in this PR
Adds a gate-0 spike for hosting the MCP 2026-07-28 modern stateless server on Restlet, supporting the R6 transport investigation. The transport remains test-only; the SDK upgrade affects the production extension.
Changes:
- Upgrades the MCP Java SDK from 2.1.0 to 2.2.0-M2.
- Adds HTTP tests for discovery, tool calls, protocol errors, legacy traffic, and required client capabilities.
- Implements a test-only Restlet transport with header validation, JSON replies, and an SSE response path.
| File | Description |
|---|---|
pom.xml |
Updates the shared MCP SDK version to 2.2.0-M2. |
org.restlet.ext.mcp/src/test/java/org/restlet/ext/mcp/McpModernSpikeTestCase.java |
Adds the modern-server transport spike and HTTP interoperability tests. |
Review effort: Balanced
A tool reporting progress before its result is answered on an SSE stream: the progress notification first, then the result answering the request, then the end of the stream. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
jlouvel
added a commit
that referenced
this pull request
Nov 7, 2026
McpServerAdapter now also serves MCP revision 2026-07-28 on the same endpoint: a request whose MCP-Protocol-Version header names it goes to the MCP SDK's modern stateless server (mcp-core 2.2.0-M2), any other request keeps the 2025-11-25 path unchanged. - The tools, resources, templates and prompts registered on the adapter are served to both revisions, bridged through JSON between the two SDK schemas; getModernTools() adds tools on the modern types, served to 2026-07-28 clients only, for input_required and streamed progress. - The interceptors wrap each 2026-07-28 request and its final result or error; progress streamed before the result passes without them. - The Origin allow-list, message size, call limit, request timeout, stop and peer disconnect apply to both revisions; the tool filters apply to 2026-07-28 listings, modern tools included. - A streamed reply goes over core SSE through a bounded queue, with heartbeats; leaving it early, on a timeout, a disconnect or a stop, cancels the SDK's stream and ends the client's with an error answering the request. - Mcp-Param headers are passed to the SDK, which validates x-mcp-header arguments against them. - input_required state is sealed bound to the authenticated user; setRequestStateKey() shares the key between instances. McpRequestContext reports the revision of its request, and McpProtocol.MODERN_VERSION names 2026-07-28. Not yet for 2026-07-28: stdio, subscriptions/listen, modern resources and prompts, the client. The test-only spike of #1662 is replaced by McpModernServerTestCase. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.




Gate 0 for MCP revision 2026-07-28 (#1640), the revision Ikanos speaks today. Test-only, apart from the SDK version.
SDK.
lib-mcp-versionmoves from 2.1.0 to 2.2.0-M2 (2026-11-02), the first Java SDK line with a 2026-07-28 server:io.modelcontextprotocol.modern, a stateless server with a transport-neutralhandle(context, request). It is a milestone, and its modern API is marked preview until 3.0. The classic API thatMcpServerAdapteruses is unchanged: the existing MCP tests pass on M2, the session spike included.Spike.
McpModernSpikeTestCaseputs the SDK's modernMcpServer, with one tool, behind a test-onlyRestletthat does what the SDK'sHttpServletMcpTransportdoes: POST only, JSON content type,Mcp-Method/MCP-Protocol-Version/Mcp-Namechecked against the body (base64 values included), 202 for notifications, JSON replies, errors mapped to their HTTP status, and streaming replies over core SSE (EventStreamRepresentation). A JDKHttpClientsends requests as the revision requires (the Java SDK has no modern client yet):server/discoveradvertises["2026-07-28"], the tools capability,resultType: completeand_metaserverInfo.tools/listreturns the tool withttlMsandcacheScope;tools/callworks with a plain and a base64Mcp-Name.data.supported, an unknown method 404 / -32601.initialize400 / -32602._metaclient capabilities is refused with 400 / -32602.Findings against Ikanos' implementation of the revision:
_meta; the SDK requires the client capabilities too, as the revision does, so Ikanos' client can't call an SDK-based server until it sends them (empty is enough).initializewith -32022; the SDK with -32602. Both refuse it.mvn -pl org.restlet.ext.mcp verify: 42 tests, coverage and SpotBugs pass.🤖 Generated with Claude Code