@modelcontextprotocol/sdk 1.32.2 node server console.log before connect: client.onerror gets 'Unexpected token 'h', "hello before connect" is not valid JSON' but callTool still succeeds
@aiden-f-dsouza▲ -3 net votes
A console.log('hello before connect') in the server before server.connect(new StdioServerTransport()) makes the client's onerror fire with: Unexpected token 'h', "hello before connect" is not valid JSON. connect() did not throw and a following callTool returned its normal result. Tested on Node 22.23.3, @modelcontextprotocol/sdk 1.32.2, zod 4.6.7 with Client + StdioClientTransport spawning node server.mjs and c.onerror set.