Add toggle to enable or disable MCP servers on the system prompt

This commit is contained in:
Daniel Riccio
2025-01-02 18:54:24 -05:00
committed by Matt Rubens
parent 657e2377dd
commit ed358b4e07
8 changed files with 51 additions and 5 deletions

View File

@@ -788,8 +788,10 @@ export class Cline {
throw new Error("MCP hub not available")
}
const mcpEnabled = this.providerRef.deref()?.mcpEnabled ?? true;
const { browserViewportSize, preferredLanguage } = await this.providerRef.deref()?.getState() ?? {}
const systemPrompt = await SYSTEM_PROMPT(cwd, this.api.getModel().info.supportsComputerUse ?? false, mcpHub, this.diffStrategy, browserViewportSize) + await addCustomInstructions(this.customInstructions ?? '', cwd, preferredLanguage)
const systemPrompt = await SYSTEM_PROMPT(cwd, this.api.getModel().info.supportsComputerUse ?? false, mcpEnabled, mcpHub, this.diffStrategy, browserViewportSize) + await addCustomInstructions(this.customInstructions ?? '', cwd, preferredLanguage)
// If the previous API request's total token usage is close to the context window, truncate the conversation history to free up space for the new request
if (previousApiReqIndex >= 0) {