cursor-talk-to-figma-mcp: 'Unexpected token C, "Connecting"... is not valid JSON' error
Using cursor-talk-to-figma-mcp, the error
Unexpected token 'C', "Connecting"... is not valid JSONappears, followed byError starting FigmaMCP server: Invalid argument. In the thread, Claude Desktop on macOS showed the same failure right after the server initialized; thejoin_channelaction reported 'Successfully joined channel: figma', but other actions did not work. What causes this and how can I fix it?Originally asked on GitHub: https://github.com/grab/cursor-talk-to-figma-mcp/issues/2
5 answers
Fixed: this issue is closed as completed. A contributor confirmed the fix in PR #14 (https://github.com/sonnylazuardi/cursor-talk-to-figma-mcp/pull/14 (opens external site)).
The root cause, from a commenter who tested it: the MCP server's
server.tscontains console-related output, and the client interprets that human-readable console output as a protocol response. That breaks subsequent tool calls even though the server correctly reports joining thefigmachannel.To fix it:
- Update cursor-talk-to-figma-mcp to a build that includes PR #14, or apply the PR's changes locally.
- If you cannot update, the workaround that worked in the thread is to remove all console-related code in
server.ts. The commenter confirmed the server works correctly after that change.
General advice: after changing the server source, restart the MCP server so the client picks up a fresh build.
One user later reported a different
Client closederror while the server was still running; that follow-up got no reply in the thread, so its cause is unknown.Did this work for you?What @kommadot tried on GitHub (Worked)
A commenter tested removing all console-related code in
server.tsand found the server then works properly. They explained the remaining console output was being interpreted as a response and captured by the cursor client.Did this work for you?What @tpompon tried on GitHub (Didn't work)
A user ran the same server with Claude Desktop on macOS and got the identical error. The server log shows initialization, then
Unexpected token 'C', "Connecting"... is not valid JSON,Error starting FigmaMCP server: Invalid argument, and the server transport closing.Did this work for you?What @arturo-bandini-21 tried on GitHub (Outcome unclear)
After the fix, one user still got a
Client closederror while the server was running. No solution was provided in the thread for this follow-up error.Did this work for you?What a GitHub user tried on GitHub (Didn't work)
The original reporter saw an error while using the server: the
join_channelaction responded with 'Successfully joined channel: figma', but other actions did not work.Source: https://github.com/grab/cursor-talk-to-figma-mcp/issues/2 (opens external site)
Did this work for you?
Related questions
- How to fix "Client closed" / "Sending message to client: undefined" in cursor-talk-to-figma-mcp?
- cursor-talk-to-figma-mcp stuck at "joining channel" in Cursor?
- Cursor MCP shows "Client closed" and "No tools available" — how to fix?
- Figma Desktop shows "0 tools enabled" when connecting to a remote MCP server via port forwarding?
- Talk-to-Figma MCP "Client closed" on Cursor Windows + WSL2: how to fix?