MCPcopy Index your code
hub / github.com/codeaashu/claude-code / getMcpInstructions

Function getMcpInstructions

src/constants/prompts.ts:579–604  ·  view source on GitHub ↗
(mcpClients: MCPServerConnection[])

Source from the content-addressed store, hash-verified

577}
578
579function getMcpInstructions(mcpClients: MCPServerConnection[]): string | null {
580 const connectedClients = mcpClients.filter(
581 (client): client is ConnectedMCPServer => client.type === 'connected',
582 )
583
584 const clientsWithInstructions = connectedClients.filter(
585 client => client.instructions,
586 )
587
588 if (clientsWithInstructions.length === 0) {
589 return null
590 }
591
592 const instructionBlocks = clientsWithInstructions
593 .map(client => {
594 return `## ${client.name}
595${client.instructions}`
596 })
597 .join('\n\n')
598
599 return `# MCP Server Instructions
600
601The following MCP servers have provided instructions for how to use their tools and resources:
602
603${instructionBlocks}`
604}
605
606export async function computeEnvInfo(
607 modelId: string,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected