fix(mcp): Notifications/tools/list_changed support not working (#21050)

Co-authored-by: Bryan Morgan <bryanmorgan@google.com>
This commit is contained in:
Jacob Richman
2026-03-04 06:46:17 -08:00
committed by GitHub
parent 7011c13ee6
commit 352fb0c976
4 changed files with 378 additions and 73 deletions
@@ -69,4 +69,17 @@ export class ResourceRegistry {
clear(): void {
this.resources.clear();
}
/**
* Returns an array of resources registered from a specific MCP server.
*/
getResourcesByServer(serverName: string): MCPResource[] {
const serverResources: MCPResource[] = [];
for (const resource of this.resources.values()) {
if (resource.serverName === serverName) {
serverResources.push(resource);
}
}
return serverResources.sort((a, b) => a.uri.localeCompare(b.uri));
}
}