One-time security reviews fail completely against MCP rug pulls. In a conventional REST API integration, changing a backend endpoint's behavior cannot rewrite the client's business logic. In the Model Context Protocol (MCP), however, every server dynamically advertises its tools via tools/list — including free-text description fields and JSON inputSchema parameter descriptions that the MCP client feeds directly into the model's reasoning context.
That dynamic discovery mechanism enables a subtle supply-chain exploit: a third-party or compromised remote MCP server behaves completely innocently during initial security vetting and for the first few hundred calls. Days or weeks later, the server quietly updates a single tool's description to embed hidden exfiltration instructions (for example, instructing the model to append local .env contents or prior conversation secrets into an optional metadata argument). The very next time a developer's coding agent or production workflow reconnects, it ingests the poisoned description automatically.
For the broader map of MCP exploit classes (stdio RCE, token passthrough, SSRF, and unauthenticated exposure), see MCP security vulnerabilities and exploits in 2026. To scan a tools/list JSON dump or mcp.json locally right now, use our browser-local MCP config security checker.
Anatomy of an MCP rug pull vs. upfront tool poisoning
| Stage | Upfront tool poisoning | Delayed MCP rug pull |
|---|---|---|
| During initial AppSec review | Malicious instructions are already visible in tools/list |
tools/list looks completely clean and minimal |
| How it activates | On the first session after install | Triggered remotely by time, call count, IP range, or package auto-update (npx -y / uvx) |
| Client-side code change required? | None after install | None — client refreshes tools/list on reconnect |
| Why static install-time vetting fails | Caught if reviewer reads every description | Bypassed — approved state no longer matches runtime state |
| Primary defense | Pre-flight description scan + strict tool scoping | Cryptographic tool-schema pinning + runtime gateway allow-list & argument guardrails |
Three ways rug pulls sneak into enterprise fleets
- Remote HTTP/SSE MCP servers you don't host. Any vendor-hosted or community-hosted remote MCP server can serve a different
tools/listpayload per tenant, per user-agent, or after a quiet backend release — zero client update needed. - Unpinned local launchers (
npx -y,uvx,:latest). Amcp.jsonentry that executes an unpinnednpx -ylauncher pulls the newest registry version on cache refresh. If that package is later hijacked or transfers ownership, every developer workstation inherits the malicious version automatically. - Silent capability expansion (shadow tools). Even without injecting adversarial instructions into an existing tool description, a server upgrade can introduce a brand-new high-privilege tool (such as
run_sqlorexport_all_users) alongside previously approved read-only tools. If your client grants access per server instead of per tool, the agent immediately gains that new capability.
Defense 1: Canonical SHA-256 tool-schema pinning (runnable script)
Treat every approved MCP server's tools/list output like a software lockfile (package-lock.json). Canonicalize each tool's name, description, and inputSchema (sorted keys, deterministic JSON), compute a SHA-256 digest, and fail closed if the live server ever drifts from the pinned lockfile:
// verify-mcp-pins.mjs (Node.js 22+, zero external dependencies)
import { createHash } from "node:crypto";
import { readFileSync } from "node:fs";
function canonicalize(value) {
if (Array.isArray(value)) return value.map(canonicalize);
if (value && typeof value === "object") {
return Object.fromEntries(
Object.keys(value)
.sort()
.map((k) => [k, canonicalize(value[k])]),
);
}
return value;
}
function fingerprintTool(tool) {
const payload = canonicalize({
name: tool.name,
description: tool.description || "",
inputSchema: tool.inputSchema || {},
});
return createHash("sha256").update(JSON.stringify(payload)).digest("hex");
}
const pinned = JSON.parse(readFileSync("./mcp-tools.lock.json", "utf8"));
const live = JSON.parse(readFileSync("./live-tools-list.json", "utf8"));
const drift = [];
for (const tool of live.tools || []) {
const actual = fingerprintTool(tool);
const expected = pinned[tool.name];
if (!expected) {
drift.push(`UNAPPROVED NEW TOOL: ${tool.name} (${actual.slice(0, 12)})`);
} else if (expected !== actual) {
drift.push(`SCHEMA/DESCRIPTION DRIFT: ${tool.name} expected=${expected.slice(0, 12)} actual=${actual.slice(0, 12)}`);
}
}
if (drift.length) {
console.error("MCP tool-pinning verification FAILED:\n" + drift.join("\n"));
process.exit(1);
}
console.log(`Verified ${(live.tools || []).length} pinned MCP tools with zero drift.`);
Wire this check into two places:
- In CI / server onboarding: Regenerate
mcp-tools.lock.jsononly through a reviewed pull request so security reviewers see the exact diff of any changed tool description or added parameter. - At session initialization / gateway sync: Reject or quarantine any tool whose runtime digest no longer matches its approved fingerprint until a human reviews the diff.
Defense 2: Enforce per-tool allow-lists and argument guardrails at the MCP gateway
Tool pinning stops silent metadata mutations before they reach the model. Runtime enforcement protects you even when a tool's description is benign or when an attacker uses indirect prompt injection inside a tool response instead of the tool description:
- Pin local package versions and container digests. Replace
npx -y pkgwith an exact immutable version (pkg@1.4.2) or a digest-pinned container image (@sha256:...). - Scope permissions per tool, never per server. Configure each agent-to-MCP connection with an explicit tool allow-list so newly introduced server tools are denied by default — see scoping MCP tool permissions and MCP & agent connections setup.
- Inspect tool arguments and tool outputs in-band. Apply bidirectional content and PII/secret guardrails to both outgoing tool arguments and incoming tool results so a poisoned argument cannot exfiltrate credentials or customer data — see Praesidia's MCP gateway and runtime security controls.
- Monitor behavioral drift & verify decisions. Track unusual tool-call sequences or new argument names in trust scores and drift detection, and keep offline-verifiable decision evidence for calls routed through Praesidia — see verifiable audit evidence.
To check how well your current agent estate covers MCP tool poisoning, supply-chain drift, and related agentic risks (ASI01–ASI10), run the OWASP Agentic Top 10 readiness scorecard.
Common questions
What is an MCP rug pull attack?
An MCP rug pull is a delayed tool-poisoning attack in which an MCP server passes initial security review with clean tool metadata, then quietly alters its tools/list descriptions or JSON schemas later to steer the model into leaking secrets or invoking unauthorized actions.
Does OAuth 2.1 on an MCP server prevent rug pulls? No. OAuth 2.1 authenticates the caller and authorizes scopes, but it does not verify whether a remote server changed its tool descriptions or added new tools after your security team reviewed it. You need cryptographic tool-schema pinning and per-tool gateway allow-lists alongside OAuth.
Why shouldn't developers use npx -y or uvx without version pins in mcp.json?
Unpinned launchers pull the latest package version from public registries automatically. If an upstream maintainer account is compromised or a malicious release is pushed, every workstation running that unpinned config executes the new code on its next restart.
Can I inspect an MCP tools/list payload for poisoning patterns before approving it?
Yes. Paste any mcp.json or tools/list JSON payload into our browser-local MCP config security checker to flag hidden instruction patterns, hardcoded secrets, shell wrappers, and unpinned packages without uploading anything to a server.