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
|
|
@ -67,7 +67,13 @@ builder.Services.AddAuthorization();
|
|||
builder.Services.AddHttpContextAccessor();
|
||||
builder.Services.AddMcpServer()
|
||||
.WithTools<WeatherTools>()
|
||||
.WithHttpTransport();
|
||||
.WithHttpTransport(options =>
|
||||
{
|
||||
// Stateless mode is recommended for servers that don't need server-to-client
|
||||
// requests like sampling or elicitation. It enables horizontal scaling without
|
||||
// session affinity and works with clients that don't send Mcp-Session-Id.
|
||||
options.Stateless = true;
|
||||
});
|
||||
|
||||
// Configure HttpClientFactory for weather.gov API
|
||||
builder.Services.AddHttpClient("WeatherApi", client =>
|
||||
|
|
|
|||
Loading…
Reference in a new issue