Fix resource subscription handling (#89)

* Fix resource subscription handling
Add resource subscription tests

* Fix typo

* Typo

* small fixes

* Fix concurrency issue with test

* Align with specification schemas
This commit is contained in:
Peder Holdgaard Pedersen 2025-03-17 17:54:29 +01:00 • committed by GitHub
commit 34a6f1c665
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -163,7 +163,8 @@ internal sealed class McpServer : McpJsonRpcEndpoint, IMcpServer
throw new McpServerException("Resources capability was enabled with subscribe support, but SubscribeToResources and/or UnsubscribeFromResources handlers were not specified.");
}
// TODO: Implement Subscribe support
SetRequestHandler<SubscribeRequestParams, EmptyResult>("resources/subscribe", request => subscribeHandler(new(this, request), cancellationToken));
SetRequestHandler<UnsubscribeRequestParams, EmptyResult>("resources/unsubscribe", request => unsubscribeHandler(new(this, request), cancellationToken));
}
private void SetPromptsHandler(McpServerOptions options)