mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-14 13:53:02 -07:00
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:
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user