You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
177
177
178
+
```csharp
179
+
varbuilder=WebApplication.CreateBuilder(args);
180
+
181
+
builder.Services.AddMcpServer()
182
+
.WithHttpTransport()
183
+
.WithTools<MyTools>();
184
+
185
+
varapp=builder.Build();
186
+
187
+
// MapMcp() serves both Streamable HTTP and legacy SSE.
188
+
// SSE clients connect to /sse (or {route}/sse for custom routes).
189
+
app.MapMcp();
190
+
app.Run();
191
+
```
192
+
178
193
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.
0 commit comments