You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Copy file name to clipboardExpand all lines: src/ModelContextProtocol/IMcpEndpoint.cs
-16
Original file line number
Diff line number
Diff line change
@@ -15,20 +15,4 @@ public interface IMcpEndpoint : IAsyncDisposable
15
15
/// <param name="message">The message.</param>
16
16
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
0 commit comments