Cached MCP servers on npx still hit npm on every launch
Testing shows npx re-queries the npm registry on every MCP server launch even when the pinned version is already cached. Without network access, Claude Code and Codex time out after about 30 seconds; --prefer-offline or npm_config_prefer_offline starts the server from cache in under two seconds but freezes the cached version.
- npx hard-codes preferOnline: true and ignores npm's five-minute registry cache
- Offline, Claude Code and Codex fail after ~30s; the pinned server connects only after ~70s
- uvx refuses to run a cached package when PyPI is unreachable, failing after 3 retries in 7.3s
- prefer-offline and npm_config_prefer_offline start the server from cache in under 2 seconds
Read next
Software