From 6db41c19d5dfaeee9b40786a790e8867ff12b5b1 Mon Sep 17 00:00:00 2001 From: cliffhall Date: Tue, 2 Sep 2025 16:17:04 -0400 Subject: [PATCH 01/13] * In all package.json and package-lock.json, - set TS SDK to 1.17.5, which has the automatic log level handling * In useConnection.ts - push the logging/setLevel message onto the message history stack so it is clear in the Inspector that it has been sent. --- cli/package.json | 2 +- client/package.json | 2 +- client/src/lib/hooks/useConnection.ts | 9 +++++++++ package-lock.json | 14 +++++++------- package.json | 2 +- server/package.json | 2 +- 6 files changed, 20 insertions(+), 11 deletions(-) diff --git a/cli/package.json b/cli/package.json index c7d37fd8..6a7ee7fa 100644 --- a/cli/package.json +++ b/cli/package.json @@ -24,7 +24,7 @@ }, "devDependencies": {}, "dependencies": { - "@modelcontextprotocol/sdk": "^1.17.3", + "@modelcontextprotocol/sdk": "^1.17.5", "commander": "^13.1.0", "spawn-rx": "^5.1.2" } diff --git a/client/package.json b/client/package.json index d4b233cc..76596e24 100644 --- a/client/package.json +++ b/client/package.json @@ -25,7 +25,7 @@ "cleanup:e2e": "node e2e/global-teardown.js" }, "dependencies": { - "@modelcontextprotocol/sdk": "^1.17.3", + "@modelcontextprotocol/sdk": "^1.17.5", "@radix-ui/react-checkbox": "^1.1.4", "@radix-ui/react-dialog": "^1.1.3", "@radix-ui/react-icons": "^1.3.0", diff --git a/client/src/lib/hooks/useConnection.ts b/client/src/lib/hooks/useConnection.ts index acb0c34e..8f457910 100644 --- a/client/src/lib/hooks/useConnection.ts +++ b/client/src/lib/hooks/useConnection.ts @@ -599,6 +599,15 @@ export function useConnection({ if (capabilities?.logging && defaultLoggingLevel) { lastRequest = "logging/setLevel"; await client.setLoggingLevel(defaultLoggingLevel); + pushHistory( + { + method: "logging/setLevel", + params: { + level: defaultLoggingLevel, + }, + }, + {}, + ); lastRequest = ""; } diff --git a/package-lock.json b/package-lock.json index 3a0e99d3..bb5e2b03 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "@modelcontextprotocol/inspector-cli": "^0.16.5", "@modelcontextprotocol/inspector-client": "^0.16.5", "@modelcontextprotocol/inspector-server": "^0.16.5", - "@modelcontextprotocol/sdk": "^1.17.3", + "@modelcontextprotocol/sdk": "^1.17.5", "concurrently": "^9.2.0", "open": "^10.2.0", "shell-quote": "^1.8.3", @@ -49,7 +49,7 @@ "version": "0.16.5", "license": "MIT", "dependencies": { - "@modelcontextprotocol/sdk": "^1.17.3", + "@modelcontextprotocol/sdk": "^1.17.5", "commander": "^13.1.0", "spawn-rx": "^5.1.2" }, @@ -72,7 +72,7 @@ "version": "0.16.5", "license": "MIT", "dependencies": { - "@modelcontextprotocol/sdk": "^1.17.3", + "@modelcontextprotocol/sdk": "^1.17.5", "@radix-ui/react-checkbox": "^1.1.4", "@radix-ui/react-dialog": "^1.1.3", "@radix-ui/react-icons": "^1.3.0", @@ -2011,9 +2011,9 @@ "link": true }, "node_modules/@modelcontextprotocol/sdk": { - "version": "1.17.3", - "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.17.3.tgz", - "integrity": "sha512-JPwUKWSsbzx+DLFznf/QZ32Qa+ptfbUlHhRLrBQBAFu9iI1iYvizM4p+zhhRDceSsPutXp4z+R/HPVphlIiclg==", + "version": "1.17.5", + "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.17.5.tgz", + "integrity": "sha512-QakrKIGniGuRVfWBdMsDea/dx1PNE739QJ7gCM41s9q+qaCYTHCdsIBXQVVXry3mfWAiaM9kT22Hyz53Uw8mfg==", "license": "MIT", "dependencies": { "ajv": "^6.12.6", @@ -11749,7 +11749,7 @@ "version": "0.16.5", "license": "MIT", "dependencies": { - "@modelcontextprotocol/sdk": "^1.17.3", + "@modelcontextprotocol/sdk": "^1.17.5", "cors": "^2.8.5", "express": "^5.1.0", "ws": "^8.18.0", diff --git a/package.json b/package.json index 879c7b2c..305d4c5d 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "@modelcontextprotocol/inspector-cli": "^0.16.5", "@modelcontextprotocol/inspector-client": "^0.16.5", "@modelcontextprotocol/inspector-server": "^0.16.5", - "@modelcontextprotocol/sdk": "^1.17.3", + "@modelcontextprotocol/sdk": "^1.17.5", "concurrently": "^9.2.0", "open": "^10.2.0", "shell-quote": "^1.8.3", diff --git a/server/package.json b/server/package.json index fb835f63..3ac2dbb1 100644 --- a/server/package.json +++ b/server/package.json @@ -27,7 +27,7 @@ "typescript": "^5.6.2" }, "dependencies": { - "@modelcontextprotocol/sdk": "^1.17.3", + "@modelcontextprotocol/sdk": "^1.17.5", "cors": "^2.8.5", "express": "^5.1.0", "ws": "^8.18.0", From 31dd05634ee7b9f5393f55deafa4f774518270b3 Mon Sep 17 00:00:00 2001 From: cliffhall Date: Wed, 3 Sep 2025 10:21:29 -0400 Subject: [PATCH 02/13] Bump version to 0.16.6 --- cli/package.json | 2 +- client/package.json | 2 +- package-lock.json | 16 ++++++++-------- package.json | 8 ++++---- server/package.json | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/cli/package.json b/cli/package.json index 6a7ee7fa..506b1856 100644 --- a/cli/package.json +++ b/cli/package.json @@ -1,6 +1,6 @@ { "name": "@modelcontextprotocol/inspector-cli", - "version": "0.16.5", + "version": "0.16.6", "description": "CLI for the Model Context Protocol inspector", "license": "MIT", "author": "Anthropic, PBC (https://anthropic.com)", diff --git a/client/package.json b/client/package.json index 76596e24..61f65b62 100644 --- a/client/package.json +++ b/client/package.json @@ -1,6 +1,6 @@ { "name": "@modelcontextprotocol/inspector-client", - "version": "0.16.5", + "version": "0.16.6", "description": "Client-side application for the Model Context Protocol inspector", "license": "MIT", "author": "Anthropic, PBC (https://anthropic.com)", diff --git a/package-lock.json b/package-lock.json index bb5e2b03..91385dd4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@modelcontextprotocol/inspector", - "version": "0.16.5", + "version": "0.16.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@modelcontextprotocol/inspector", - "version": "0.16.5", + "version": "0.16.6", "license": "MIT", "workspaces": [ "client", @@ -14,9 +14,9 @@ "cli" ], "dependencies": { - "@modelcontextprotocol/inspector-cli": "^0.16.5", - "@modelcontextprotocol/inspector-client": "^0.16.5", - "@modelcontextprotocol/inspector-server": "^0.16.5", + "@modelcontextprotocol/inspector-cli": "^0.16.6", + "@modelcontextprotocol/inspector-client": "^0.16.6", + "@modelcontextprotocol/inspector-server": "^0.16.6", "@modelcontextprotocol/sdk": "^1.17.5", "concurrently": "^9.2.0", "open": "^10.2.0", @@ -46,7 +46,7 @@ }, "cli": { "name": "@modelcontextprotocol/inspector-cli", - "version": "0.16.5", + "version": "0.16.6", "license": "MIT", "dependencies": { "@modelcontextprotocol/sdk": "^1.17.5", @@ -69,7 +69,7 @@ }, "client": { "name": "@modelcontextprotocol/inspector-client", - "version": "0.16.5", + "version": "0.16.6", "license": "MIT", "dependencies": { "@modelcontextprotocol/sdk": "^1.17.5", @@ -11746,7 +11746,7 @@ }, "server": { "name": "@modelcontextprotocol/inspector-server", - "version": "0.16.5", + "version": "0.16.6", "license": "MIT", "dependencies": { "@modelcontextprotocol/sdk": "^1.17.5", diff --git a/package.json b/package.json index 305d4c5d..860a4bf3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@modelcontextprotocol/inspector", - "version": "0.16.5", + "version": "0.16.6", "description": "Model Context Protocol inspector", "license": "MIT", "author": "Anthropic, PBC (https://anthropic.com)", @@ -47,9 +47,9 @@ "check-version": "node scripts/check-version-consistency.js" }, "dependencies": { - "@modelcontextprotocol/inspector-cli": "^0.16.5", - "@modelcontextprotocol/inspector-client": "^0.16.5", - "@modelcontextprotocol/inspector-server": "^0.16.5", + "@modelcontextprotocol/inspector-cli": "^0.16.6", + "@modelcontextprotocol/inspector-client": "^0.16.6", + "@modelcontextprotocol/inspector-server": "^0.16.6", "@modelcontextprotocol/sdk": "^1.17.5", "concurrently": "^9.2.0", "open": "^10.2.0", diff --git a/server/package.json b/server/package.json index 3ac2dbb1..39cc08f1 100644 --- a/server/package.json +++ b/server/package.json @@ -1,6 +1,6 @@ { "name": "@modelcontextprotocol/inspector-server", - "version": "0.16.5", + "version": "0.16.6", "description": "Server-side application for the Model Context Protocol inspector", "license": "MIT", "author": "Anthropic, PBC (https://anthropic.com)", From 801ae28ecb058b2ee4e1912d43bdcd3e732e4c8b Mon Sep 17 00:00:00 2001 From: "lorenzo.neumann" <36760115+ln-12@users.noreply.github.com> Date: Thu, 4 Sep 2025 13:37:19 +0200 Subject: [PATCH 03/13] feat: add clear buttons for request history and server notifications fixes #780 --- client/src/App.tsx | 7 ++ client/src/__tests__/App.config.test.tsx | 1 + client/src/__tests__/App.routing.test.tsx | 1 + .../components/HistoryAndNotifications.tsx | 29 ++++++++- .../HistoryAndNotifications.test.tsx | 65 ++++++++++++++++++- client/src/lib/hooks/useConnection.ts | 5 ++ 6 files changed, 105 insertions(+), 3 deletions(-) diff --git a/client/src/App.tsx b/client/src/App.tsx index fecd9839..60ce90c5 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -200,6 +200,7 @@ const App = () => { serverCapabilities, mcpClient, requestHistory, + clearRequestHistory, makeRequest, sendNotification, handleCompletion, @@ -736,6 +737,10 @@ const App = () => { await sendNotification({ method: "notifications/roots/list_changed" }); }; + const handleClearNotifications = () => { + setNotifications([]); + }; + const sendLogLevelRequest = async (level: LoggingLevel) => { await sendMCPRequest( { @@ -1102,6 +1107,8 @@ const App = () => { diff --git a/client/src/__tests__/App.config.test.tsx b/client/src/__tests__/App.config.test.tsx index b2e03d36..7458c205 100644 --- a/client/src/__tests__/App.config.test.tsx +++ b/client/src/__tests__/App.config.test.tsx @@ -49,6 +49,7 @@ jest.mock("../lib/hooks/useConnection", () => ({ serverCapabilities: null, mcpClient: null, requestHistory: [], + clearRequestHistory: jest.fn(), makeRequest: jest.fn(), sendNotification: jest.fn(), handleCompletion: jest.fn(), diff --git a/client/src/__tests__/App.routing.test.tsx b/client/src/__tests__/App.routing.test.tsx index dbd463f9..cc80f77d 100644 --- a/client/src/__tests__/App.routing.test.tsx +++ b/client/src/__tests__/App.routing.test.tsx @@ -42,6 +42,7 @@ const disconnectedConnectionState = { serverCapabilities: null, mcpClient: null, requestHistory: [], + clearRequestHistory: jest.fn(), makeRequest: jest.fn(), sendNotification: jest.fn(), handleCompletion: jest.fn(), diff --git a/client/src/components/HistoryAndNotifications.tsx b/client/src/components/HistoryAndNotifications.tsx index 34c035f5..1c606071 100644 --- a/client/src/components/HistoryAndNotifications.tsx +++ b/client/src/components/HistoryAndNotifications.tsx @@ -1,13 +1,18 @@ import { ServerNotification } from "@modelcontextprotocol/sdk/types.js"; import { useState } from "react"; import JsonView from "./JsonView"; +import { Button } from "@/components/ui/button"; const HistoryAndNotifications = ({ requestHistory, serverNotifications, + onClearHistory, + onClearNotifications, }: { requestHistory: Array<{ request: string; response?: string }>; serverNotifications: ServerNotification[]; + onClearHistory?: () => void; + onClearNotifications?: () => void; }) => { const [expandedRequests, setExpandedRequests] = useState<{ [key: number]: boolean; @@ -27,7 +32,17 @@ const HistoryAndNotifications = ({ return (
-

History

+
+

History

+ +
{requestHistory.length === 0 ? (

No history yet @@ -93,7 +108,17 @@ const HistoryAndNotifications = ({ )}

-

Server Notifications

+
+

Server Notifications

+ +
{serverNotifications.length === 0 ? (

No notifications yet diff --git a/client/src/components/__tests__/HistoryAndNotifications.test.tsx b/client/src/components/__tests__/HistoryAndNotifications.test.tsx index 42c58519..a813db8d 100644 --- a/client/src/components/__tests__/HistoryAndNotifications.test.tsx +++ b/client/src/components/__tests__/HistoryAndNotifications.test.tsx @@ -1,4 +1,5 @@ -import { render, screen, fireEvent } from "@testing-library/react"; +import { render, screen, fireEvent, within } from "@testing-library/react"; +import { useState } from "react"; import { describe, it, expect, jest } from "@jest/globals"; import HistoryAndNotifications from "../HistoryAndNotifications"; import { ServerNotification } from "@modelcontextprotocol/sdk/types.js"; @@ -223,4 +224,66 @@ describe("HistoryAndNotifications", () => { expect(screen.getByText("No history yet")).toBeTruthy(); expect(screen.getByText("No notifications yet")).toBeTruthy(); }); + + it("clears request history when Clear is clicked", () => { + const Wrapper = () => { + const [history, setHistory] = useState(mockRequestHistory); + return ( + setHistory([])} + /> + ); + }; + + render(); + + // Verify items are present initially + expect(screen.getByText("2. test/method2")).toBeTruthy(); + expect(screen.getByText("1. test/method1")).toBeTruthy(); + + // Click Clear in History header (scoped by the History heading's container) + const historyHeader = screen.getByText("History"); + const historyHeaderContainer = historyHeader.parentElement as HTMLElement; + const historyClearButton = within(historyHeaderContainer).getByRole( + "button", + { name: "Clear" }, + ); + fireEvent.click(historyClearButton); + + // History should now be empty + expect(screen.getByText("No history yet")).toBeTruthy(); + }); + + it("clears server notifications when Clear is clicked", () => { + const Wrapper = () => { + const [notifications, setNotifications] = + useState(mockNotifications); + return ( + setNotifications([])} + /> + ); + }; + + render(); + + // Verify items are present initially + expect(screen.getByText("2. notifications/progress")).toBeTruthy(); + expect(screen.getByText("1. notifications/message")).toBeTruthy(); + + // Click Clear in Server Notifications header (scoped by its heading's container) + const notifHeader = screen.getByText("Server Notifications"); + const notifHeaderContainer = notifHeader.parentElement as HTMLElement; + const notifClearButton = within(notifHeaderContainer).getByRole("button", { + name: "Clear", + }); + fireEvent.click(notifClearButton); + + // Notifications should now be empty + expect(screen.getByText("No notifications yet")).toBeTruthy(); + }); }); diff --git a/client/src/lib/hooks/useConnection.ts b/client/src/lib/hooks/useConnection.ts index 8f457910..bfb72941 100644 --- a/client/src/lib/hooks/useConnection.ts +++ b/client/src/lib/hooks/useConnection.ts @@ -653,11 +653,16 @@ export function useConnection({ setServerCapabilities(null); }; + const clearRequestHistory = () => { + setRequestHistory([]); + }; + return { connectionStatus, serverCapabilities, mcpClient, requestHistory, + clearRequestHistory, makeRequest, sendNotification, handleCompletion, From 71583caf3bd72aad73e4424e0c638588a13a35db Mon Sep 17 00:00:00 2001 From: Max Gerber Date: Fri, 5 Sep 2025 18:40:24 -0700 Subject: [PATCH 04/13] fix: correct authState.authorizationUrl type to URL --- client/src/components/AuthDebugger.tsx | 2 +- client/src/components/OAuthFlowProgress.tsx | 2 +- client/src/components/__tests__/AuthDebugger.test.tsx | 8 ++++++-- client/src/lib/auth-types.ts | 2 +- client/src/lib/oauth-state-machine.ts | 2 +- client/src/utils/urlValidation.ts | 2 +- 6 files changed, 11 insertions(+), 7 deletions(-) diff --git a/client/src/components/AuthDebugger.tsx b/client/src/components/AuthDebugger.tsx index e7acbd80..6252c116 100644 --- a/client/src/components/AuthDebugger.tsx +++ b/client/src/components/AuthDebugger.tsx @@ -187,7 +187,7 @@ const AuthDebugger = ({ JSON.stringify(currentState), ); // Open the authorization URL automatically - window.location.href = currentState.authorizationUrl; + window.location.href = currentState.authorizationUrl.toString(); break; } } diff --git a/client/src/components/OAuthFlowProgress.tsx b/client/src/components/OAuthFlowProgress.tsx index e50b7df4..5f44a4f5 100644 --- a/client/src/components/OAuthFlowProgress.tsx +++ b/client/src/components/OAuthFlowProgress.tsx @@ -240,7 +240,7 @@ export const OAuthFlowProgress = ({

Authorization URL:

- {authState.authorizationUrl} + {String(authState.authorizationUrl)}