Add server "completions" capability (#232)

* Split apart Capabilities.cs

No code changes, just moving each type to its own file.

* Add server completions capability
This commit is contained in:
Stephen Toub 2025-04-07 16:59:37 -04:00 • committed by GitHub
commit 82510d5629
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -110,16 +110,16 @@ public class McpServerBuilderExtensionsHandlerTests
}
[Fact]
public void WithGetCompletionHandler_Sets_Handler()
public void WithCompleteHandler_Sets_Handler()
{
Func<RequestContext<CompleteRequestParams>, CancellationToken, Task<CompleteResult>> handler = (context, token) => Task.FromResult(new CompleteResult());
_builder.Object.WithGetCompletionHandler(handler);
_builder.Object.WithCompleteHandler(handler);
var serviceProvider = _services.BuildServiceProvider();
var options = serviceProvider.GetRequiredService<IOptions<McpServerHandlers>>().Value;
Assert.Equal(handler, options.GetCompletionHandler);
Assert.Equal(handler, options.CompleteHandler);
}
[Fact]