Skip to content

Commit a08f790

Browse files
committed
Add resource update notification handler
* In proxyServer.ts - if resource subscriptions are supported, add notification handler for ResourceUpdatedNotificationSchema
1 parent 0a120e3 commit a08f790

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/proxyServer.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
ReadResourceRequestSchema,
1212
SubscribeRequestSchema,
1313
UnsubscribeRequestSchema,
14+
ResourceUpdatedNotificationSchema,
1415
ServerCapabilities,
1516
} from "@modelcontextprotocol/sdk/types.js";
1617
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
@@ -60,6 +61,13 @@ export const proxyServer = async ({
6061
});
6162

6263
if (serverCapabilities?.resources.subscribe) {
64+
server.setNotificationHandler(
65+
ResourceUpdatedNotificationSchema,
66+
async (args) => {
67+
return client.notification(args);
68+
},
69+
);
70+
6371
server.setRequestHandler(SubscribeRequestSchema, async (args) => {
6472
return client.subscribeResource(args.params);
6573
});

0 commit comments

Comments
 (0)