Always use MCP server instructions (#14297)

This commit is contained in:
christine betts
2025-12-01 11:17:54 -06:00
committed by GitHub
parent 4228a75186
commit 844d3a4dfa
6 changed files with 24 additions and 43 deletions
@@ -327,14 +327,11 @@ export class McpClientManager {
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}`,
);
}
const clientInstructions = client.getInstructions();
if (clientInstructions) {
instructions.push(
`# Instructions for MCP Server '${name}'\n${clientInstructions}`,
);
}
}
return instructions.join('\n\n');