Earlier this month, Glow Security published research on something they call MCPhantom. The short version: when you ask a coding agent to "set up the GitHub MCP server", it often installs the one it remembers from training data. That is frequently an archived reference server from @modelcontextprotocol, not the maintained server the service now ships.
A few numbers from the write-up:
- In 98% of the sessions they studied where a deprecated server was installed or suggested, the agent picked the package name itself. The user didn't ask for it.
- The deprecated packages have been downloaded from npm more than 17.3 million times since July 2025.
- They found four high-severity bugs in the archived servers, including a remote code execution path in the Puppeteer server through prompt injection. The archive won't be patched.
- It happened across Claude Code, Cursor, Codex CLI and others, with models from several vendors. This isn't one tool's bug.
The part that should worry a team lead is how invisible this is.
An MCP server started with npx -y some-package never appears in package.json or a lockfile. Your dependency scanner doesn't see it. There's no CVE for your security tooling to match. The only record that it exists is a JSON config file in someone's home directory.
So that's where we look.
Ask npm directly
npm already knows. When a package is deprecated, the registry returns a deprecated message on the version manifest. You can see it with one request:
curl -s https://registry.npmjs.org/@modelcontextprotocol%2fserver-github/latest | jq .deprecated # "Archived and unmaintained; no security guarantees. See https://github.com/modelcontextprotocol/servers-archived" The script below reads the MCP configs that common tools use, finds every server launched with npx or bunx, and asks the registry about each one. It has no dependencies and runs on Node 18 or later.
// mcp-audit.mjs: list the MCP servers your coding tools will start, // and flag npm packages that are deprecated or archived. import { readFile } from "node:fs/promises"; import { homedir } from "node:os"; import { join } from "node:path"; const home = homedir(); const cwd = process.cwd(); const CONFIGS = [ ["Claude Code (user)", join(home, ".claude.json")], ["Claude Code (project)", join(cwd, ".mcp.json")], ["Claude Desktop (macOS)", join(home, "Library/Application Support/Claude/claude_desktop_config.json")], ["Claude Desktop (Windows)", join(process.env.APPDATA ?? "", "Claude/claude_desktop_config.json")], ["Cursor (user)", join(home, ".cursor/mcp.json")], ["Cursor (project)", join(cwd, ".cursor/mcp.json")], ["VS Code (project)", join(cwd, ".vscode/mcp.json")], ["Windsurf", join(home, ".codeium/windsurf/mcp_config.json")], ]; // Pull every server block out of a config, wherever the tool keeps it. function serversIn(json) { const blocks = [json.mcpServers, json.servers]; for (const p of Object.values(json.projects ?? {})) blocks.push(p.mcpServers); return blocks.flatMap((b) => Object.entries(b ?? {})); } // "npx -y @scope/pkg@1.2.3 --flag" -> { name: "@scope/pkg", version: "1.2.3" } function npmPackage(server) { if (!/^(npx|bunx)$/.test(server.command ?? "")) return null; const spec = (server.args ?? []).find((a) => !a.startsWith("-")); if (!spec) return null; const at = spec.lastIndexOf("@"); return at > 0 ? { name: spec.slice(0, at), version: spec.slice(at + 1) } : { name: spec, version: "latest" }; } async function npmStatus({ name, version }) { const url = `https://registry.npmjs.org/${name.replace("/", "%2f")}/${version}`; const res = await fetch(url); if (!res.ok) return `not on npm (${res.status})`; const meta = await res.json(); return meta.deprecated ? `DEPRECATED: ${meta.deprecated}` : `ok (${meta.version})`; } let flagged = 0; for (const [tool, path] of CONFIGS) { let json; try { json = JSON.parse(await readFile(path, "utf8")); } catch { continue; } for (const [id, server] of serversIn(json)) { const pkg = npmPackage(server); let status; if (server.url) status = `remote: ${server.url}`; else if (pkg) status = await npmStatus(pkg); else status = `local command: ${server.command}`; if (status.startsWith("DEPRECATED") || status.startsWith("not on npm")) flagged++; console.log(`${tool.padEnd(24)} ${id.padEnd(14)} ${pkg?.name ?? ""}\n -> ${status}`); } } console.log(`\n${flagged} server(s) need attention.`); process.exitCode = flagged ? 1 : 0; Run it from a project folder so it picks up project-level configs too:
node mcp-audit.mjs Here is what it printed against a test setup with five servers, two of which are the archived reference servers an agent typically reaches for:
Claude Code (user) github @modelcontextprotocol/server-github -> DEPRECATED: Archived and unmaintained; no security guarantees. See https://github.com/modelcontextprotocol/servers-archived Claude Code (user) browser @modelcontextprotocol/server-puppeteer -> DEPRECATED: Archived and unmaintained; no security guarantees. See https://github.com/modelcontextprotocol/servers-archived Cursor (user) files @modelcontextprotocol/server-filesystem -> ok (2.4.0) Cursor (user) gh-remote -> remote: https://api.githubcopilot.com/mcp/ VS Code (project) db -> local command: node VS Code (project) typo mcp-server-that-does-not-exist-xyz -> not on npm (404) 3 server(s) need attention. It exits with code 1 when anything is flagged, so you can drop it into a pre-commit hook or a CI job that checks a project's .mcp.json.
A few things worth knowing
Not everything under @modelcontextprotocol is archived. The filesystem server above is still maintained and came back clean. That's why the script asks the registry instead of matching a name pattern.
Claude Code keeps per-project servers inside ~/.claude.json, under projects. If you only check .mcp.json in the repo, you'll miss the servers an agent added "for this project" from inside a session. The script walks both.
"Not on npm" matters too. A name that 404s today is a name someone else can register tomorrow. If an agent invented or misspelled a package, you want to know before somebody publishes it.
The replacement is usually the service owner's server. For GitHub, that's github/github-mcp-server, available as a remote server at https://api.githubcopilot.com/mcp/, so there's nothing to install. Check the vendor's docs for the others.
What it doesn't cover
It only knows about npm. Python servers launched with uvx, Docker images, and local scripts show up as "local command" and need a human look. The config paths are the defaults. If your team keeps configs somewhere else, add a line to the list. And it audits what is already installed. It won't stop an agent from installing the next one. For that you want a check that runs before the agent's tool call, which is a separate post.
Make it a habit
Agents will keep suggesting packages from memory. Models are trained on the internet as it was, and the MCP ecosystem has moved quickly. You can't fix that from your side, but you can make sure every config on your team gets read by something that checks it.
A simple rule goes a long way: one approved server per service, written down, and nothing launched by npx that hasn't passed a check like this one.
I'm Mayursinh, founder of Redlio Labs. We build custom software and add AI features and agents to it for mid-size companies, and we use coding agents in our own work every day. The script was tested on Node 22 against the live npm registry.


![Cargo UAV Autonomy and Flight AI — Ch.06: Route Planning and Airspace Integration [EN]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F54s7rrr8fw0ipjpci49u.png)
![Cargo UAV Autonomy and Flight AI — Ch.05: Perception and Sensor Fusion for UAV [EN]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Faemm4fj7d911fwx0irut.png)
![Cargo UAV Autonomy and Flight AI — Ch.04: Autonomous Navigation for UAV [EN]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F98idhn116ojz4pviet9j.png)
![Cargo UAV Autonomy and Flight AI — Ch.03: Flight Control Software [EN]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fminle8x2lymdhmeo5fbt.png)