diff --git a/.changeset/dry-ghosts-nail.md b/.changeset/dry-ghosts-nail.md new file mode 100644 index 0000000000..e97e25a845 --- /dev/null +++ b/.changeset/dry-ghosts-nail.md @@ -0,0 +1,5 @@ +--- +"claude-dev": patch +--- + +A new MCP Marketplace display setting has been added to VSCode settings. (It is defaulted to "true") diff --git a/package-lock.json b/package-lock.json index 35cca727ea..7651783195 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "claude-dev", - "version": "3.4.1", + "version": "3.4.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "claude-dev", - "version": "3.4.1", + "version": "3.4.3", "license": "Apache-2.0", "dependencies": { "@anthropic-ai/bedrock-sdk": "^0.10.2", diff --git a/package.json b/package.json index ef4989622a..9ec4b78f7d 100644 --- a/package.json +++ b/package.json @@ -181,6 +181,11 @@ "type": "string", "default": null, "description": "Path to Chrome executable for browser use functionality. If not set, the extension will attempt to find or download it automatically." + }, + "cline.mcpMarketplace.enabled": { + "type": "boolean", + "default": true, + "description": "Controls whether the MCP Marketplace is enabled." } } } diff --git a/src/core/webview/ClineProvider.ts b/src/core/webview/ClineProvider.ts index 1eb078247f..65d5996bf9 100644 --- a/src/core/webview/ClineProvider.ts +++ b/src/core/webview/ClineProvider.ts @@ -240,7 +240,7 @@ export class ClineProvider implements vscode.WebviewViewProvider { this.disposables, ) - // Listen for when color changes + // Listen for configuration changes vscode.workspace.onDidChangeConfiguration( async (e) => { if (e && e.affectsConfiguration("workbench.colorTheme")) { @@ -250,6 +250,10 @@ export class ClineProvider implements vscode.WebviewViewProvider { text: JSON.stringify(await getTheme()), }) } + if (e && e.affectsConfiguration("cline.mcpMarketplace.enabled")) { + // Update state when marketplace tab setting changes + await this.postStateToWebview() + } }, null, this.disposables, @@ -1581,6 +1585,7 @@ Here is the project's README to help you get started:\n\n${mcpDetails.readmeCont chatSettings, userInfo, authToken, + mcpMarketplaceEnabled, } = await this.getState() return { @@ -1599,6 +1604,7 @@ Here is the project's README to help you get started:\n\n${mcpDetails.readmeCont chatSettings, isLoggedIn: !!authToken, userInfo, + mcpMarketplaceEnabled, } } @@ -1776,6 +1782,8 @@ Here is the project's README to help you get started:\n\n${mcpDetails.readmeCont .getConfiguration("cline.modelSettings.o3Mini") .get("reasoningEffort", "medium") + const mcpMarketplaceEnabled = vscode.workspace.getConfiguration("cline").get("mcpMarketplace.enabled", true) + return { apiConfiguration: { apiProvider, @@ -1830,6 +1838,7 @@ Here is the project's README to help you get started:\n\n${mcpDetails.readmeCont previousModeApiProvider, previousModeModelId, previousModeModelInfo, + mcpMarketplaceEnabled, } } diff --git a/src/shared/ExtensionMessage.ts b/src/shared/ExtensionMessage.ts index 8fcff1f293..136eb8ac0c 100644 --- a/src/shared/ExtensionMessage.ts +++ b/src/shared/ExtensionMessage.ts @@ -80,6 +80,7 @@ export interface ExtensionState { email: string | null photoURL: string | null } + mcpMarketplaceEnabled?: boolean } export interface ClineMessage { diff --git a/webview-ui/src/components/mcp/McpView.tsx b/webview-ui/src/components/mcp/McpView.tsx index 0b121a94bd..f40dec9ddd 100644 --- a/webview-ui/src/components/mcp/McpView.tsx +++ b/webview-ui/src/components/mcp/McpView.tsx @@ -1,92 +1,40 @@ import { VSCodeButton, VSCodeLink, VSCodePanels, VSCodePanelTab, VSCodePanelView } from "@vscode/webview-ui-toolkit/react" -import { useState, useEffect } from "react" -import { vscode } from "../../utils/vscode" -import { useExtensionState } from "../../context/ExtensionStateContext" -import { McpServer } from "../../../../src/shared/mcp" -import McpToolRow from "./McpToolRow" -import McpResourceRow from "./McpResourceRow" -import McpMarketplaceView from "./marketplace/McpMarketplaceView" +import { useEffect, useState } from "react" import styled from "styled-components" +import { McpServer } from "../../../../src/shared/mcp" +import { useExtensionState } from "../../context/ExtensionStateContext" import { getMcpServerDisplayName } from "../../utils/mcp" +import { vscode } from "../../utils/vscode" import DangerButton from "../common/DangerButton" +import McpMarketplaceView from "./marketplace/McpMarketplaceView" +import McpResourceRow from "./McpResourceRow" +import McpToolRow from "./McpToolRow" type McpViewProps = { onDone: () => void } const McpView = ({ onDone }: McpViewProps) => { - const { mcpServers: servers } = useExtensionState() - const [activeTab, setActiveTab] = useState("marketplace") + const { mcpServers: servers, mcpMarketplaceEnabled } = useExtensionState() + const [activeTab, setActiveTab] = useState(mcpMarketplaceEnabled ? "marketplace" : "installed") const handleTabChange = (tab: string) => { setActiveTab(tab) } useEffect(() => { - vscode.postMessage({ type: "silentlyRefreshMcpMarketplace" }) - vscode.postMessage({ type: "fetchLatestMcpServersFromHub" }) - }, []) + if (!mcpMarketplaceEnabled && activeTab === "marketplace") { + // If marketplace is disabled and we're on marketplace tab, switch to installed + setActiveTab("installed") + } + }, [mcpMarketplaceEnabled, activeTab]) - // const [servers, setServers] = useState([ - // // Add some mock servers for testing - // { - // name: "local-tools", - // config: JSON.stringify({ - // mcpServers: { - // "local-tools": { - // command: "npx", - // args: ["-y", "@modelcontextprotocol/server-tools"], - // }, - // }, - // }), - // status: "connected", - // tools: [ - // { - // name: "execute_command", - // description: "Run a shell command on the local system", - // }, - // { - // name: "read_file", - // description: "Read contents of a file from the filesystem", - // }, - // ], - // }, - // { - // name: "postgres-db", - // config: JSON.stringify({ - // mcpServers: { - // "postgres-db": { - // command: "npx", - // args: ["-y", "@modelcontextprotocol/server-postgres", "postgresql://localhost/mydb"], - // }, - // }, - // }), - // status: "disconnected", - // error: "Failed to connect to database: Connection refused", - // }, - // { - // name: "github-tools", - // config: JSON.stringify({ - // mcpServers: { - // "github-tools": { - // command: "npx", - // args: ["-y", "@modelcontextprotocol/server-github"], - // }, - // }, - // }), - // status: "connecting", - // resources: [ - // { - // uri: "github://repo/issues", - // name: "Repository Issues", - // }, - // { - // uri: "github://repo/pulls", - // name: "Pull Requests", - // }, - // ], - // }, - // ]) + useEffect(() => { + if (mcpMarketplaceEnabled) { + vscode.postMessage({ type: "silentlyRefreshMcpMarketplace" }) + vscode.postMessage({ type: "fetchLatestMcpServersFromHub" }) + } + }, [mcpMarketplaceEnabled]) return (
{ padding: "0 20px 0 20px", borderBottom: "1px solid var(--vscode-panel-border)", }}> - handleTabChange("marketplace")}> - Marketplace - + {mcpMarketplaceEnabled && ( + handleTabChange("marketplace")}> + Marketplace + + )} handleTabChange("installed")}> Installed @@ -129,7 +79,7 @@ const McpView = ({ onDone }: McpViewProps) => { {/* Content container */}
- {activeTab === "marketplace" && } + {mcpMarketplaceEnabled && activeTab === "marketplace" && } {activeTab === "installed" && (
{