88 ClientRequest ,
99 CreateMessageRequestSchema ,
1010 ListRootsRequestSchema ,
11+ ProgressNotificationSchema ,
12+ ResourceUpdatedNotificationSchema ,
13+ LoggingMessageNotificationSchema ,
1114 Request ,
1215 Result ,
1316 ServerCapabilities ,
@@ -16,6 +19,10 @@ import {
1619 McpError ,
1720 CompleteResultSchema ,
1821 ErrorCode ,
22+ CancelledNotificationSchema ,
23+ ResourceListChangedNotificationSchema ,
24+ ToolListChangedNotificationSchema ,
25+ PromptListChangedNotificationSchema ,
1926} from "@modelcontextprotocol/sdk/types.js" ;
2027import { useState } from "react" ;
2128import { toast } from "react-toastify" ;
@@ -247,6 +254,18 @@ export function useConnection({
247254 } ) ;
248255
249256 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+
250269 client . fallbackNotificationHandler = (
251270 notification : Notification ,
252271 ) : Promise < void > => {
0 commit comments