Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,22 @@ Changes log
supporting helper class. Applications with multiple STDIO protocol helpers must
select one explicitly.
- Enhancements
- Added the MCP extension using the official Java SDK 2.1.0 on shared Restlet HTTP
- Added the MCP extension using the official Java SDK (2.2.0-M2) on shared Restlet HTTP
connectors and explicitly configured STDIO helpers. The supported stateless profile
uses revision 2025-11-25, native SDK tools/resources/prompts and in-JVM dispatch,
bounded messages/calls, one-shot SSE responses, and request cancellation. Sessions,
listening GET streams, replay and Ikanos revision compatibility are not supported.
Borrowed HTTP connectors are not stopped by the MCP client.
- The MCP server adapter also serves MCP revision 2026-07-28, experimentally, on the same
endpoint: a request whose `MCP-Protocol-Version` header names it goes to the SDK's
modern stateless server, other requests to the 2025-11-25 one. The tools, resources,
templates and prompts registered on the adapter are served to both revisions;
`McpServerAdapter.getModernTools()` adds tools on the SDK's modern types, served to
2026-07-28 clients only, for `input_required` results and streamed progress. The
interceptors wrap each 2026-07-28 request and its final result, the tool filters and
the call limit apply to both revisions, and `setRequestStateKey()` shares the key
sealing `input_required` state between instances. Not yet supported for 2026-07-28:
stdio, `subscriptions/listen`, and the MCP client. The SDK's modern API is a preview.
- Added experimental SDK-native gRPC hosting of unary, server-streaming,
client-streaming and bidirectional methods on a borrowed Restlet/Netty HTTP/2 listener.
Request messages are read as the application requests them, within the queue budget,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
*/
public final class McpProtocol {
public static final String VERSION = "2025-11-25";

/**
* The stateless revision also served, experimentally, by {@link McpServerAdapter}: requests
* whose {@link #VERSION_HEADER} names it go to the MCP SDK's modern server.
*/
public static final String MODERN_VERSION = "2026-07-28";

public static final String VERSION_HEADER = "MCP-Protocol-Version";
public static final String CONTEXT_KEY = "org.restlet.ext.mcp.requestContext";
public static final String STREAM_TRANSPORT_ATTRIBUTE = "org.restlet.ext.mcp.streamTransport";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,31 @@
/** MCP-only transport metadata, also available in native SDK callbacks under CONTEXT_KEY. */
public final class McpRequestContext {
private final Request request;
private final String protocolVersion;
private final Map<String, Object> attributes = new ConcurrentHashMap<>();

public McpRequestContext(Request request) {
this(request, McpProtocol.VERSION);
}

/**
* Creates the context of a request using a given MCP revision.
*
* @param request The transport request, or null.
* @param protocolVersion The MCP revision of the request, such as {@link
* McpProtocol#MODERN_VERSION}.
*/
public McpRequestContext(Request request, String protocolVersion) {
this.request = request;
this.protocolVersion = java.util.Objects.requireNonNull(protocolVersion, "protocolVersion");
}

public Optional<Request> transportRequest() {
return Optional.ofNullable(request);
}

public String protocolVersion() {
return McpProtocol.VERSION;
return protocolVersion;
}

public Map<String, Object> attributes() {
Expand Down
Loading
Loading