From a231d9a09c63258ac9647f8aecf3d0d1c9330058 Mon Sep 17 00:00:00 2001 From: Jeff Handley Date: Tue, 24 Feb 2026 17:37:05 -0800 Subject: [PATCH] Add SSE server code example to transports documentation The SSE server section had prose but no code example. Add a minimal example showing that MapMcp() serves both Streamable HTTP and legacy SSE, with comments clarifying that SSE clients connect to /sse. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- docs/concepts/transports/transports.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/concepts/transports/transports.md b/docs/concepts/transports/transports.md index 976df29d5..8ea3d78be 100644 --- a/docs/concepts/transports/transports.md +++ b/docs/concepts/transports/transports.md @@ -175,6 +175,21 @@ SSE-specific configuration options: The ASP.NET Core integration supports SSE transport alongside Streamable HTTP. The same `MapMcp()` endpoint handles both protocols — clients connecting with SSE are automatically served using the legacy SSE mechanism: +```csharp +var builder = WebApplication.CreateBuilder(args); + +builder.Services.AddMcpServer() + .WithHttpTransport() + .WithTools(); + +var app = builder.Build(); + +// MapMcp() serves both Streamable HTTP and legacy SSE. +// SSE clients connect to /sse (or {route}/sse for custom routes). +app.MapMcp(); +app.Run(); +``` + No additional configuration is needed. When a client connects using the SSE protocol, the server responds with an SSE stream for server-to-client messages and accepts client-to-server messages via a separate POST endpoint. ### Transport mode comparison