Add stateless doc, prefer stateless mode and disable legacy SSE by default (#1468)
This commit is contained in:
parent
49bf17077d
commit
8eb4023c20
1 changed files with 1440 additions and 73 deletions
|
|
@ -74,7 +74,7 @@ Register resource types when building the server:
|
|||
|
||||
```csharp
|
||||
builder.Services.AddMcpServer()
|
||||
.WithHttpTransport()
|
||||
.WithHttpTransport(o => o.Stateless = true)
|
||||
.WithResources<MyResources>()
|
||||
.WithResources<DocumentResources>();
|
||||
```
|
||||
|
|
@ -208,7 +208,9 @@ Register subscription handlers when building the server:
|
|||
|
||||
```csharp
|
||||
builder.Services.AddMcpServer()
|
||||
.WithHttpTransport()
|
||||
// Subscriptions require stateful mode because the server pushes change notifications
|
||||
// to clients. Set Stateless = false explicitly for forward compatibility.
|
||||
.WithHttpTransport(o => o.Stateless = false)
|
||||
.WithResources<MyResources>()
|
||||
.WithSubscribeToResourcesHandler(async (ctx, ct) =>
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue