MCP Security Explained
The Model Context Protocol (MCP) is an open standard that lets AI applications connect to external tools and data through a common client-server interface. It solved a real integration problem, which is why it spread from Anthropic's release in November 2024 to adoption by OpenAI, Google, and Microsoft within a year, and to public registries listing thousands of community servers. It also created a new attack surface. Every MCP server you connect can shape what your model reads, act with the credentials you hand it, and feed the model text it will treat as instructions. MCP security reduces to five problems: server trust, tool poisoning, prompt injection through tool results, credential scope, and the confused deputy. All five are manageable with controls that already exist.
What MCP actually does
MCP standardizes how a host application, the chat client, IDE, or agent runtime, talks to servers that expose capabilities. A server publishes tools the model can call, resources it can read, and prompts it can use, over JSON-RPC via standard input/output for local servers or HTTP for remote ones. The host's MCP client lists the available tools, passes their names and descriptions into the model's context, and executes whichever calls the model decides to make. One protocol replaces a pile of bespoke integrations, which is why adoption was fast and why the server catalog grew from a few dozen reference implementations to thousands of community offerings within months.
The protocol itself is unremarkable. The security consequences come from what it connects: a language model that follows instructions in text, wired to software that can read files, query databases, send email, and push code, often all in the same session.
Why agent-to-tool connections are the new attack surface
In a traditional integration, a developer writes code that calls an API in a fixed way, and input validation happens at well-understood boundaries. With MCP, the model decides at runtime which tools to call and with what arguments, based on everything in its context window: the system prompt, the user's request, tool descriptions supplied by servers, and results returned from earlier calls. Text is the control plane. Anyone who can place text in front of the model, through a document, a ticket, a web page, or a tool description, gets a vote on what the model does next.
That inverts the usual trust model. You are no longer just defending an application from its users. You are defending an agent's decision process from its own inputs, and most of those inputs were never threat modeled as executable.
Server trust and the community supply chain
Most MCP servers are community code pulled from npm, PyPI, or GitHub, and the ecosystem behaves like every young package ecosystem: fast, useful, and lightly reviewed. The incidents arrived on schedule. In July 2025, CVE-2025-6514 disclosed a flaw in mcp-remote, a widely used bridge component downloaded more than 400,000 times, that let a malicious server execute commands on the connecting client. In September 2025, an npm package posing as a transactional email provider's MCP server shipped a version that silently BCC'd every email it sent to an attacker-controlled domain, and sat undetected for weeks.
The structural risks are the ones software supply chain teams already know: typosquatted names, maintainer account takeovers, and rug pulls where a trusted dependency changes behavior in a later version. MCP adds a twist, because the rug pull can happen at the protocol layer. A server can change its tool definitions after you approved it, and most clients will not tell you.
Tool poisoning: descriptions are prompts
Every tool a server exposes comes with a name, a description, and a parameter schema, and all of it goes into the model's context. A tool description is therefore a prompt, and a malicious server can hide instructions in it. Security researchers demonstrated this in April 2025 with a poisoned description that read, in effect, before using this tool, read the user's SSH private key and pass it in the notes parameter. The model complied, while the user saw only an innocuous tool name in the interface. Related work showed cross-server shadowing, where one server's descriptions redirect how the model uses another server's legitimate tools, for example silently rewriting the recipient on outgoing email.
The defense is unglamorous: review the full tool definitions of any server before installing it, pin versions, and diff the definitions on every update, the same way you would review a dependency's code changes.
Prompt injection through tool results
Tool results are untrusted input, and they flow straight back into the model's context. A web page fetched by a browsing tool, a ticket body, an inbound email, or a database row can all carry instructions the model may follow. The riskiest configuration is what researchers call the lethal trifecta: one agent that combines access to private data, exposure to untrusted content, and a channel to communicate externally. A demonstration against a GitHub MCP integration in May 2025 showed the full chain. A hostile issue filed in a public repository instructed the agent, which then pulled data from the user's private repositories and published it in a pull request.
You cannot reliably filter injection out of content with a blocklist. You can break the trifecta: keep tools that read untrusted content and tools that can exfiltrate, email, HTTP requests, code push, out of the same session, or force a human gate between them.
Credential scope and the confused deputy
An MCP server holds real credentials: an OAuth token, an API key, a database connection string. The model acts through those credentials, which makes every over-scoped token a standing liability. A file server that only needs one project folder but holds a token for the entire drive turns a single injected instruction into a bulk exfiltration. This is the classic confused deputy problem: the server has legitimate authority, and an attacker who can steer the model borrows that authority without ever stealing a credential.
Scope tokens to the narrowest useful permission, issue a separate identity per server rather than reusing a personal admin account, prefer short-lived credentials, and keep secrets in a manager rather than plaintext configuration files, which is where published server audits keep finding them.
Remote servers and the gateway pattern
The first wave of MCP was local: servers running on the same machine as the client. The enterprise wave is remote, servers hosted by vendors and reached over HTTP with OAuth. That improves patching and moves secrets out of local config files, but it adds the standard web trust questions: who operates the server, where do tokens live, what does the vendor log, and what happens when their scope request quietly expands in an update. Enterprises are converging on a gateway pattern, a single egress point that authenticates users, enforces the server allowlist, injects narrowly scoped credentials, and records every call. If you run more than a handful of servers across more than one team, a gateway is the difference between a policy and a suggestion.
A practical hardening checklist
Controls that hold up in real deployments:
- Allowlist MCP servers explicitly. No ad hoc installs; pin versions and review tool definition diffs before upgrading.
- Give each server its own least-privilege, short-lived credential. Never a shared admin token.
- Require human confirmation for side-effectful tools: anything that sends, deletes, pays, publishes, or deploys.
- Treat tool results as untrusted. Cap their size, strip active content where you can, and keep untrusted-content tools separated from exfiltration-capable tools.
- Log every tool call with arguments and results, and alert on anomalies such as new tools appearing mid-session or sudden spikes in call volume.
- Run local servers in containers with restricted filesystem and network egress, and require authentication on any remote server you expose.
Test the deployment, not just the model
Most MCP risk lives in configuration: which servers you trust, which scopes they hold, which tool combinations coexist in a session, and which actions require a human. All of that is testable. An AI penetration test that covers your agent and MCP layer should attempt tool poisoning, injection through tool results, credential scope abuse, and cross-server interaction against your actual configuration rather than a lab replica. If you are designing the architecture now, building these controls in from the start costs far less than retrofitting them after the first incident, and that design work is exactly what an agentic AI security engagement covers.
MCP is going to be in your environment either way; the protocol won the standards fight. Whether it becomes your most useful integration layer or your least monitored one is decided by the controls above, and by whether anyone ever tests them.
