From 397a0f651f93e8d4b4f7cdc22e58cc59ca8ef1ec Mon Sep 17 00:00:00 2001 From: Abdelkader Boudih Date: Tue, 11 Mar 2025 13:33:45 +0000 Subject: [PATCH 1/5] feat: Fetch version from package.json in useConnection hook --- client/src/lib/hooks/useConnection.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/src/lib/hooks/useConnection.ts b/client/src/lib/hooks/useConnection.ts index 4abd5c6..ea9e05a 100644 --- a/client/src/lib/hooks/useConnection.ts +++ b/client/src/lib/hooks/useConnection.ts @@ -26,6 +26,7 @@ import { SESSION_KEYS } from "../constants"; import { Notification, StdErrNotificationSchema } from "../notificationTypes"; import { auth } from "@modelcontextprotocol/sdk/client/auth.js"; import { authProvider } from "../auth"; +import packageJson from "../../../package.json"; const params = new URLSearchParams(window.location.search); const DEFAULT_REQUEST_TIMEOUT_MSEC = @@ -205,7 +206,7 @@ export function useConnection({ const client = new Client( { name: "mcp-inspector", - version: "0.0.1", + version: packageJson.version, }, { capabilities: { From e5ee00bf89ee44a57f78c1332d02fec4950f8f66 Mon Sep 17 00:00:00 2001 From: leoshimo <56844000+leoshimo@users.noreply.github.com> Date: Tue, 11 Mar 2025 12:59:28 -0700 Subject: [PATCH 2/5] fix: add dark mode support to SamplingTab JSON display (#181) --- client/src/components/SamplingTab.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/SamplingTab.tsx b/client/src/components/SamplingTab.tsx index d851880..5c45400 100644 --- a/client/src/components/SamplingTab.tsx +++ b/client/src/components/SamplingTab.tsx @@ -43,7 +43,7 @@ const SamplingTab = ({ pendingRequests, onApprove, onReject }: Props) => {

Recent Requests

{pendingRequests.map((request) => (
-
+            
               {JSON.stringify(request.request, null, 2)}
             
From d70e6dc0e8a5d8ffb3a84bfdfa04131f7af2dfd8 Mon Sep 17 00:00:00 2001 From: cliffhall Date: Thu, 13 Mar 2025 15:17:17 -0400 Subject: [PATCH 3/5] In useConnection.ts, - import LoggingMessageNotificationSchema - set onNotification as notification handler for LoggingMessageNotificationSchema --- client/src/lib/hooks/useConnection.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/src/lib/hooks/useConnection.ts b/client/src/lib/hooks/useConnection.ts index ea9e05a..19b0e9d 100644 --- a/client/src/lib/hooks/useConnection.ts +++ b/client/src/lib/hooks/useConnection.ts @@ -10,6 +10,7 @@ import { ListRootsRequestSchema, ProgressNotificationSchema, ResourceUpdatedNotificationSchema, + LoggingMessageNotificationSchema, Request, Result, ServerCapabilities, @@ -258,6 +259,11 @@ export function useConnection({ ResourceUpdatedNotificationSchema, onNotification, ); + + client.setNotificationHandler( + LoggingMessageNotificationSchema, + onNotification, + ); } if (onStdErrNotification) { From 090b7efdea0162dcaeeef29ae21ab6cf996a14b2 Mon Sep 17 00:00:00 2001 From: lloydzhou Date: Tue, 11 Mar 2025 10:36:21 +0800 Subject: [PATCH 4/5] add sse accept header --- server/src/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/src/index.ts b/server/src/index.ts index 2874b45..aa8fa9a 100644 --- a/server/src/index.ts +++ b/server/src/index.ts @@ -66,7 +66,9 @@ const createTransport = async (req: express.Request) => { return transport; } else if (transportType === "sse") { const url = query.url as string; - const headers: HeadersInit = {}; + const headers: HeadersInit = { + 'Accept': 'text/event-stream', + }; for (const key of SSE_HEADERS_PASSTHROUGH) { if (req.headers[key] === undefined) { continue; From aeaf32fa45230178ff2a88097110e6dbd9c81075 Mon Sep 17 00:00:00 2001 From: lloydzhou Date: Sat, 15 Mar 2025 12:51:44 +0800 Subject: [PATCH 5/5] fix --- server/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/index.ts b/server/src/index.ts index aa8fa9a..2a4fe65 100644 --- a/server/src/index.ts +++ b/server/src/index.ts @@ -67,7 +67,7 @@ const createTransport = async (req: express.Request) => { } else if (transportType === "sse") { const url = query.url as string; const headers: HeadersInit = { - 'Accept': 'text/event-stream', + Accept: "text/event-stream", }; for (const key of SSE_HEADERS_PASSTHROUGH) { if (req.headers[key] === undefined) {