Add HttpServerSessionMode for hybrid stateful/stateless HTTP serving (#1796)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Jeff Handley <jeffhandley@users.noreply.github.com>
This commit is contained in:
parent
bba45c44bf
commit
c6a97d94d6
1 changed files with 764 additions and 150 deletions
|
|
@ -65,9 +65,9 @@ The key technique is using `ConfigureSessionOptions` to modify the tool collecti
|
|||
```csharp
|
||||
.WithHttpTransport(options =>
|
||||
{
|
||||
// Per-session tool filtering requires stateful mode. Set Stateless = false
|
||||
// explicitly for forward compatibility in case the default changes.
|
||||
options.Stateless = false;
|
||||
// Set SessionMode = HttpServerSessionMode.Stateful since per-session
|
||||
// tool filtering requires sessions.
|
||||
options.SessionMode = HttpServerSessionMode.Stateful;
|
||||
options.ConfigureSessionOptions = async (httpContext, mcpOptions, cancellationToken) =>
|
||||
{
|
||||
var toolCategory = GetToolCategoryFromRoute(httpContext);
|
||||
|
|
|
|||
Loading…
Reference in a new issue