diff --git a/src/core/prompts/system.ts b/src/core/prompts/system.ts index 0b7036641c..e3c44875f4 100644 --- a/src/core/prompts/system.ts +++ b/src/core/prompts/system.ts @@ -875,7 +875,7 @@ RULES - The user may provide a file's contents directly in their message, in which case you shouldn't use the read_file tool to get the file contents again since you already have it. - Your goal is to try to accomplish the user's task, NOT engage in a back and forth conversation.${ supportsComputerUse - ? '\n- The user may ask generic non-development tasks, such as "what\'s the latest news" or "look up the weather in San Diego", in which case you might use the browser_action tool to complete the task if it makes sense to do so, rather than trying to create a website or using curl to answer the question. However, if an available MCP server tool or resource can be used instead, you should prefer to use it over browser_action.' + ? `\n- The user may ask generic non-development tasks, such as "what\'s the latest news" or "look up the weather in San Diego", in which case you might use the browser_action tool to complete the task if it makes sense to do so, rather than trying to create a website or using curl to answer the question.${mcpHub.isMcpEnabled() ? "However, if an available MCP server tool or resource can be used instead, you should prefer to use it over browser_action." : ""}` : "" } - NEVER end attempt_completion result with a question or request to engage in further conversation! Formulate the end of your result in a way that is final and does not require further input from the user. diff --git a/src/core/webview/ClineProvider.ts b/src/core/webview/ClineProvider.ts index 31061d0802..13d630cae0 100644 --- a/src/core/webview/ClineProvider.ts +++ b/src/core/webview/ClineProvider.ts @@ -194,7 +194,7 @@ export class ClineProvider implements vscode.WebviewViewProvider { this.disposables, ) - // Listen for when color changes or MCP settings + // Listen for when color changes vscode.workspace.onDidChangeConfiguration( async (e) => { if (e && e.affectsConfiguration("workbench.colorTheme")) { @@ -204,14 +204,6 @@ export class ClineProvider implements vscode.WebviewViewProvider { text: JSON.stringify(await getTheme()), }) } - if (e && e.affectsConfiguration("cline.mcp.enabled")) { - // Send updated MCP enabled state - const enabled = this.mcpHub?.isMcpEnabled() ?? true - await this.postMessageToWebview({ - type: "mcpEnabled", - enabled, - }) - } }, null, this.disposables, @@ -580,18 +572,6 @@ export class ClineProvider implements vscode.WebviewViewProvider { await vscode.commands.executeCommand("workbench.action.openSettings", "@ext:saoudrizwan.claude-dev") break } - case "getMcpEnabled": { - const enabled = this.mcpHub?.isMcpEnabled() ?? true - await this.postMessageToWebview({ - type: "mcpEnabled", - enabled, - }) - break - } - case "toggleMcp": { - await vscode.workspace.getConfiguration("cline.mcp").update("enabled", message.enabled, true) - break - } // Add more switch case statements here as more webview message commands // are created within the webview context (i.e. inside media/main.js) } diff --git a/src/shared/ExtensionMessage.ts b/src/shared/ExtensionMessage.ts index b7b1931475..fe5584c54d 100644 --- a/src/shared/ExtensionMessage.ts +++ b/src/shared/ExtensionMessage.ts @@ -21,9 +21,6 @@ export interface ExtensionMessage { | "openRouterModels" | "mcpServers" | "relinquishControl" - | "getMcpEnabled" - | "mcpEnabled" - | "toggleMcp" text?: string action?: "chatButtonClicked" | "mcpButtonClicked" | "settingsButtonClicked" | "historyButtonClicked" | "didBecomeVisible" invoke?: "sendMessage" | "primaryButtonClick" | "secondaryButtonClick" @@ -35,7 +32,6 @@ export interface ExtensionMessage { partialMessage?: ClineMessage openRouterModels?: Record mcpServers?: McpServer[] - enabled?: boolean // For mcpEnabled message } export interface ExtensionState { diff --git a/src/shared/WebviewMessage.ts b/src/shared/WebviewMessage.ts index e7faec225a..1344b652f9 100644 --- a/src/shared/WebviewMessage.ts +++ b/src/shared/WebviewMessage.ts @@ -32,8 +32,6 @@ export interface WebviewMessage { | "checkpointRestore" | "taskCompletionViewChanges" | "openExtensionSettings" - | "getMcpEnabled" - | "toggleMcp" // | "relaunchChromeDebugMode" text?: string askResponse?: ClineAskResponse @@ -43,7 +41,6 @@ export interface WebviewMessage { number?: number autoApprovalSettings?: AutoApprovalSettings browserSettings?: BrowserSettings - enabled?: boolean // For toggleMcp message } export type ClineAskResponse = "yesButtonClicked" | "noButtonClicked" | "messageResponse" diff --git a/webview-ui/src/components/mcp/McpView.tsx b/webview-ui/src/components/mcp/McpView.tsx index 8841669e0d..7f2f0ba386 100644 --- a/webview-ui/src/components/mcp/McpView.tsx +++ b/webview-ui/src/components/mcp/McpView.tsx @@ -1,12 +1,5 @@ -import { - VSCodeButton, - VSCodeLink, - VSCodePanels, - VSCodePanelTab, - VSCodePanelView, - VSCodeCheckbox, -} from "@vscode/webview-ui-toolkit/react" -import { useEffect, useState } from "react" +import { VSCodeButton, VSCodeLink, VSCodePanels, VSCodePanelTab, VSCodePanelView } from "@vscode/webview-ui-toolkit/react" +import { useState } from "react" import { vscode } from "../../utils/vscode" import { useExtensionState } from "../../context/ExtensionStateContext" import { McpServer } from "../../../../src/shared/mcp" @@ -19,31 +12,7 @@ type McpViewProps = { const McpView = ({ onDone }: McpViewProps) => { const { mcpServers: servers } = useExtensionState() - const [isMcpEnabled, setIsMcpEnabled] = useState(true) - useEffect(() => { - // Get initial MCP enabled state - vscode.postMessage({ type: "getMcpEnabled" }) - }, []) - - useEffect(() => { - const handler = (event: MessageEvent) => { - const message = event.data - if (message.type === "mcpEnabled") { - setIsMcpEnabled(message.enabled) - } - } - window.addEventListener("message", handler) - return () => window.removeEventListener("message", handler) - }, []) - - const toggleMcp = () => { - vscode.postMessage({ - type: "toggleMcp", - enabled: !isMcpEnabled, - }) - setIsMcpEnabled(!isMcpEnabled) - } // const [servers, setServers] = useState([ // // Add some mock servers for testing // { @@ -150,58 +119,7 @@ const McpView = ({ onDone }: McpViewProps) => { - {/* MCP Toggle Section */} -
-
- - Enable MCP - - {isMcpEnabled && ( -
- Disabling MCP will save on tokens passed in the context. -
- )} - {!isMcpEnabled && ( -
- MCP is currently disabled. Enable MCP to use MCP servers and tools. Enabling MCP will use - additional tokens. -
- )} -
-
- - {servers.length > 0 && isMcpEnabled && ( + {servers.length > 0 && (
{ )} {/* Server Configuration Button */} - {isMcpEnabled && ( -
- { - vscode.postMessage({ type: "openMcpSettings" }) - }}> - - Configure MCP Servers - -
- )} + +
+ { + vscode.postMessage({ type: "openMcpSettings" }) + }}> + + Configure MCP Servers + +
+ + {/* Advanced Settings Link */} +
+ { + vscode.postMessage({ + type: "openExtensionSettings", + text: "cline.mcp", + }) + }} + style={{ fontSize: "12px" }}> + Edit Advanced MCP Settings... + +
{/* Bottom padding */}