From d728d546148eea27ac77c9e7e3ed8525b6ae78ea Mon Sep 17 00:00:00 2001 From: Wei He Date: Sat, 6 Sep 2025 23:47:54 -0400 Subject: [PATCH] fix: toast message when copying server entry for a Streamable HTTP transport URL --- client/src/components/Sidebar.tsx | 4 +++- client/src/components/__tests__/Sidebar.test.tsx | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/client/src/components/Sidebar.tsx b/client/src/components/Sidebar.tsx index a44c6e29..2f53b3aa 100644 --- a/client/src/components/Sidebar.tsx +++ b/client/src/components/Sidebar.tsx @@ -175,7 +175,9 @@ const Sidebar = ({ description: transportType === "stdio" ? "Server configuration has been copied to clipboard. Add this to your mcp.json inside the 'mcpServers' object with your preferred server name." - : "SSE URL has been copied. Use this URL directly in your MCP Client.", + : transportType === "streamable-http" + ? "Streamable HTTP URL has been copied. Use this URL directly in your MCP Client." + : "SSE URL has been copied. Use this URL directly in your MCP Client.", }); setTimeout(() => { diff --git a/client/src/components/__tests__/Sidebar.test.tsx b/client/src/components/__tests__/Sidebar.test.tsx index 8f693717..786584d2 100644 --- a/client/src/components/__tests__/Sidebar.test.tsx +++ b/client/src/components/__tests__/Sidebar.test.tsx @@ -446,6 +446,11 @@ describe("Sidebar", () => { 4, ); expect(mockClipboardWrite).toHaveBeenCalledWith(expectedConfig); + expect(mockToast).toHaveBeenCalledWith({ + title: "Config entry copied", + description: + "Server configuration has been copied to clipboard. Add this to your mcp.json inside the 'mcpServers' object with your preferred server name.", + }); }); it("should copy servers file configuration to clipboard for STDIO transport", async () => { @@ -504,6 +509,11 @@ describe("Sidebar", () => { 4, ); expect(mockClipboardWrite).toHaveBeenCalledWith(expectedConfig); + expect(mockToast).toHaveBeenCalledWith({ + title: "Config entry copied", + description: + "SSE URL has been copied. Use this URL directly in your MCP Client.", + }); }); it("should copy servers file configuration to clipboard for SSE transport", async () => { @@ -554,6 +564,11 @@ describe("Sidebar", () => { 4, ); expect(mockClipboardWrite).toHaveBeenCalledWith(expectedConfig); + expect(mockToast).toHaveBeenCalledWith({ + title: "Config entry copied", + description: + "Streamable HTTP URL has been copied. Use this URL directly in your MCP Client.", + }); }); it("should copy servers file configuration to clipboard for streamable-http transport", async () => {