Skip to content

Commit fd02218

Browse files
halter73Copilot
andcommitted
Add SSE migration guidance to forward compatibility section
Explain that /sse endpoint clients are using the legacy transport which is now disabled by default. Cover client-side migration (change endpoint URL), server-side migration (EnableLegacySse opt-in), and transition period (both transports served simultaneously by MapMcp). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent d428901 commit fd02218

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

docs/concepts/sessions/sessions.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,26 @@ The `Stateless` property is the single most important setting for forward-proofi
3838
> [!TIP]
3939
> If you're not sure which to pick, start with `Stateless = true`. You can switch to `Stateless = false` later if you discover you need server-to-client requests or unsolicited notifications. Either way, setting the property explicitly means your server's behavior won't silently change when the SDK default is updated.
4040
41+
### Migrating from legacy SSE
42+
43+
If your clients connect to a `/sse` endpoint (e.g., `https://my-server.example.com/sse`), they are using the [legacy SSE transport](#legacy-sse-transport) — regardless of any `Stateless` or session settings on the server. The `/sse` and `/message` endpoints are now **disabled by default** (<xref:ModelContextProtocol.AspNetCore.HttpServerTransportOptions.EnableLegacySse> is `false` and marked `[Obsolete]` with diagnostic `MCP9003`). Upgrading the server SDK without updating clients will break SSE connections.
44+
45+
**Client-side migration.** Change the client `Endpoint` from the `/sse` path to the root MCP endpoint — the same URL your server passes to `MapMcp()`. For example:
46+
47+
```csharp
48+
// Before (legacy SSE):
49+
Endpoint = new Uri("https://my-server.example.com/sse")
50+
51+
// After (Streamable HTTP):
52+
Endpoint = new Uri("https://my-server.example.com/")
53+
```
54+
55+
With the default <xref:ModelContextProtocol.Client.HttpTransportMode.AutoDetect> transport mode, the client automatically tries Streamable HTTP first. You can also set `TransportMode = HttpTransportMode.StreamableHttp` explicitly if you know the server supports it.
56+
57+
**Server-side migration.** If you previously relied on `/sse` being mapped automatically, you now need `EnableLegacySse = true` (suppressing the `MCP9003` warning) to keep serving those endpoints. The recommended path is to migrate all clients to Streamable HTTP and then remove `EnableLegacySse`.
58+
59+
**Transition period.** If some clients still need SSE while others have already migrated to Streamable HTTP, set `EnableLegacySse = true` with `Stateless = false`. Both transports are served simultaneously by `MapMcp()` — Streamable HTTP on the root endpoint and SSE on `/sse` and `/message`. Once all clients have migrated, remove `EnableLegacySse` and optionally switch to `Stateless = true`.
60+
4161
## Stateless mode (recommended)
4262

4363
Stateless mode is the recommended default for HTTP-based MCP servers. When enabled, the server doesn't track any state between requests, doesn't use the `Mcp-Session-Id` header, and treats each request independently. This is the simplest and most scalable deployment model.

0 commit comments

Comments
 (0)