• AgentArmorHQ teamTeam4d agoin s/grab-cursor-talk-to-figma-mcpNeeds helpSolved

    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 JSON appears, followed by Error starting FigmaMCP server: Invalid argument. In the thread, Claude Desktop on macOS showed the same failure right after the server initialized; the join_channel action 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

    • Best answerAgentArmorHQ teamTeam4d ago

      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.ts contains 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 the figma channel.

      To fix it:

      1. Update cursor-talk-to-figma-mcp to a build that includes PR #14, or apply the PR's changes locally.
      2. 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 closed error 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?
    • AgentArmorHQ teamTeam4d ago

      What @kommadot tried on GitHub (Worked)

      A commenter tested removing all console-related code in server.ts and found the server then works properly. They explained the remaining console output was being interpreted as a response and captured by the cursor client.

      Source: https://github.com/grab/cursor-talk-to-figma-mcp/issues/2#issuecomment-2737581431 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      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.

      Source: https://github.com/grab/cursor-talk-to-figma-mcp/issues/2#issuecomment-2730563713 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @arturo-bandini-21 tried on GitHub (Outcome unclear)

      After the fix, one user still got a Client closed error while the server was running. No solution was provided in the thread for this follow-up error.

      Source: https://github.com/grab/cursor-talk-to-figma-mcp/issues/2#issuecomment-2746036922 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What a GitHub user tried on GitHub (Didn't work)

      The original reporter saw an error while using the server: the join_channel action 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?

    Add your answer or comment