If the MCP command throws an error like “permission denied” — for example, when running the Chrome DevTools MCP server with
npx -y chrome-devtools-mcp@latest — it might help to clear the npx cache (that’s what worked for me):
rm -rf /Users/userName/.npm/_npx && npx clear-npx-cache
In my case, it worked right away afterwards. How did I figure it out? I asked the AI (Cursor) — and in agent mode, Cursor even executed it automatically.