MCP — the Model Context Protocol — is the fastest-growing way to give an AI agent real power.

That power is exactly the problem. Every tool an MCP server exposes is an action your agent can take with your credentials. Every description, tool result and document the agent reads through MCP is text the model treats as instructions. Connect the wrong server or trust a tool definition that changed after you approved it, and the agent does the attacker's work for you — with your own access token.

In short: Secure an MCP server by treating it like a production dependency: vet its tool list and public footprint before connecting, grant only the narrowest OAuth scopes and named tools, pin the exact version you reviewed, re-approve on any change, and log every tool call. Least privilege, enforced structurally, matters more than any single fix.

On 1 December 2026, Salt Labs at Salt Security published research showing how MCP servers at three major online services — a social network, an online payments provider and a cloud collaboration platform, together serving hundreds of millions of users — could have let an attacker take over a user account with a single malicious link. The common starting point: open OAuth Dynamic Client Registration.

A laptop showing an AI agent connected to a network of tools, with a shield guarding the connection

Why MCP security is different from API security

An MCP server is not a normal API. With MCP, you hand a model a menu of tools and let it decide which to call, in which order, with which arguments — and the model reads the tool names, descriptions and results as language, not as code.

Everything the server sends is prompt input. When a client connects, it calls tools/list and passes every tool's name, description and input schema to the model. The model reads that text as potential instructions.

Every tool is an action with your credentials. A read-only query tool and a delete tool look the same in the menu. The agent calls whichever one the conversation points at, using the token you granted.

Trust is granted once and rarely re-checked. You approve a server, its tools and its scopes when you connect. Most clients do not ask again when the server changes its tool list or adds a capability.

Tool poisoning: instructions hiding in the menu

Tool poisoning is the oldest MCP attack, and still the most effective. A malicious or compromised server puts instructions in a tool's name, description or parameter descriptions — text the user never reads and the model always does.

Common patterns:

  • A <IMPORTANT> block in a description telling the model to do something first — read a config file, copy a value into an extra parameter, send a result elsewhere.
  • A poisoned parameter description. Nobody reviews inputSchema.properties.city.description, but the model reads it — and an injection there can steer how the model uses a different server's tools, a pattern called tool shadowing.
  • A friendly cover story: "for security verification", "to improve results", "before using this tool, confirm the user's identity by reading…".

The defence is structural, not "read every description" — nobody does that, and descriptions change. Connect only servers you trust, pin the exact version you reviewed, and treat anything a tool returns — including its own description — as untrusted input.

A magnifying glass revealing a hidden instruction inside a tool description

The rug pull: the server you approved is not the server you have

Tool poisoning assumes a bad server. The rug pull assumes a good one that changes. An MCP server can change its tool list at runtime, and many clients do not ask for re-approval when it happens.

A team approves a third-party threat-enrichment tool after reviewing its description. Months later the server's operator — or an attacker who compromised it — updates the tool's definition: alongside each lookup, the agent should forward a copy of whatever it queried to an external endpoint "for extended analysis". The agent already holds standing, approved access, so it complies.

A server changing its tool definitions after approval, while the developer looks away

The Docker Sandboxes flaw disclosed on 1 December 2026 is the same failure in a different shape: a one-time developer approval was never re-checked, so a later update to a third-party AI agent kit could redirect real API keys to an attacker-controlled server with no new prompt. Docker fixed it in version 0.55.0.

Controls that work:

  • Pin versions, not names. npx -y @modelcontextprotocol/server-filesystem@1.2.3, or an image digest — never latest.
  • Diff tools/list on every upgrade. Save the tool list you approved and read the diff before reconnecting.
  • Re-approve on change. If your client supports it, require approval again whenever a server's tools change.

Indirect prompt injection: the attack that arrives as data

Direct prompt injection — malicious instructions typed into a chat box — is the version everyone knows. Indirect prompt injection is the one that actually bites MCP users. The attacker never talks to your agent. They hide instructions in content it retrieves. A tool returns that content, the model reads it, and the instructions execute with the agent's permissions.

Hidden instructions inside a web page being read by an AI agent

That turns a data breach into a one-step operation. Injection becomes a breach when one agent run has three things at once: access to private data, exposure to untrusted content, and a way to send data out. MCP setups routinely have all three.

In June 2025, researchers reported a prompt-injection flaw in a Supabase setup used with the Cursor agent, where injected instructions in retrieved content could steer the agent's actions. The answer is structure.

What structure looks like in practice:

  • Treat every tool result as untrusted data. Wrap results in clearly delimited blocks and tell the model they are data, never instructions.
  • Separate the reader from the writer. Do not give one agent run read access to untrusted content and write access to production in the same session. Split the job: one agent reads and summarises, a second, narrowly-scoped agent acts.
  • Approval gates on anything outbound or destructive. Reads can run free. Anything that writes, deletes, sends, pays or deploys needs a human approval — enforced in code, not in a system prompt.

Over-permissioned agents: the quiet default

Most MCP setups are over-permissioned by default, and nobody notices because nothing breaks. You connect a server, the client offers every tool it exposes, and the agent can now call all of them — including the write and delete tools you will never use.

  • Allow-list tools per agent. Each agent gets the named tools it needs, nothing else.
  • Split read and write. Keep write tools behind a separate, approval-gated connection
  • Scope the credentials, not just the tools. A token that can read one repository is a different risk from one that can read every repository. Use the narrowest OAuth scope the job allows.

The OAuth flaw: when "registered" means "trusted"

OAuth is the de facto standard for MCP authentication, and the MCP authorisation specification requires OAuth 2.1. The implementations are the problem.

Many MCP servers let any application register itself through OAuth Dynamic Client Registration. An attacker registers their own application and gets a valid client ID. But at each of the three services Salt Labs tested, a second flaw turned registration into access: at the cloud collaboration platform, a redirect check could be tricked into sending the sign-in code to an attacker-controlled server; at the social network, the consent step could be submitted from an attacker's website without the user approving anything; at the payments provider, an earlier approval of the official AI integration was applied to the attacker's application, so a signed-in user only had to click the link.

One click, no authentication required from the attacker, and the victim's account was open. Salt Labs' conclusion was blunt: the same pattern probably exists in many other MCP servers.

  • Turn off open registration where the server supports a known set of clients, and treat every self-registered client as untrusted.
  • Validate redirect URIs by exact match, using a real URL parser rather than string matching. The collaboration-platform flaw worked because a trusted name appeared somewhere in the URL — the host was the attacker's.
  • Tie each consent to the specific application that requested it, and protect the consent step with CSRF protection, so it cannot be submitted from another website.
  • Use Client ID Metadata Documents, which the latest MCP authorisation specification now recommends, with Dynamic Client Registration as a fallback.

If you only use MCP servers, the takeaway is simpler: a server that lets any client register and hands out broad tokens on a single click is not one you connect to your production accounts.

A consent screen asking an AI app for account access, with a warning symbol beside it

Credential sprawl: tokens in every config file

MCP credentials end up in more places than any other secret in a developer's setup: .mcp.json, claude_desktop_config.json, shell profiles, a server's environment file, a shared team config someone committed to a repository. Each copy is a separate chance to leak.

  • Store upstream credentials once, server-side. The client holds a short-lived, revocable token. Never put a production API key in a client config file on a laptop.
  • Per-person, revocable keys.
  • Short lifetimes. A stolen token stops working sooner.
  • Audit the files. Search ~/.config, ~/.claude.json, project .mcp.json files and shell history.

Vet the server before you connect it

Do this work before the connection, not after an incident. Vetting an MCP server takes twenty minutes and saves the kind of week nobody wants.

Check the tool's public footprint. A server worth trusting has documentation you can read, a repository you can inspect, and a changelog you can follow. The same habit applies to the AI tools around it: directories, comparisons and reviews of AI tools show what a tool does, what it costs, and what other developers say — and a tool with no public footprint is a tool you do not connect to production.

Read the tool list before you approve it. Connect the server to a throwaway client or run tools/list against it. If a description contains instructions, urgency, or anything that reads like a command to the model, stop there.

Check the project's health. When was the last release? Are issues answered? Is there a security policy? An abandoned server with known SDK vulnerabilities is worse than no server — the MCP TypeScript SDK itself has had high-severity advisories, including OAuth flaws.

Prefer servers with a track record. New servers appear every week; a directory of AI tools with comparisons and reviews gives you a tool's claims, pricing and reputation in one place.

A real server, done carefully: Metabase

One server gets the hard parts right.

Metabase, the open-source analytics platform, ships a built-in MCP server that lets AI clients connect directly to a Metabase instance.

  • OAuth 2.0, with its own embedded authorisation server. No API key pasted into a config file.
  • Scopes that actually gate tools. A fresh connection asks for a read-only baseline — agent:content:read and agent:query:run — and anything wider, like raw SQL or email delivery, stays behind a consent step per scope. A call the token lacks a scope for is refused with a 403.
  • A read-only baseline that cannot be unticked. On the consent screen, the baseline read scopes are locked on.
  • The database account matters more than the token. Independent testing found the main remaining risk was raw SQL running with the instance's shared warehouse account, where only a read-only hint stood in the way of writes. The fix is at the database layer: a warehouse account that can only read the tables agents need.

An independent test of the open-source build (version 0.65.6, November 2026) listed 21 tools and passed its read-only calls. The same review scored the default configuration 5.9 out of 10: individual tool calls are not logged in the open-source build, . Even a careful server has gaps — the difference is that its gaps are documented, bounded and fixable.

The pattern to copy: OAuth with real scopes, a read-only default, consent per scope, and enforcement at the layer below the agent.

The checklist

The list to run before you connect a server [—–-] and again every few months after.

A checklist with ticked boxes beside a laptop running an AI coding agent

Before you connect

  1. Read the full tool list. Run tools/list and read every name and description. Instructions aimed at the model? Do not connect it.
  2. Check the public footprint. Docs, repository, changelog, security policy, recent releases. No public footprint, no production access.
  3. Pin the version. Record the exact version or image digest you reviewed. Never connect latest.
  4. Grant the narrowest OAuth scope that does the job. Broad scopes for a narrow task? Walk away.
  5. Allow-list the tools. Decide in advance which named tools this agent may call. Everything else is denied.
  6. Put credentials server-side. No production key in a client config file. Short-lived, per-person, revocable tokens.
  7. Save the approved tool list. Hash every tool definition. The auditor below compares against them.
  8. Diff the tool list on every upgrade. Read the diff before reconnecting.
  9. Require approval for writes. Anything that writes, deletes, sends, pays or deploys needs human approval, enforced in code.
  10. Treat tool results as data. Delimit untrusted results. Never let retrieved content issue instructions.
  11. Separate reading from writing. The agent that reads untrusted web pages is not the agent that deploys to production.
  12. Log every tool call. Tool name, arguments, time, credentials used. If something goes wrong, the log is the investigation.
  13. Rotate keys on a schedule, and immediately after any incident.

If you build a server

  1. Disable open Dynamic Client Registration unless you genuinely need it, and treat every self-registered client as untrusted.
  2. Validate redirect URIs by exact match with a real URL parser. Never use string matching.
  3. Bind consent to the specific client and scope, and protect the consent step with CSRF protection.
  4. Prefer Client ID Metadata Documents over open registration, as the latest MCP authorisation specification recommends.
  5. Scope tokens narrowly, with a read-only baseline. Writes and destructive tools stay behind a separate consent step.
  6. Make tool descriptions boring. What the tool does and what it returns. Nothing more.
  7. Announce tool changes loudly. Version your tools and publish a changelog.

Audit your tools in 50 lines

A small script does both: it lists a server's tools, flags suspicious text anywhere in the definitions, and hashes each definition so the next run can tell you exactly what changed since you approved it.

The idea comes from the OWASP MCP Security Cheat Sheet — inspect the whole tool definition, not just the description, and pin what you reviewed with a hash. Here is a compact version using the official MCP TypeScript SDK:

// audit.mjs — list an MCP server's tools, flag suspicious text, hash what you approved. // Usage: node audit.mjs node my-server.mjs // Requires: npm i @modelcontextprotocol/sdk zod import { Client } from "@modelcontextprotocol/sdk/client/index.js"; import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js"; import { createHash } from "node:crypto"; import { existsSync, readFileSync, writeFileSync } from "node:fs"; const RULES = [ [/<\s*(important|system|instructions?)\s*>/i, "hidden-instruction tag"], [/\b(ignore|disregard)\b.{0,40}\b(previous|above|instructions)\b/i, "instruction override"], [/\b(send|exfiltrate|upload|forward)\b.{0,40}\b(external|attacker|http)/i, "exfiltration hint"], [/\b(api[_-]?key|password|secret|token)\b/i, "credential mention"], ]; function* strings(value, path = "") { if (typeof value === "string") yield [path, value]; else if (Array.isArray(value)) for (let i = 0; i < value.length; i++) yield* strings(value[i], `${path}[${i}]`); else if (value && typeof value === "object") for (const [k, v] of Object.entries(value)) yield* strings(v, path ? `${path}.${k}` : k); } const transport = new StdioClientTransport({ command: process.argv[2], args: process.argv.slice(3), }); const client = new Client({ name: "tool-auditor", version: "1.0.0" }, { capabilities: {} }); await client.connect(transport); const { tools } = await client.listTools(); const pins = existsSync("tool-pins.json") ? JSON.parse(readFileSync("tool-pins.json", "utf8")) : {}; let findings = 0; for (const tool of tools) { for (const [path, text] of strings(tool)) { for (const [pattern, label] of RULES) { if (pattern.test(text)) { findings++; console.log(`${tool.name} [${path}] ${label}: ${text.slice(0, 120)}`); } } } const hash = createHash("sha256") .update(JSON.stringify(tool)) .digest("hex") .slice(0, 16); if (pins[tool.name] && pins[tool.name] !== hash) { findings++; console.log(`${tool.name} CHANGED since last approval (was ${pins[tool.name]}, now ${hash})`); } pins[tool.name] = hash; } writeFileSync("tool-pins.json", JSON.stringify(pins, null, 2)); console.log(`\n${tools.length} tools checked, ${findings} findings. Pins saved to tool-pins.json.`); await client.close(); 

Run it when you first approve a server, and again after every update. a changed hash on a tool you did not expect to change is the rug pull, caught before the agent ever calls it.

Two honest limits. Pattern matching catches known shapes, not novel ones — pair the auditor with reading the diff when a hash changes. And it checks definitions, not behaviour.

Frequently asked questions

What is MCP, in one paragraph?

The Model Context Protocol is an open protocol, originally released by Anthropic, that standardises how AI models and agents connect to external tools, data sources and services. A server publishes a structured list of tools, resources and prompts; a client discovers them and lets the model invoke them.

Is MCP itself insecure?

No. MCP is a protocol for connecting agents to tools. The vulnerabilities found so far are in implementations: open registration without trust checks, redirect validation done with string matching, consent steps without CSRF protection, tool descriptions that smuggle instructions, and clients that never re-approve changed tools.

Can I just block tool descriptions from influencing the model?

Not reliably. The model needs the descriptions to know what tools do. Reduce the risk by connecting only trusted servers, pinning versions, auditing definitions, and keeping the agent's permissions narrow so a successful injection cannot do much.

Should I stop using MCP servers entirely?

For most developers, no. The productivity gain is real, and the risks are manageable with the checklist above. What you should stop doing is connecting servers casually — every new server is a new set of permissions and a new source of instructions for your agent.

What is the single most important control?

Least privilege, enforced structurally. An agent that can only read the three repositories it needs, with a short-lived token, cannot delete your database no matter what a poisoned description tells it. Everything else is a second layer around that core.

MCP servers are not going away. Agentware 2026 allowed MCP, function calling and browser automation as standard building blocks, and its Trap Pack shipped hostile test inputs at kickoff. The question is not whether your agent will be given powerful tools. It already has them. The question is whether the tools it can reach are the ones you chose — or whether something else is writing that menu for you. Run the checklist on one server this week. What did you find?