From d70e6dc0e8a5d8ffb3a84bfdfa04131f7af2dfd8 Mon Sep 17 00:00:00 2001 From: cliffhall Date: Thu, 13 Mar 2025 15:17:17 -0400 Subject: [PATCH 1/3] 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 2/3] 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 3/3] 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) {