Move notification handler registrations to capabilities (#207)
* Move notification handler registrations to capabilities Currently request handlers are set on the capability objects, but notification handlers are set after construction via an AddNotificationHandler method on the IMcpEndpoint interface. This moves handler specification to be at construction as well. This makes it more consistent with request handlers, simplifies the IMcpEndpoint interface to just be about message sending, and avoids a concurrency bug that could occur if someone tried to add a handler while the endpoint was processing notifications. * Address more feedback and further cleanup
This commit is contained in:
parent
8fcdf95785
commit
d21d933876
1 changed files with 292 additions and 288 deletions
|
|
@ -38,7 +38,6 @@ internal static class Program
|
|||
|
||||
McpServerOptions options = new()
|
||||
{
|
||||
ServerInfo = new Implementation() { Name = "TestServer", Version = "1.0.0" },
|
||||
Capabilities = new ServerCapabilities()
|
||||
{
|
||||
Tools = ConfigureTools(),
|
||||
|
|
|
|||
Loading…
Reference in a new issue