Harness Engineering · December 1, 2026
AI Coding Agents Are Installing Archived MCP Servers. Block Them in the Harness
Ask a coding agent to "add a GitHub MCP server" and it may write @modelcontextprotocol/server-github into your config. That package has been archived since May 2025. When I queried npm on December 1, 2026, its deprecation field read: "Archived and unmaintained; no security guarantees."
The agent is not lying to you. It is remembering. The package name was correct when its training data was collected, and nothing in the model knows that the repository was frozen later. That gap is now measurable, and the place to close it is the harness, not the prompt.
What the research found
On November 2, 2026, Glow Labs published research on the pattern it calls MCPhantom. The Cloud Security Alliance followed with a research note on November 10. The numbers are worth reading with their denominators intact:
- 98% of the sessions in which a deprecated server was installed or suggested appear to have taken the package name from the model's training data. The other 2% came from users asking for the old package by name. This is not an error rate across all sessions: CSA notes that Glow did not disclose its total session count.
- 13 of the 20 reference servers Anthropic published when MCP launched in 2024 have since been archived, according to Glow.
- The archived packages Glow tracked had about 17.35 million npm downloads since July 10, 2025. npm counts include automated and repeated fetches, so this is not a count of unique installs. The largest single package,
server-github, accounts for about 5.27 million. - Glow reported four high-severity flaws in the archived servers. Only one is described publicly: in the Puppeteer server, a prompt injection can make the agent launch an arbitrary process instead of a browser. None of the four has a CVE, and Glow says it has not seen exploitation.
- The behavior showed up in Claude Code, Cursor, Codex CLI, Claude Cowork and Claude chat, with models from Anthropic, OpenAI and xAI.
The disclosure ended where archived code usually ends. The maintainers closed the advisory and said the server "is unmaintained, so no fix or release will come from this repository."
Why your existing controls miss it
An MCP server launched with npx never appears in package.json or a lockfile. Software composition analysis has no manifest to scan, and the flaws have no CVEs to match against. Endpoint detection sees a trusted Node process downloading a public package. Software inventory does not register it as an application.
The deprecation notice exists, but it reaches the wrong reader. npx still installs a deprecated package and prints a warning into a terminal the agent controls. Glow describes one session where the agent checked npm, received the "deprecated" notice, installed the package anyway and did not mention it to the user.
This is the core Harness Engineering lesson in miniature: a model's knowledge is a snapshot, so the harness has to verify every decision that turns into a side effect. Here the side effect is a new process with your credentials and your network access.
Step 1: find what is already installed
Start with an inventory. The script below reads the common MCP config locations, extracts packages launched through npx, and asks the npm registry whether each one is deprecated. It needs Python 3 and npm, nothing else.
#!/usr/bin/env python3
"""List MCP servers in agent configs whose npm package is deprecated."""
import json, pathlib, subprocess, sys
CONFIGS = ["~/.claude.json", "~/.cursor/mcp.json", ".mcp.json", ".cursor/mcp.json"]
def npm_packages(server):
if server.get("command") not in ("npx", "npx.cmd"):
return []
args = [a for a in server.get("args", []) if not a.startswith("-")]
return args[:1]
def servers(cfg):
yield from cfg.get("mcpServers", {}).items()
for project in cfg.get("projects", {}).values(): # ~/.claude.json keeps per-project servers
yield from project.get("mcpServers", {}).items()
def deprecated(pkg):
out = subprocess.run(["npm", "view", pkg, "deprecated"], capture_output=True, text=True)
return out.stdout.strip()
found = 0
for path in CONFIGS:
p = pathlib.Path(path).expanduser()
if not p.is_file():
continue
for name, server in servers(json.loads(p.read_text())):
for pkg in npm_packages(server):
note = deprecated(pkg)
if note:
found += 1
print(f"{p}: server '{name}' uses {pkg}\n npm: {note}")
sys.exit(1 if found else 0)
I ran it against a test project that declared two servers, the archived GitHub server and the still-maintained filesystem server. It flagged only the first:
.mcp.json: server 'github' uses @modelcontextprotocol/server-github
npm: Archived and unmaintained; no security guarantees. See https://github.com/modelcontextprotocol/servers-archived
The exit code is 1 when anything is found, so the same script can fail a CI job or a scheduled endpoint check. It does not hardcode a list of bad packages. It asks the registry each time, so it keeps working as more servers are archived.
Step 2: block new installs before they run
An inventory catches yesterday's mistakes. A pre-execution hook catches the next one. Claude Code runs PreToolUse hooks before a tool call executes and treats exit code 2 as a block, sending the hook's message back to the model. Other harnesses that support pre-execution hooks can reuse the same logic.
#!/usr/bin/env python3
"""PreToolUse hook: refuse npm packages marked deprecated before the agent installs them."""
import json, re, subprocess, sys
event = json.load(sys.stdin)
tool, args = event.get("tool_name", ""), event.get("tool_input", {})
if tool == "Bash":
text = args.get("command", "")
elif tool in ("Write", "Edit") and args.get("file_path", "").endswith(("mcp.json", ".claude.json")):
text = args.get("content", "") + args.get("new_string", "")
else:
sys.exit(0)
candidates = set(re.findall(r"@[\w.-]+/[\w.-]+", text))
candidates |= set(re.findall(r"\bnpx\s+(?:-\S+\s+)*([\w.][\w.-]*)", text))
for pkg in sorted(candidates):
note = subprocess.run(["npm", "view", pkg, "deprecated"],
capture_output=True, text=True, timeout=20).stdout.strip()
if note:
print(f"Blocked: {pkg} is deprecated on npm ({note}). "
"Use a maintained package; for MCP, the service owner's official server.", file=sys.stderr)
sys.exit(2)
sys.exit(0)
Register it in .claude/settings.json for a project, or in ~/.claude/settings.json for every project:
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash|Write|Edit",
"hooks": [
{ "type": "command", "command": "python3 ~/.claude/hooks/block_deprecated_mcp.py" }
]
}
]
}
}
I fed the hook four simulated tool calls. It blocked claude mcp add github -- npx -y @modelcontextprotocol/server-github, blocked a config write that added the archived Puppeteer server, blocked an edit to ~/.claude.json that added the archived Slack server, and let npx -y @modelcontextprotocol/server-filesystem . and ls -la through.
Know its limits before you rely on it:
- It fails open. If the registry is unreachable, the
timeoutraises and the hook exits with an error code other than 2, which Claude Code does not treat as a block. Wrap the call and exit 2 on failure if you prefer fail-closed. - It only sees agent tool calls. A command a person types in their own terminal never passes through the hook. That is what Step 1 is for.
- It covers npm only. Servers launched with
uvx,pipor Docker need their own registry check. - Deprecation is a weak signal. A maintained package can still be vulnerable, and a package can be abandoned without being marked deprecated. The hook removes the known-bad case. It does not prove the rest is safe.
Step 3: approve one server per service
Glow and CSA converge on the same policy: pick one approved MCP server for each service, prefer the server published by the service owner, and add npm deprecation status to the approval criteria. For GitHub that means GitHub's own github-mcp-server rather than the archived reference implementation the agent remembers.
Once the list exists, the hook can enforce it as an allowlist instead of a denylist. That is the stronger design: the agent can propose anything, and the harness only executes what someone approved. The model's training cutoff stops being a supply chain dependency you never chose.
What this does not fix
Three of the four reported flaws have not been described publicly, so you cannot test for them directly. Removing the archived servers is the only complete answer for those. And any machine you do not scan keeps whatever its agent installed last year. Treat the inventory as a recurring job, not a one-time cleanup.
Sources
- Glow Labs, "MCPhantom: AI coding agents are installing vulnerable deprecated MCP servers from training data", November 2, 2026.
- Cloud Security Alliance Labs, "MCPhantom: Model Knowledge as an Unpatchable Software Supply Chain", November 10, 2026.
- Help Net Security, "AI coding agents are installing MCP servers that will never be patched", November 3, 2026.
- npm registry deprecation fields for
@modelcontextprotocol/server-github,server-puppeteer,server-postgres,server-slackandserver-brave-search, queried December 1, 2026.