Skip to content

Commit 2f2dd4c

Browse files
authored
Merge pull request modelcontextprotocol#789 from wei/fix-copy-toast
fix: toast message when copying server entry for a Streamable HTTP transport URL
2 parents b476ece + 1207834 commit 2f2dd4c

File tree

3 files changed

+43
-2
lines changed

3 files changed

+43
-2
lines changed

README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,16 @@ The MCP Inspector provides convenient buttons to export server launch configurat
9898
}
9999
```
100100

101+
**Streamable HTTP transport example:**
102+
103+
```json
104+
{
105+
"type": "streamable-http",
106+
"url": "http://localhost:3000/mcp",
107+
"note": "For Streamable HTTP connections, add this URL directly in your MCP Client"
108+
}
109+
```
110+
101111
- **Servers File** - Copies a complete MCP configuration file structure to your clipboard, with your current server configuration added as `default-server`. This can be saved directly as `mcp.json`.
102112

103113
**STDIO transport example:**
@@ -131,9 +141,23 @@ The MCP Inspector provides convenient buttons to export server launch configurat
131141
}
132142
```
133143

144+
**Streamable HTTP transport example:**
145+
146+
```json
147+
{
148+
"mcpServers": {
149+
"default-server": {
150+
"type": "streamable-http",
151+
"url": "http://localhost:3000/mcp",
152+
"note": "For Streamable HTTP connections, add this URL directly in your MCP Client"
153+
}
154+
}
155+
}
156+
```
157+
134158
These buttons appear in the Inspector UI after you've configured your server settings, making it easy to save and reuse your configurations.
135159

136-
For SSE transport connections, the Inspector provides similar functionality for both buttons. The "Server Entry" button copies the SSE URL configuration that can be added to your existing configuration file, while the "Servers File" button creates a complete configuration file containing the SSE URL for direct use in clients.
160+
For SSE and Streamable HTTP transport connections, the Inspector provides similar functionality for both buttons. The "Server Entry" button copies the configuration that can be added to your existing configuration file, while the "Servers File" button creates a complete configuration file containing the URL for direct use in clients.
137161

138162
You can paste the Server Entry into your existing `mcp.json` file under your chosen server name, or use the complete Servers File payload to create a new configuration file.
139163

client/src/components/Sidebar.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,9 @@ const Sidebar = ({
175175
description:
176176
transportType === "stdio"
177177
? "Server configuration has been copied to clipboard. Add this to your mcp.json inside the 'mcpServers' object with your preferred server name."
178-
: "SSE URL has been copied. Use this URL directly in your MCP Client.",
178+
: transportType === "streamable-http"
179+
? "Streamable HTTP URL has been copied. Use this URL directly in your MCP Client."
180+
: "SSE URL has been copied. Use this URL directly in your MCP Client.",
179181
});
180182

181183
setTimeout(() => {

client/src/components/__tests__/Sidebar.test.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,11 @@ describe("Sidebar", () => {
446446
4,
447447
);
448448
expect(mockClipboardWrite).toHaveBeenCalledWith(expectedConfig);
449+
expect(mockToast).toHaveBeenCalledWith({
450+
title: "Config entry copied",
451+
description:
452+
"Server configuration has been copied to clipboard. Add this to your mcp.json inside the 'mcpServers' object with your preferred server name.",
453+
});
449454
});
450455

451456
it("should copy servers file configuration to clipboard for STDIO transport", async () => {
@@ -504,6 +509,11 @@ describe("Sidebar", () => {
504509
4,
505510
);
506511
expect(mockClipboardWrite).toHaveBeenCalledWith(expectedConfig);
512+
expect(mockToast).toHaveBeenCalledWith({
513+
title: "Config entry copied",
514+
description:
515+
"SSE URL has been copied. Use this URL directly in your MCP Client.",
516+
});
507517
});
508518

509519
it("should copy servers file configuration to clipboard for SSE transport", async () => {
@@ -554,6 +564,11 @@ describe("Sidebar", () => {
554564
4,
555565
);
556566
expect(mockClipboardWrite).toHaveBeenCalledWith(expectedConfig);
567+
expect(mockToast).toHaveBeenCalledWith({
568+
title: "Config entry copied",
569+
description:
570+
"Streamable HTTP URL has been copied. Use this URL directly in your MCP Client.",
571+
});
557572
});
558573

559574
it("should copy servers file configuration to clipboard for streamable-http transport", async () => {

0 commit comments

Comments
 (0)