From a4a7caff01ce37231c601d2cb9daf2000b3a38e7 Mon Sep 17 00:00:00 2001 From: wangyijing130 Date: Thu, 19 Jun 2025 02:31:59 +0800 Subject: [PATCH] Fix the error when submitting remote service form (#3579) * Fix the error when submitting remote service form Fix the exception caused by data structure errors when submitting remote service forms. * fix for Prettier * typing --------- Co-authored-by: wangyj20 Co-authored-by: Toshii <94262432+0xToshii@users.noreply.github.com> --- .../configuration/tabs/add-server/AddRemoteServerForm.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/webview-ui/src/components/mcp/configuration/tabs/add-server/AddRemoteServerForm.tsx b/webview-ui/src/components/mcp/configuration/tabs/add-server/AddRemoteServerForm.tsx index c5342826..7e95d767 100644 --- a/webview-ui/src/components/mcp/configuration/tabs/add-server/AddRemoteServerForm.tsx +++ b/webview-ui/src/components/mcp/configuration/tabs/add-server/AddRemoteServerForm.tsx @@ -2,6 +2,7 @@ import { LINKS } from "@/constants" import { useExtensionState } from "@/context/ExtensionStateContext" import { McpServiceClient } from "@/services/grpc-client" import { convertProtoMcpServersToMcpServers } from "@shared/proto-conversions/mcp/mcp-server-conversion" +import { McpServers } from "@shared/proto/mcp" import { EmptyRequest } from "@shared/proto/common" import { AddRemoteMcpServerRequest } from "@shared/proto/mcp" import { VSCodeButton, VSCodeLink, VSCodeTextField } from "@vscode/webview-ui-toolkit/react" @@ -40,7 +41,7 @@ const AddRemoteServerForm = ({ onServerAdded }: { onServerAdded: () => void }) = setShowConnectingMessage(true) try { - const servers = await McpServiceClient.addRemoteMcpServer( + const servers: McpServers = await McpServiceClient.addRemoteMcpServer( AddRemoteMcpServerRequest.create({ serverName: serverName.trim(), serverUrl: serverUrl.trim(), @@ -49,7 +50,7 @@ const AddRemoteServerForm = ({ onServerAdded }: { onServerAdded: () => void }) = setIsSubmitting(false) - const mcpServers = convertProtoMcpServersToMcpServers(servers) + const mcpServers = convertProtoMcpServersToMcpServers(servers.mcpServers) setMcpServers(mcpServers) setServerName("")