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) => {
+{JSON.stringify(request.request, null, 2)}diff --git a/client/src/lib/hooks/useConnection.ts b/client/src/lib/hooks/useConnection.ts index 4abd5c6..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, @@ -26,6 +27,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 +207,7 @@ export function useConnection({ const client = new Client( { name: "mcp-inspector", - version: "0.0.1", + version: packageJson.version, }, { capabilities: { @@ -257,6 +259,11 @@ export function useConnection({ ResourceUpdatedNotificationSchema, onNotification, ); + + client.setNotificationHandler( + LoggingMessageNotificationSchema, + onNotification, + ); } if (onStdErrNotification) { diff --git a/server/src/index.ts b/server/src/index.ts index 2874b45..2a4fe65 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;