8
8
ClientRequest ,
9
9
CreateMessageRequestSchema ,
10
10
ListRootsRequestSchema ,
11
+ ProgressNotificationSchema ,
12
+ ResourceUpdatedNotificationSchema ,
13
+ LoggingMessageNotificationSchema ,
11
14
Request ,
12
15
Result ,
13
16
ServerCapabilities ,
@@ -16,6 +19,10 @@ import {
16
19
McpError ,
17
20
CompleteResultSchema ,
18
21
ErrorCode ,
22
+ CancelledNotificationSchema ,
23
+ ResourceListChangedNotificationSchema ,
24
+ ToolListChangedNotificationSchema ,
25
+ PromptListChangedNotificationSchema ,
19
26
} from "@modelcontextprotocol/sdk/types.js" ;
20
27
import { useState } from "react" ;
21
28
import { toast } from "react-toastify" ;
@@ -247,6 +254,18 @@ export function useConnection({
247
254
} ) ;
248
255
249
256
if ( onNotification ) {
257
+ [
258
+ CancelledNotificationSchema ,
259
+ ProgressNotificationSchema ,
260
+ LoggingMessageNotificationSchema ,
261
+ ResourceUpdatedNotificationSchema ,
262
+ ResourceListChangedNotificationSchema ,
263
+ ToolListChangedNotificationSchema ,
264
+ PromptListChangedNotificationSchema ,
265
+ ] . forEach ( ( notificationSchema ) => {
266
+ client . setNotificationHandler ( notificationSchema , onNotification ) ;
267
+ } ) ;
268
+
250
269
client . fallbackNotificationHandler = (
251
270
notification : Notification ,
252
271
) : Promise < void > => {
0 commit comments