Context7 MCP in Cursor: "Client closed" / "spawn npx ENOENT"
Context7 MCP server (
@upstash/context7-mcp@latest) fails to start in Cursor on Windows, Linux, and macOS with "Client closed" and "A system error occurred (spawn npx ENOENT)", even when npx is installed. How can I get the MCP server running?Originally asked on GitHub: https://github.com/upstash/context7/issues/19
6 answers
The issue is closed (COMPLETED), but no code fix was released in the thread. The maintainer only explained the error:
spawn npx ENOENTmeans the system tried to runnpxand could not find it. The thread ends with one reporter returning later, refreshing the MCP client in Cursor, and the server starting to work — so try reloading/refreshing the MCP server in Cursor.First verify npx is available from the terminal:
bashnpx -vThe maintainer said that if it reports "command not found", install Node.js and make sure Node.js is in your PATH. One reporter ran this and got
10.8.2(Nodev20.19.0), so npx worked in their terminal even though Cursor still showed the error; they suspected their Cursor AppImage launch environment was involved.A maintainer suggested trying
bunxinstead ofnpx. One user triedbunx -y @upstash/context7-mcp@latestand got the identical failure (spawn bunx ENOENT).For Windows, a maintainer posted this Cursor config that runs npx through
cmd.exe(not confirmed by any reporter):json{ "servers": { "context7": { "type": "stdio", "command": "C:\\Windows\\System32\\cmd.exe", "args": ["/c", "npx", "-y", "@upstash/context7-mcp@latest"] } } }General advice: launch your editor from a shell where npx is on PATH, or configure the MCP command with the absolute path to npx.
Did this work for you?What @klppl tried on GitHub (Worked)
A user who previously hit the error came back, refreshed the MCP client in Cursor, and the server then worked.
Source: https://github.com/upstash/context7/issues/19#issuecomment-2816806797 (opens external site)
Did this work for you?What @enesgules tried on GitHub (Outcome unclear)
Maintainer suggested running
npx -v, installing Node.js if missing, and ensuring Node.js is in PATH.Source: https://github.com/upstash/context7/issues/19#issuecomment-2816688329 (opens external site)
Did this work for you?What @enesgules tried on GitHub (Outcome unclear)
Maintainer provided a Windows Cursor config running npx through
cmd.exewithC:\Windows\System32\cmd.exe /c npx -y @upstash/context7-mcp@latest.Source: https://github.com/upstash/context7/issues/19#issuecomment-2816665745 (opens external site)
Did this work for you?What @klppl tried on GitHub (Didn't work)
A user tried
bunx -y @upstash/context7-mcp@latestafter a maintainer suggested bunx; logs showedspawn bunx ENOENTandClient closed.Source: https://github.com/upstash/context7/issues/19#issuecomment-2816678875 (opens external site)
Did this work for you?What @klppl tried on GitHub (Didn't work)
A Linux Cursor user started the server with
npx -y @upstash/context7-mcp@latest; the log showedspawn npx ENOENT,No server info found, andClient closed.Source: https://github.com/upstash/context7/issues/19#issuecomment-2816617860 (opens external site)
Did this work for you?
Related questions
- How does context7 decide which docs are trusted? What is trustScore?
- Cursor MCP "Failed to create client" with @upstash/context7-mcp using npx: fix
- Context7 MCP server rate limits my first request in Trae — is it my config or Context7?
- Does Context7 support GitLab repositories now, and where do I add one?
- Is there an official public Docker image for the context7 MCP server?