Merge pull request #789 from wei/fix-copy-toast
fix: toast message when copying server entry for a Streamable HTTP transport URL
This commit is contained in:
commit
2f2dd4c083
3 changed files with 43 additions and 2 deletions
26
README.md
26
README.md
|
|
@ -98,6 +98,16 @@ The MCP Inspector provides convenient buttons to export server launch configurat
|
|||
}
|
||||
```
|
||||
|
||||
**Streamable HTTP transport example:**
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "streamable-http",
|
||||
"url": "http://localhost:3000/mcp",
|
||||
"note": "For Streamable HTTP connections, add this URL directly in your MCP Client"
|
||||
}
|
||||
```
|
||||
|
||||
- **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`.
|
||||
|
||||
**STDIO transport example:**
|
||||
|
|
@ -131,9 +141,23 @@ The MCP Inspector provides convenient buttons to export server launch configurat
|
|||
}
|
||||
```
|
||||
|
||||
**Streamable HTTP transport example:**
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"default-server": {
|
||||
"type": "streamable-http",
|
||||
"url": "http://localhost:3000/mcp",
|
||||
"note": "For Streamable HTTP connections, add this URL directly in your MCP Client"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
These buttons appear in the Inspector UI after you've configured your server settings, making it easy to save and reuse your configurations.
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
|
|
|
|||
|
|
@ -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(() => {
|
||||
|
|
|
|||
|
|
@ -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 () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue