Add public subscriptions/listen server handler (SEP-2575) (#1775)

Co-authored-by: Tarek Mahmoud Sayed <tarekms@ntdev.microsoft.com>
Copilot-Session: 80653343-5dcb-43cb-89b0-8ac8e572c4f7
This commit is contained in:
Tarek Mahmoud Sayed 2026-08-03 18:31:48 -07:00 • committed by GitHub
commit 81ae6ec6c7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -147,4 +147,17 @@ public class McpServerBuilderExtensionsHandlerTests
Assert.Equal(handler, options.Handlers.UnsubscribeFromResourcesHandler);
}
[Fact]
public void WithSubscriptionsListenHandler_Sets_Handler()
{
McpRequestHandler<SubscriptionsListenRequestParams, EmptyResult> handler = async (context, token) => new EmptyResult();
_builder.Object.WithSubscriptionsListenHandler(handler);
var serviceProvider = _services.BuildServiceProvider();
var options = serviceProvider.GetRequiredService<IOptions<McpServerOptions>>().Value;
Assert.Equal(handler, options.Handlers.SubscriptionsListenHandler);
}
}