From 209b133f8a07b490e6d74b8819c8a2be726cf4ea Mon Sep 17 00:00:00 2001 From: Rui Figueira Date: Tue, 1 Jul 2025 08:19:00 +0100 Subject: [PATCH] Remove problematic Client.handleMessage call Client has no handleMessage function, and it was causing a failure in playground AI: ``` [debug] Error details: {"message":"_a.handleMessage is not a function","stack":"TypeError: _a.handleMessage is not a function\n at transportInstance.onmessage (http://localhost:5173/node_modules/.vite/deps/use-mcp_react.js?v=24c67158:7940:56)\n at _transport.onmessage (http://localhost:5173/node_modules/.vite/deps/use-mcp_react.js?v=24c67158:7240:63)\n at processStream (http://localhost:5173/node_modules/.vite/deps/use-mcp_react.js?v=24c67158:7004:77)","name":"TypeError"} ``` --- src/react/useMcp.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/react/useMcp.ts b/src/react/useMcp.ts index 2db44bf..1c9a5e6 100644 --- a/src/react/useMcp.ts +++ b/src/react/useMcp.ts @@ -234,8 +234,6 @@ export function useMcp(options: UseMcpOptions): UseMcpResult { transportInstance.onmessage = (message: JSONRPCMessage) => { // Use stable addLog addLog('debug', `[Transport] Received: ${JSON.stringify(message)}`) - // @ts-ignore - clientRef.current?.handleMessage(message) // Forward to current client } transportInstance.onerror = (err: Error) => { // Transport errors usually mean connection is lost/failed definitively for this transport