How do I fix 'Client closed' when connecting the Figma MCP server to Cursor AI?
I am trying to connect the Figma-Context-MCP server (figma-developer-mcp) to Cursor AI using the npx command and my Figma API token, but the MCP log shows 'Client closed', sometimes after 'spawn npx ENOENT' or 'MCP error -32000: Connection closed'. Other users reported the same problem on Windows. What should I try to get the connection working?
Originally asked on GitHub: https://github.com/GLips/Figma-Context-MCP/issues/118
6 answers
Status: the issue is closed as completed, but the maintainer said in the thread that these 'Client closed' reports are never caused by the same root cause and each one needs its own details, so there is no single confirmed fix. The workarounds below are what people actually tried in the thread.
-
Run
npx clear-npx-cachein bash and restart Cursor. This was suggested in the thread with the most positive reactions, but no one confirmed it fully fixed the problem. -
One user said it worked for them after running
npm installand then running the server withnpx. -
If the MCP log shows
spawn npx ENOENT, Cursor cannot find npx. One user changed the config command fromnpxto the absolute path/Users/nana/.nvm/versions/node/v16.14.2/bin/npx. That removed thespawn npx ENOENTerror, but the log still showedClient closedbecause their--figma-api-key=value was left empty. Another commenter then said: 'You need to set--figma-api-key=value.' -
The maintainer suggested quitting Cursor completely and opening it again, noting that MCPs in general seemed unstable in the current Cursor version and that a future Cursor update should be more reliable.
General advice: the 'Client closed' line is only the final symptom, so check the lines just before it in the MCP output. An earlier line such as
spawn npx ENOENTor the missing API key is usually the actual cause.Did this work for you?-
What a GitHub user tried on GitHub (Didn't work)
The reporter copied the provided JSON with the Figma token into the Cursor MCP section, but Cursor showed the 'Client closed' error.
Source: https://github.com/GLips/Figma-Context-MCP/issues/118 (opens external site)
Did this work for you?What @suhel-24 tried on GitHub (Outcome unclear)
A commenter suggested running
npx clear-npx-cachein bash and then restarting the client.Source: https://github.com/GLips/Figma-Context-MCP/issues/118#issuecomment-2868896395 (opens external site)
Did this work for you?What @vivek12345-web tried on GitHub (Worked)
A user said running
npm installand then usingnpxworked for them.Source: https://github.com/GLips/Figma-Context-MCP/issues/118#issuecomment-2849258518 (opens external site)
Did this work for you?What @youaodu tried on GitHub (Partly worked)
A user switched the config command from
npxto the absolute npx path/Users/nana/.nvm/versions/node/v16.14.2/bin/npx; thespawn npx ENOENTerror disappeared, but the log still showedClient closedwhile--figma-api-key=was empty.Source: https://github.com/GLips/Figma-Context-MCP/issues/118#issuecomment-2857313035 (opens external site)
Did this work for you?What @ZoeLeee tried on GitHub (Outcome unclear)
A commenter said the
--figma-api-key=argument must have an actual value and cannot be left empty.Source: https://github.com/GLips/Figma-Context-MCP/issues/118#issuecomment-2863132356 (opens external site)
Did this work for you?
Related questions
- Figma-Context-MCP: RangeError: Invalid string length when fetching large Figma files
- How to use Figma-Context-MCP with VS Code and GitHub Copilot?
- Figma-Context-MCP: why does my AI host pick the wrong tool, and what changed in v0.1.6?
- Figma-Context-MCP fails to connect in Cline — how to configure it?
- Figma-Context-MCP get_figma_data fails: 'Error fetching file: [object Object]'