Add support for MCP dynamic tool update by notifications/tools/list_changed (#14375)

This commit is contained in:
Adib234
2025-12-04 13:04:38 -08:00
committed by GitHub
parent 0c7ae22f5d
commit 5f60281d25
3 changed files with 557 additions and 3 deletions
@@ -174,7 +174,15 @@ export class McpClientManager {
this.toolRegistry,
this.cliConfig.getPromptRegistry(),
this.cliConfig.getWorkspaceContext(),
this.cliConfig,
this.cliConfig.getDebugMode(),
async () => {
debugLogger.log('Tools changed, updating Gemini context...');
const geminiClient = this.cliConfig.getGeminiClient();
if (geminiClient.isInitialized()) {
await geminiClient.setTools();
}
},
);
if (!existing) {
this.clients.set(name, client);