~/.npm/_npx taking up space? MCP server caches explained
Where it is
~/.npm/_npx
⏱ Only items untouched for 30 days
What it is
When an AI client starts an MCP server through npx, npm installs that package into a hashed folder under ~/.npm/_npx and runs it from there. Each distinct package gets its own folder with a full node_modules tree. MCP servers launched with uvx are cached by uv instead, not here.
Why it gets so big
Every MCP server brings its entire dependency tree, and servers you tried once and forgot about stay in the cache indefinitely. Trying out many servers, or tools that install new versions, keeps adding folders.
Is it safe to delete?
Yes, for entries you haven't used in a while. If a client launches that MCP server again, npx simply reinstalls it, which takes a moment and needs network access. Recently used entries are best left alone so the servers you rely on keep starting quickly.
Tip
If an MCP server seems stuck on an old version, removing its _npx folder forces a fresh install the next time it starts.
See how much space it uses
du -sh "$HOME/.npm/_npx" 2>/dev/nullDelete it by hand
Run in Terminal. Deleting cannot be undone, so check the paths first.
find "$HOME/.npm/_npx" -mindepth 1 -maxdepth 1 -mtime +30 -exec rm -rf {} +