next-devtools-mcp in Cursor: ERR_MODULE_NOT_FOUND advanced-patterns.js from npx cache
I'm trying to connect next-devtools-mcp in Cursor on Windows 10 with Node v20.19.5 and Next.js v16.0.3. Cursor logs "No server info found" and then the server crashes with ERR_MODULE_NOT_FOUND: Cannot find module 'C:\Users\D\AppData\Local\npm-cache_npx\af406fee6c6c487b\node_modules\next-devtools-mcp\dist\resources(cache-components)\advanced-patterns.js' imported from dist/index.js. How can I get the server to start?
Originally asked on GitHub: https://github.com/vercel/next-devtools-mcp/issues/95
3 answers
The issue is closed, but the thread does not confirm a fix for this exact environment; it offers a workaround that one commenter said resolved a similar error. The crash happens when Cursor launches next-devtools-mcp through npx and the server cannot load
dist/resources/(cache-components)/advanced-patterns.jsfrom the npx cache folder shown in the error (C:\Users\D\AppData\Local\npm-cache\_npx\...). Cursor then reports "No server info found" before the process exits with ERR_MODULE_NOT_FOUND.The only workaround described in the thread is to clear the npx cache on Windows: find the directory where npx stores its cache (the error log points to
C:\Users\D\AppData\Local\npm-cache\_npx) and remove it. General advice: after removing it, npx downloads a fresh copy of the package on the next launch, which can clear a corrupted or stale cached install. The thread does not state whether the reporter tried this or whether it fixed this specific case.A contributor also added a troubleshooting section to the project's docs in PR #97; the comment does not say what it covers, so check that PR for current official guidance. Since the issue is closed as completed, a newer release may include a fix, but no version number or changelog entry is given in this thread.
Did this work for you?What a GitHub user tried on GitHub (Outcome unclear)
Launched next-devtools-mcp in Cursor on Windows 10 (Node v20.19.5, Next.js v16.0.3); Cursor reported "No server info found" and the server exited with ERR_MODULE_NOT_FOUND for
dist/resources/(cache-components)/advanced-patterns.jsinside the npx cache. No workaround was attempted in the issue body.Source: https://github.com/vercel/next-devtools-mcp/issues/95 (opens external site)
Did this work for you?What @lucasfvera tried on GitHub (Worked)
A commenter reported solving a similar issue by clearing the Windows npx cache directory; no exact path was given, but the error log points to
C:\Users\D\AppData\Local\npm-cache\_npx. The thread does not confirm this was applied to the reporter's case.Source: https://github.com/vercel/next-devtools-mcp/issues/95#issuecomment-3570997220 (opens external site)
Did this work for you?
Related questions
- Why isn't next-devtools-mcp MCP server working in Cursor? (fixed in v0.2.2)
- next-devtools-mcp discover_servers fails on Windows: "No running Next.js dev servers with MCP enabled found"
- code --add-mcp JSON loses quotes when run from PowerShell on Windows
- Codex goes idle with 'Initialization complete.' after next-devtools.init
- Fix next-devtools-mcp ERR_MODULE_NOT_FOUND (execa) in Cursor on Windows