Skip to content

Commit c5630fb

Browse files
halter73Copilot
andcommitted
Document the sessionless-draft default and strict session behavior
Update the stateless concept doc for the strict server-side behavior (sessionless draft refused on Stateless = false; draft + Mcp-Session-Id always rejected) and renumber the stateful-knob diagnostic to MCP9006 (MCP9005 is now SEP-2577's Roots/Sampling/Logging deprecation on main). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent f448f91 commit c5630fb

2 files changed

Lines changed: 21 additions & 26 deletions

File tree

docs/concepts/mrtr/mrtr.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,12 @@ MRTR is useful when:
3333

3434
## Opting in
3535

36-
MRTR activates when both peers negotiate protocol revision **`2026-07-28`** during `initialize`. The C# SDK opts in by listing `2026-07-28` as a supported protocol version on the client; servers automatically accept it when offered. No experimental flags are required.
36+
MRTR activates when both peers negotiate protocol revision **`2026-07-28`**. The C# SDK client prefers the draft revision by default — it probes with `server/discover` and falls back to a legacy `initialize` handshake only when the server doesn't support draft. Servers accept the draft automatically when a client offers it. No experimental flags are required; pinning `ProtocolVersion` to a legacy revision opts back out.
3737

3838
```csharp
39-
// Client
39+
// Client — the SDK prefers the 2026-07-28 draft (and therefore MRTR) by default.
4040
var clientOptions = new McpClientOptions
4141
{
42-
ProtocolVersion = "2026-07-28",
4342
Handlers = new McpClientHandlers
4443
{
4544
ElicitationHandler = HandleElicitationAsync,
@@ -48,7 +47,7 @@ var clientOptions = new McpClientOptions
4847
};
4948
```
5049

51-
Under `2026-07-28`, MRTR is the recommended way to obtain client input from a server handler. The spec removes the legacy server-to-client `elicitation/create`, `sampling/createMessage`, and `roots/list` request methods, so any code that needs to work on a `2026-07-28` Streamable HTTP server (which will be stateless-only in a future revision) must use `InputRequiredException` rather than <xref:ModelContextProtocol.Server.McpServer.ElicitAsync*>, <xref:ModelContextProtocol.Server.McpServer.SampleAsync*>, or <xref:ModelContextProtocol.Server.McpServer.RequestRootsAsync*>. The legacy methods still work on stateful sessions — that's how stdio servers keep working under draft today — but they throw `InvalidOperationException("X is not supported in stateless mode.")` on any stateless session, current or draft.
50+
Under `2026-07-28`, MRTR is the recommended way to obtain client input from a server handler. The spec removes the legacy server-to-client `elicitation/create`, `sampling/createMessage`, and `roots/list` request methods, so any code that needs to work on a `2026-07-28` Streamable HTTP server (which is stateless-only under the draft revision) must use `InputRequiredException` rather than <xref:ModelContextProtocol.Server.McpServer.ElicitAsync*>, <xref:ModelContextProtocol.Server.McpServer.SampleAsync*>, or <xref:ModelContextProtocol.Server.McpServer.RequestRootsAsync*>. The legacy methods still work on stateful sessions — that's how stdio servers keep working under draft today — but they throw `InvalidOperationException("X is not supported in stateless mode.")` on any stateless session, current or draft.
5251

5352
Under the current protocol revision (`2025-06-18` and earlier), `InputRequiredException` is still supported in stateful sessions via a backward-compatibility resolver — see [Compatibility](#compatibility) below.
5453

@@ -284,8 +283,4 @@ The SDK supports `InputRequiredException` across two protocol revisions and two
284283

285284
Under the current protocol revision (`2025-06-18` and earlier), stdio and stateful Streamable HTTP keep `ClientCapabilities` populated, so the legacy methods work normally and remain the recommended way to do one-shot client interactions. Under `2026-07-28`, the spec removes those request methods from Streamable HTTP entirely; the SDK still allows the legacy methods on draft stdio sessions because stdio is implicitly single-process / stateful and the client handler is wired up regardless of negotiated revision. `InputRequiredException` is the way to write tools that work on every supported configuration.
286285

287-
### Future direction
288-
289-
The `2026-07-28` revision is moving toward a stateless-only model: `Mcp-Session-Id` is being removed, and Streamable HTTP servers will run statelessly by default under the draft revision. When that lands, the `Stateful` row for `2026-07-28` in the compatibility matrix above collapses into the `Stateless` row (Streamable HTTP under draft becomes stateless-only), and `InputRequiredException` becomes uniformly required for non-stdio servers. The current-protocol resolver path will remain for backward compatibility with older clients and stateful servers.
290-
291-
This work is a follow-up to the present PR.
286+
Because `2026-07-28` removes `Mcp-Session-Id` (SEP-2567) and the `initialize` handshake (SEP-2575), Streamable HTTP runs statelessly whenever a client speaks the draft. The `Stateful` row for `2026-07-28` in the compatibility matrix above therefore applies only to stdio — a server explicitly set to `Stateless = false` still serves draft requests sessionlessly and creates a legacy session only when an older client falls back to `initialize`.

0 commit comments

Comments
 (0)