
The MCP client config says npx -y some-mcp-package. Every time the agent starts, it downloads and runs whatever the newest version is at that minute.
The installer became the deploy
npx and uvx were built for convenience: run a tool without installing it. With no pinned version, they resolve the name against the registry on every run. That means your MCP server's code is decided by whoever publishes the package, at the moment you open your editor. The -y even skips the one confirmation that would have existed.
Without a pinned version, what runs on your machine is decided by someone else's latest publish.
Why it is worse for MCP
An MCP server is not just any library. It runs as a local process with your credentials, reads environment variables full of tokens, and exposes tools the model calls on its own. A compromised new version needs no exploit: it is already inside, with access to everything the agent can reach, and it can rewrite tool descriptions to steer the model as well.
How to actually pin
- An exact version in the command:
npx -y package@1.4.2,uvx package==1.4.2; never a bare name. - Better still: install into a dedicated directory with a lockfile and point the client at the local binary.
- Updates as a reviewed change, with a package diff, not as a side effect of restarting.
- Minimal environment variables per server; no inheriting the whole shell.
- An inventory of MCP config files across workstations, which nobody collects today.
Where to look first
Open your team's MCP config files and grep for npx and uvx without an @ or ==. Every line you find is an automatic production deploy, on a developer's machine, with no review and no rollback.