By Ayena TCHIKPE, founder and software engineer Published
In this article
In short
- Keep one approved MCP server per service, ideally the service owner's, and enforce the list by exact command or URL, never by server name.
- Reject any server npm marks as deprecated. Agents still install archived servers from memory, and nobody will patch them.
- Read the install scripts and tool descriptions before approval, then pin the exact version you read. A new version is a new review.
- Give each server its own narrow, short-lived token. A server holding broad tokens turns one bug into a breach.
Your developers' coding agents add MCP servers on their own, often taking the package name from memory instead of from a list anyone approved. Each server runs with the developer's access, so one archived or hostile server can read secrets or act on your systems. This article gives you an MCP server security procedure you can run this week: an approved list, six checks per server and a table to approve, sandbox or reject.
Why AI agents install deprecated MCP servers
On 3 November 2026, Help Net Security reported a Glow Labs review of real coding-agent session transcripts. In 98% of the sessions where an agent set up a deprecated MCP server, the agent appears to have taken the name from its training data; in the other 2%, the user asked for it. Glow saw it in Claude Code, Cursor and Codex CLI, with models from Anthropic, OpenAI and xAI. Glow, which sells a product for this, gives no session count. In its GitHub example, the agent picked the archived reference server over GitHub's own maintained one.
Those reference servers, GitHub, Slack, PostgreSQL and Puppeteer among them, were archived in May 2025, and the repository notice says: "No security updates or bug fixes will be provided." Glow found four high-severity vulnerabilities in them; through the Puppeteer one, a prompt injection can make the agent start any process on the machine. According to Help Net Security, the deprecated packages Glow counted were downloaded from npm more than 17.3 million times since July 2025, and in one session the agent got "This package is deprecated" back from npm and installed it anyway, without telling the user. Dependency scanners miss them: an npx-launched server sits in no manifest, and these flaws have no CVE, Glow notes.
"The model's memory is now a package manager with no deprecation feed," Ophir Arie, Glow's VP of R&D, quoted by Help Net Security.
MCP server security: unknown publishers, poisoned tools, broad tokens
On 23 November 2026, OX Security, which also sells products in this area, published "Plug and Pray", an analysis of 542,207 components across npm, PyPI, MCP servers and Agent Skills, run from July to October 2026. On MCP servers:
- Prompt injection or tool poisoning appeared in 22% of flagged MCP servers, and install- or import-time code execution in 16%.
- Of 834 flagged MCP servers, 67% ran on publisher-controlled infrastructure the researchers could not verify, and 16% served files that differed from what the publisher declared.
- OX identified a source owner for 69.8% of MCP servers, against 92.8% of npm packages.
- 82% of researcher-confirmed malicious components were malicious in their first observed version. Vet before the first install.
"The agent already has the permissions it needs. Attackers just have to convince it to use them," says Moshe Siman Tov Bustan, OX's research lead.
A known publisher can still be the breach. In its 25 November 2026 post-mortem, the web host Mittwald explains that an attacker entered through its own MCP server, whose SSH-key tool put caller-supplied text into a shell command. The attacker acted in 56 customer projects, and the server held the valid tokens of all active users. Mittwald says it built the server largely with AI coding agents.
The MCP server allowlist: one approved server per service
Glow and Help Net Security recommend approving one MCP server per service, preferably the service owner's. We add one rule: enforce the list where the agent cannot edit it.
In Claude Code, put allowedMcpServers with allowManagedMcpServersOnly: true in managed settings. Entries match a remote server by URL and a local server by its exact command, every argument in order. Write the exact version into the command and the allowlist enforces your pin too:
{
"allowManagedMcpServersOnly": true,
"allowedMcpServers": [
{ "serverUrl": "https://api.githubcopilot.com/*" },
{ "serverCommand": ["npx", "-y", "@your-org/your-mcp-server@1.2.3"] }
]
}
Anthropic's docs warn that a serverName entry "is not a security control", since anyone can name any server github. GitHub says its Copilot registry policy, which matches names, "can be bypassed by editing configuration files", and points to managed-settings.json instead. Whatever your agent, check that its list matches commands or URLs.
An allowlist covers configured servers, yet an agent can still run npx in a shell. Add a pre-execution hook, which Help Net Security notes many harnesses support, that blocks any server install not on your list; item 9 of our guardrails checklist shows how.
How to vet MCP servers: six checks before approval
- Deprecation. Run
npm view <package> deprecated. Any output means reject: Glow notes npx still installs a deprecated package "with nothing more than a warning". On 1 December 2026, the registry returned "Archived and unmaintained; no security guarantees" for@modelcontextprotocol/server-puppeteer. - Publisher and source. Name who publishes the package and open the repository it links to. Prefer the service owner's server, and npm packages with provenance, which records where a package was built and who published it. No identifiable owner: reject.
- Code run at install. Run
npm view <package> scriptsand look forpreinstall,installandpostinstall. npm's own docs: "You should almost never have to explicitly set a preinstall or install script." This check misses code run at import, but an install script nobody can explain means reject. - Tool descriptions. Read every tool description, in a sandbox. OX advises treating them as part of the attack surface, not as trusted documentation. Reject a description that gives the model orders: read a file, call another tool first, send data somewhere.
- One exact version. Approve the version you read. The specification says a server's tool list "MAY change over time", so an update is a new review.
- Token scope. Give each server its own token, limited to what its tools need, read-only where possible, short-lived. The MCP security best practices list "wildcard or omnibus scopes" among common mistakes, and Mittwald's rebuilt server will use narrower, shorter-lived tokens.
Approve, sandbox or reject: the decision table
| What the review found | Decision |
|---|---|
| Deprecated, archived, or a second server for a covered service | Reject |
| No identifiable owner or source repository | Reject |
| Tool descriptions that give the model orders, or an unexplained install script | Reject |
| Known owner, but remote code you cannot read, or write access needed | Sandbox: own container, narrow token, human approval for writes |
| Service owner's server, exact version, clean scripts and descriptions, read-only token | Approve, then review each new version |
How we help
Our AI agent guardrails service builds the frame your coding agents work in: rules written in the repository, hooks that block dangerous commands, a sandbox. The MCP allowlist and the six checks above belong in that frame. aycod, our open-source guardrail, installs agent hooks for Claude Code, Codex CLI and Copilot CLI and refuses reads of secrets such as .env files. It does not vet MCP servers, so the checks above stay a human decision. Our reliability service adds security scans of secrets, code and dependencies on every change.
Send contact@aycode.dev the MCP servers in your team's agent configurations, and which agents you use. We will reply with the ones we would reject first.
Sources (as of 1 December 2026): Help Net Security (3 Nov 2026) · Glow Labs, MCPhantom · OX Security, Plug and Pray (23 Nov 2026) · Mittwald post-mortem (25 Nov 2026, German) · GitHub, servers-archived · npm registry, server-puppeteer · MCP, Security Best Practices · MCP, Tools · Claude Code, managed MCP · GitHub, MCP allowlist enforcement · npm view · npm scripts · npm provenance.
