From 7d58438d8cd69bed94dc1de4c10f049132c98683 Mon Sep 17 00:00:00 2001 From: "Maxim.Kolmakov" Date: Tue, 8 Jul 2025 21:35:53 +0200 Subject: [PATCH] [mcpServer] Update consent dialog to make it look like a warning and make text more clear GitOrigin-RevId: ebc5a71a7d109a3d89da7f565e08461376ef7f1d --- .../mcp-server/resources/messages/McpServerBundle.properties | 2 +- .../mcpserver/settings/McpServerSettingsConfigurable.kt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/mcp-server/resources/messages/McpServerBundle.properties b/plugins/mcp-server/resources/messages/McpServerBundle.properties index d4877246c4e5..82018e032345 100644 --- a/plugins/mcp-server/resources/messages/McpServerBundle.properties +++ b/plugins/mcp-server/resources/messages/McpServerBundle.properties @@ -51,7 +51,7 @@ open.settings.json=Open Client Settings File autoconfigure.progress.title=Configuring MCP Client\u2026 dialog.title.mcp.server.consent=Enable MCP Server? -dialog.message.mcp.server.consent=By enabling, you allow third-party applications to interact with the IDE:\n \u2022 Read file structure and contents \n \u2022 Trigger IDE actions \n \u2022 Run terminal commands and more\n\nFor a full list, see: MCP Tools. +dialog.message.mcp.server.consent=By enabling, you allow third-party applications to interact with the all opened in IDE projects:\n \u2022 Read file structure and contents \n \u2022 Trigger IDE actions \n \u2022 Run terminal commands and more\n\nFor a full list, see: MCP Tools. settings.comment.manual.config=Add the config to the client, depending on the connection type. settings.client.group=Clients Auto-Configuration mcp.settings.description=Allow external clients to read files and trigger IDE actions. All MCP Tools diff --git a/plugins/mcp-server/src/com/intellij/mcpserver/settings/McpServerSettingsConfigurable.kt b/plugins/mcp-server/src/com/intellij/mcpserver/settings/McpServerSettingsConfigurable.kt index ee39c635ad45..59fb042fc800 100644 --- a/plugins/mcp-server/src/com/intellij/mcpserver/settings/McpServerSettingsConfigurable.kt +++ b/plugins/mcp-server/src/com/intellij/mcpserver/settings/McpServerSettingsConfigurable.kt @@ -15,6 +15,7 @@ import com.intellij.openapi.ide.CopyPasteManager import com.intellij.openapi.options.SearchableConfigurable import com.intellij.openapi.ui.DialogPanel import com.intellij.openapi.ui.MessageDialogBuilder +import com.intellij.openapi.ui.Messages import com.intellij.openapi.ui.popup.JBPopupFactory import com.intellij.openapi.vfs.LocalFileSystem import com.intellij.ui.JBColor @@ -248,7 +249,7 @@ private class CheckboxWithValidation(@Nls checkboxText: String, var validator: C private object ConsentValidator : CheckboxValidator { override fun isValidNewValue(isSelected: Boolean): Boolean = if (isSelected) { - MessageDialogBuilder.yesNo(McpServerBundle.message("dialog.title.mcp.server.consent"), McpServerBundle.message("dialog.message.mcp.server.consent")).ask(getLastFocusedOrOpenedProject()) + MessageDialogBuilder.yesNo(McpServerBundle.message("dialog.title.mcp.server.consent"), McpServerBundle.message("dialog.message.mcp.server.consent"), Messages.getWarningIcon()).ask(getLastFocusedOrOpenedProject()) } else true }