Add support for MCP server instructions behind config option (#13432)

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
christine betts
2025-11-26 13:08:47 -05:00
committed by GitHub
parent 558c8ece2c
commit bc365f1eaa
9 changed files with 129 additions and 1 deletions
@@ -323,4 +323,20 @@ export class McpClientManager {
}
return mcpServers;
}
getMcpInstructions(): string {
const instructions: string[] = [];
for (const [name, client] of this.clients) {
// Only include instructions if explicitly enabled in config
if (client.getServerConfig().useInstructions) {
const clientInstructions = client.getInstructions();
if (clientInstructions) {
instructions.push(
`# Instructions for MCP Server '${name}'\n${clientInstructions}`,
);
}
}
}
return instructions.join('\n\n');
}
}