Your pinned MCP server isn't pinned. Here's how to fix it.

·

The short answer

Naming a version of an MCP server in uvx or npx fixes the server's own code. It does not fix the packages the server depends on. Those can change whenever the launcher rebuilds its environment, with no change to your config. To stop that, install the server once from its lock file and start the installed copy directly.

An MCP server is a small program that lets an AI assistant use a tool, such as a firewall or a monitoring system. A dependency is another package the server needs to run, and one server can pull in about 70 of them. uvx and npx are one-line launchers for Python and JavaScript programs. They download a package and run it in one step.

What Corelight found

Corelight followed one MCP server for five weeks. The server held credentials and was set to one release, built from one commit. In Corelight's words, "Over five weeks it ran with 15 different sets of dependencies. Nobody had changed its configuration."

From the Corelight post, published November 10, 2026:

Corelight is clear about the cause: "None of this is a flaw in MCP, and MCP servers don't have to run this way." The drift comes from how the servers are installed and started.

Why naming a version is not enough

Pinning a version fixes the server's own code, but its dependencies come from version ranges. To pin means to name an exact version, tag, or commit so the code should not change. The server's own package lists its dependencies as ranges, such as "this library, version 2 or newer." Each time the launcher builds a fresh environment, it picks the newest release inside each range.

In Corelight's test, uvx installed from the server's declared dependencies, not from the project's lock file. A lock file lists every dependency at an exact version, often with a hash so the download can be checked. A hash is a fingerprint of a file. If the file changes, the fingerprint no longer matches. The project had published a hash-pinned lock file, but the launcher didn't use it, so about 60 packages underneath were resolved fresh from PyPI.

The launcher also keeps a cache. Corelight's AI assistant started the server 162 times in one week. Most of those launches only checked the Git tag and reused the cached environment. Every couple of days, a launch rebuilt the environment and picked up whatever had been released since.

We saw the same gap on our own test machine on November 20, 2026. We installed Red Hat's linux-mcp-server at one commit, once with uvx and once from the project's lock file. The two environments had 25 of 73 dependencies at different versions. That figure is from our test, not from Corelight.

Why it matters more for MCP servers

Every dependency runs inside the server's process, with the server's tokens and file access. If one package release is hijacked, the bad code reaches the server on the next rebuild. Nobody runs an install command to trigger it. The AI assistant starts the server on its own at the beginning of each session, so nobody sees the change happen.

Corelight names past attacks of this kind. Its first example is xz Utils in March 2024. A backdoor was added to two releases, "aimed at SSH servers that load the library." Shai-Hulud ran from September 2025 to June 2026, and Corelight describes it this way: "A self-spreading worm used stolen npm tokens." In June 2026 a variant reached PyPI, including MCP-themed packages.

Check whether your MCP servers can drift

Look at how each server is started in your AI client's config. A server can drift if any of these is true:

To confirm which version is running right now, see how to check which MCP server version you're running.

How to freeze a Python MCP server with uv

Corelight's fix has five steps. It sums them up as "Commit-pinned, hash-verified, installed once, launched directly, with update checks off." Steps 2 and 3 only work if the project publishes a lock file.

We ran every command below on November 20, 2026, with uv 0.13.9, against Red Hat's linux-mcp-server at its 1.8.0 commit. Swap in your own server's repo, commit, and program name.

1. Pin to a commit, not a tag. Corelight's reason: "Tags can be moved." A commit ID can't be moved. Find the full commit ID for the release you want, then clone the repo at that commit.

git clone https://github.com/rhel-lightspeed/linux-mcp-server.git server-src
cd server-src
git checkout 44c7cbf0e44cc4fff678c9b4d9407562d3785d7d

2. Use the project's hash-pinned lock file. uv projects keep their lock file in uv.lock. Export it to a requirements file that pins every package with a hash. The --frozen flag tells uv not to update the lock file first, and it stops with an error if there is no lock file.

uv export --frozen --no-dev --no-emit-project -o ../requirements.txt
cd ..

Corelight hit one snag here. The author's lock file was built for a different operating system, so Corelight made one for its own, held to the author's versions.

3. Install into a dedicated environment with hash checking on, then add the server without its dependencies. These must be two separate commands. In our test, putting --require-hashes on the server install failed, because the server's own source has no hash in the file.

uv venv mcp-env
uv pip install --python mcp-env/bin/python --require-hashes -r requirements.txt
uv pip install --python mcp-env/bin/python --no-deps ./server-src

--no-deps tells uv to install only the server itself and skip dependency resolution, so nothing new comes in. One gap remains. Building the server from source pulls in its build tools, and those are not in the hash file.

4. Start the installed server directly, not through the launcher. Point your AI client at the program inside the environment:

mcp-env/bin/linux-mcp-server

In our test, the installed copy answered an MCP handshake and listed its tools on six starts in a row.

5. Turn off startup update checks. Corelight's frozen server still made one request to PyPI on its first launch, because its MCP framework checked for a newer version of itself. A documented setting would have turned that off. Check your server's README for an update check setting. Servers built on the fastmcp framework read FASTMCP_CHECK_FOR_UPDATES, and the value off disables the check.

Record what you installed, so you can compare it later:

uv pip freeze --python mcp-env/bin/python > installed-2026-11-20.txt

In Corelight's test, five frozen servers were started 457 times over two weeks. Each server's installed package list stayed identical to the list recorded on the day it was installed. They also started in about 2 seconds instead of 4 to 11.

What to do with an npx proxy for a hosted server

Give the proxy an exact version, or install it once and start the installed copy. Some vendors' setup docs start a local proxy with npx and the @latest tag. Corelight says that with @latest, "the client asks the npm registry for the newest version each time it starts." The proxy in its example "released six versions in one recent month, four of them within 14 hours."

The quickest change is to replace @latest with an exact version in your client config, for example npx -y some-proxy@1.5.0 instead of npx -y some-proxy@latest. In our test with a small public package, the exact version kept running the same release while @latest picked up the newer one. npx still contacted the registry on each run in both cases.

For a fixed install, put the proxy in its own folder with an exact version, then start that copy:

Example name. Swap in the MCP server package you use.

npm install --prefix ./proxy --save-exact some-proxy@1.5.0
./proxy/node_modules/.bin/some-proxy

Use --save-exact. Without it, npm writes a version range into package.json. To rebuild the folder later from the lock file, run npm ci inside it. The npm docs say npm ci "will never write to package.json or any of the package-locks." It also stops with an error if package.json and the lock file don't match.

Don't turn off TLS certificate checking to get a proxy working. Corelight found one vendor setup that did this for the whole proxy process. Its advice to maintainers is to show users how to trust their certificate authority instead.

After the freeze, someone has to own updates

A frozen server keeps older code until someone updates it. When Corelight froze one server, 40 of its packages were older than what the launcher would have pulled that day. Corelight says that "a named owner needs to re-lock on a schedule, review what changed, and check the pinned versions for known vulnerabilities."

A simple routine:

  1. Name an owner for each frozen server.
  2. On a set schedule, pick a new release commit and repeat the five steps.
  3. Compare the new uv pip freeze list with the old one, and read what changed.
  4. Check the pinned versions against published advisories. Our October 2026 MCP security advisories guide is one place to start.

Give the server less access

Freezing a server controls which code runs. It doesn't limit what that code can reach. A frozen server can still do anything its token allows. Give it the narrowest token you can, and use a read-only mode where the server has one. For an example, see how to run a Proxmox MCP server read-only.

Frequently asked questions

If I pin an MCP server to a commit, are its dependencies pinned too?

No. The commit fixes the server's own code, but its dependencies still come from version ranges. Corelight saw one commit-pinned server run with 17 distinct environments across 19 builds.

Does uvx download a new copy of the MCP server every time?

Not every time. uvx keeps a cached environment, and most launches reuse it. In Corelight's test, the cache was rebuilt about every couple of days, and each rebuild could pull newer dependencies.

How do I install an MCP server from its lock file?

For a uv project, export uv.lock with uv export --frozen to a requirements file with hashes. Install it into a new environment with uv pip install --require-hashes, then install the server with --no-deps. Start the server from that environment, not through uvx.

Is npx @latest a problem for MCP proxies?

Yes. It means the proxy can change on any start. With @latest, npx asks the registry for the newest version, so a new release reaches you without a config change. Use an exact version, or install the proxy once and start that copy.

Does freezing an MCP server stop it from getting security fixes?

Yes, until someone updates it. A frozen server keeps the versions you installed. Name an owner who re-locks on a schedule and checks the pinned versions against advisories.

Related links

Sources (opened 2026-11-20)