From 7e2460087771535dea46f3851472f7676790deb8 Mon Sep 17 00:00:00 2001 From: Daniel <57051444+daniel-lxs@users.noreply.github.com> Date: Tue, 2 Sep 2025 20:49:21 -0500 Subject: [PATCH] feat: add auto-approve support for MCP access_resource tool (#7606) --- packages/types/src/mcp.ts | 10 ++++++++ webview-ui/src/components/chat/ChatView.tsx | 28 ++++++++++++++++++--- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/packages/types/src/mcp.ts b/packages/types/src/mcp.ts index e72d0633f7..ed930f4a16 100644 --- a/packages/types/src/mcp.ts +++ b/packages/types/src/mcp.ts @@ -1,5 +1,15 @@ import { z } from "zod" +/** + * MCP Server Use Types + */ +export interface McpServerUse { + type: string + serverName: string + toolName?: string + uri?: string +} + /** * McpExecutionStatus */ diff --git a/webview-ui/src/components/chat/ChatView.tsx b/webview-ui/src/components/chat/ChatView.tsx index 85840267fe..a95e9d95a0 100644 --- a/webview-ui/src/components/chat/ChatView.tsx +++ b/webview-ui/src/components/chat/ChatView.tsx @@ -11,7 +11,7 @@ import { useTranslation } from "react-i18next" import { useDebounceEffect } from "@src/utils/useDebounceEffect" import { appendImages } from "@src/utils/imageUtils" -import type { ClineAsk, ClineMessage } from "@roo-code/types" +import type { ClineAsk, ClineMessage, McpServerUse } from "@roo-code/types" import { ClineSayBrowserAction, ClineSayTool, ExtensionMessage } from "@roo/ExtensionMessage" import { McpServer, McpTool } from "@roo/mcp" @@ -1062,9 +1062,9 @@ const ChatViewComponent: React.ForwardRefRenderFunction s.name === mcpServerUse.serverName) const tool = server?.tools?.find((t: McpTool) => t.name === mcpServerUse.toolName) return tool?.alwaysAllow || false @@ -1145,7 +1145,27 @@ const ChatViewComponent: React.ForwardRefRenderFunction