Mark RunSessionHandler experimental (MCPEXP002) (#1383)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: halter73 <54385+halter73@users.noreply.github.com> Co-authored-by: jeffhandley <1031940+jeffhandley@users.noreply.github.com>
This commit is contained in:
parent
4e68a4e9ec
commit
84cd6917bb
1 changed files with 82 additions and 4 deletions
|
|
@ -213,12 +213,14 @@ public class MapMcpStreamableHttpTests(ITestOutputHelper outputHelper) : MapMcpT
|
|||
}).WithHttpTransport(opts =>
|
||||
{
|
||||
ConfigureStateless(opts);
|
||||
#pragma warning disable MCPEXP002 // RunSessionHandler is experimental
|
||||
opts.RunSessionHandler = async (context, server, cancellationToken) =>
|
||||
{
|
||||
Interlocked.Increment(ref runSessionCount);
|
||||
serverTcs.TrySetResult(server);
|
||||
await server.RunAsync(cancellationToken);
|
||||
};
|
||||
#pragma warning restore MCPEXP002
|
||||
}).WithTools<EchoHttpContextUserTools>();
|
||||
|
||||
await using var app = Builder.Build();
|
||||
|
|
@ -481,11 +483,13 @@ public class MapMcpStreamableHttpTests(ITestOutputHelper outputHelper) : MapMcpT
|
|||
Builder.Services.AddMcpServer().WithHttpTransport(opts =>
|
||||
{
|
||||
ConfigureStateless(opts);
|
||||
#pragma warning disable MCPEXP002 // RunSessionHandler is experimental
|
||||
opts.RunSessionHandler = async (context, server, cancellationToken) =>
|
||||
{
|
||||
serverTcs.TrySetResult(server);
|
||||
await server.RunAsync(cancellationToken);
|
||||
};
|
||||
#pragma warning restore MCPEXP002
|
||||
}).WithTools<ClaimsPrincipalTools>();
|
||||
|
||||
await using var app = Builder.Build();
|
||||
|
|
|
|||
Loading…
Reference in a new issue