diff --git a/package.json b/package.json index ce8f6a314c..b36fa00eba 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "configuration": { "title": "Cline", "properties": { - "cline.mcp.includeInPrompt": { + "cline.mcp.enabled": { "type": "boolean", "default": true, "description": "Include MCP server functionality in AI prompts. When disabled, the AI will not be aware of MCP capabilities. This saves context window tokens." diff --git a/src/core/prompts/system.ts b/src/core/prompts/system.ts index ad9ff0a018..af3d9b9f46 100644 --- a/src/core/prompts/system.ts +++ b/src/core/prompts/system.ts @@ -178,7 +178,7 @@ Usage: } ${ - mcpHub.shouldIncludeInPrompt() + mcpHub.isMcpEnabled() ? ` ## use_mcp_tool Description: Request to use a tool provided by a connected MCP server. Each MCP server can provide multiple tools with different capabilities. Tools have defined input schemas that specify required and optional parameters. @@ -310,7 +310,7 @@ return ( ${ - mcpHub.shouldIncludeInPrompt() + mcpHub.isMcpEnabled() ? ` ## Example 4: Requesting to use an MCP tool @@ -357,7 +357,7 @@ It is crucial to proceed step-by-step, waiting for the user's message after each By waiting for and carefully considering the user's response after each tool use, you can react accordingly and make informed decisions about how to proceed with the task. This iterative process helps ensure the overall success and accuracy of your work. ${ - mcpHub.shouldIncludeInPrompt() + mcpHub.isMcpEnabled() ? ` ==== @@ -881,7 +881,7 @@ CAPABILITIES : "" } ${ - mcpHub.shouldIncludeInPrompt() + mcpHub.isMcpEnabled() ? ` - You have access to MCP servers that may provide additional tools and resources. Each server may provide different capabilities that you can use to accomplish tasks more effectively. ` @@ -907,7 +907,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.${mcpHub.shouldIncludeInPrompt() ? "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. @@ -923,7 +923,7 @@ RULES : "" } ${ - mcpHub.shouldIncludeInPrompt() + mcpHub.isMcpEnabled() ? ` - MCP operations should be used one at a time, similar to other tool usage. Wait for confirmation of success before proceeding with additional operations. ` diff --git a/src/services/mcp/McpHub.ts b/src/services/mcp/McpHub.ts index 6f4bfce542..dba50d54f6 100644 --- a/src/services/mcp/McpHub.ts +++ b/src/services/mcp/McpHub.ts @@ -59,8 +59,8 @@ export class McpHub { return this.connections.filter((conn) => !conn.server.disabled).map((conn) => conn.server) } - shouldIncludeInPrompt(): boolean { - return vscode.workspace.getConfiguration("cline.mcp").get("includeInPrompt") ?? true + isMcpEnabled(): boolean { + return vscode.workspace.getConfiguration("cline.mcp").get("enabled") ?? true } async getMcpServersPath(): Promise { diff --git a/webview-ui/src/components/mcp/McpView.tsx b/webview-ui/src/components/mcp/McpView.tsx index 4c47faa7bb..df08137766 100644 --- a/webview-ui/src/components/mcp/McpView.tsx +++ b/webview-ui/src/components/mcp/McpView.tsx @@ -12,6 +12,7 @@ type McpViewProps = { const McpView = ({ onDone }: McpViewProps) => { const { mcpServers: servers } = useExtensionState() + // const [servers, setServers] = useState([ // // Add some mock servers for testing // { @@ -100,7 +101,7 @@ const McpView = ({ onDone }: McpViewProps) => { style={{ color: "var(--vscode-foreground)", fontSize: "13px", - marginBottom: "20px", + marginBottom: "16px", marginTop: "5px", }}> The{" "} @@ -118,7 +119,6 @@ const McpView = ({ onDone }: McpViewProps) => { - {/* Server List */} {servers.length > 0 && (
{
)} - {/* Edit Settings Button */} + {/* Server Configuration Button */} +
{ onClick={() => { vscode.postMessage({ type: "openMcpSettings" }) }}> - - Edit MCP Settings + + Configure MCP Servers
+ {/* Advanced Settings Link */} +
+ { + vscode.postMessage({ + type: "openExtensionSettings", + text: "cline.mcp", + }) + }} + style={{ fontSize: "12px" }}> + Edit Advanced MCP Settings... + +
+ {/* Bottom padding */}