A developer connects an AI assistant to the company's code repositories, ticketing system and a database in an afternoon. Each connection is a Model Context Protocol server. Each one hands a model new tools, new data and, very often, a credential. Often, none of them goes through the review a new integration or a new employee would.
MCP security is the discipline of controlling what AI models can reach and do through those servers: which servers are trusted, what each tool is allowed to do, which tokens it holds and what leaves the environment. The protocol standardises the connection. It does not decide whether the connection is safe.
That decision sits with security teams. Poisoned tool descriptions, injected tool outputs, impersonating packages and command-execution flaws have all been documented in the MCP ecosystem.
This guide explains what MCP is, the main risks with sourced examples, how MCP compares with an API, and a risk-to-control map for every MCP connection.
Table of contents
- What MCP is and why it changes the attack surface
- The main MCP security risks
- Documented MCP vulnerabilities and incidents
- Is MCP more secure than an API?
- MCP security best practices: a risk-to-control map
- Treat every MCP connection as a machine identity
- What to do now
- Frequently asked questions
Key takeaways
- The Model Context Protocol, open-sourced by Anthropic in November 2024 and now part of the Linux Foundation's Agentic AI Foundation, standardises how AI applications connect to tools and data.
- The MCP specification states that tools represent arbitrary code execution and that tool descriptions should be treated as untrusted unless they come from a trusted server.
- Authorization is optional in the MCP specification, and the protocol itself cannot enforce its own security principles; implementers must.
- Documented MCP vulnerabilities include tool poisoning, prompt injection through tool outputs, a malicious impersonating server package and a critical command-injection flaw (CVE-2025-6514, CVSS 9.6).
- MCP security comes down to three controls: scoped identity for every connection, policy enforced at a control point, and actions logged and blockable in seconds.
What MCP is and why it changes the attack surface
Anthropic open-sourced the Model Context Protocol on 25 November 2024 as a standard for connecting AI assistants to the systems where data lives. In December 2025 it donated the protocol to the Linux Foundation's new Agentic AI Foundation, reporting more than 10,000 active public MCP servers by then. The current specification revision is dated 28 July 2026.
The MCP specification defines three roles. Hosts are the LLM applications that start connections. Clients are connectors inside the host. Servers expose capabilities: resources (data), prompts (templates) and tools (functions the model can execute).
Tools are what move the attack surface. With MCP, a model selects tools and passes them arguments, and those tools read files, query systems and call APIs with real credentials. The specification is candid about it: "Tools represent arbitrary code execution and must be treated with appropriate caution." It adds that descriptions of tool behaviour "should be considered untrusted, unless obtained from a trusted server."
Two further details matter to a reviewer. Authorization is optional in the specification, and servers on the local STDIO transport retrieve credentials from the environment instead of using OAuth. And the specification states that MCP cannot enforce its security principles at the protocol level; implementers must build consent and access control into their applications.
Key Insight
MCP standardises how a model reaches your systems. It does not decide what the model should be allowed to do once it gets there. That decision is a security control, and someone has to own it.
The main MCP security risks
The official MCP Security Best Practices document lists protocol-level attacks; independent research adds the risks that come from the model itself.
Tool poisoning and rug pulls
A tool's description is read by the model as context. Invariant Labs showed in April 2025 that malicious instructions can be hidden in tool descriptions, invisible to the user but followed by the model. Their example tool claimed to add two numbers while instructing the model to read SSH keys and MCP configuration files. They also described "rug pulls", where a server changes a tool's description after the user has approved it, and "shadowing", where one malicious server alters how the agent uses tools from trusted servers.
Prompt injection through tool outputs
Tool results are untrusted content too. In May 2025, Invariant Labs disclosed a GitHub MCP attack in which a malicious issue in a public repository carried injected instructions. When a user asked their agent to look at that repository's issues, the agent read the payload, pulled data from the user's private repositories and leaked it through a pull request in the public one. The researchers stressed this was not a flaw in the GitHub MCP server code but an architectural issue at the agent level. Our guide to prompt injection attacks explains why models cannot reliably separate such instructions from data.
Confused deputy and token passthrough
The specification describes a confused deputy attack against MCP proxy servers that use a static OAuth client ID with a third-party API, letting an attacker obtain an authorization code without the user's consent. It also explicitly forbids "token passthrough", where a server accepts a token not issued for it and forwards it downstream. MCP servers must not accept tokens that were not issued for them.
Over-permissioned servers and broad scopes
When a server publishes every scope and a client requests them all, one stolen token carries wide reach. The best-practices document cites files:*, db:* and admin:*, warns of expanded blast radius and privilege chaining, and recommends minimal initial scopes with step-up elevation.
Malicious and impersonating server packages
MCP servers are software, distributed through the same package registries as everything else, and they inherit the same supply chain risks. The first malicious MCP server reported in the wild, covered below, impersonated a real email provider's name.
Exposed local servers and command execution
Local MCP servers run on the user's machine with the client's privileges. The specification warns that an attacker can plant a malicious startup command in a client configuration, ship a payload inside a server, or reach an insecure local server through DNS rebinding. Its verdict: attackers "can execute any command with MCP client privileges." It requires clients that support one-click server setup to show the exact command and obtain explicit consent before running it.
Server-side request forgery
During OAuth discovery, MCP clients fetch URLs supplied by the server. A malicious server can point them at internal addresses or cloud metadata endpoints such as 169.254.169.254. The specification recommends HTTPS-only URLs, blocking private IP ranges and an egress proxy.
Documented MCP vulnerabilities and incidents
These are disclosed cases, not hypotheticals. Dates are disclosure dates.
| Date | Case | Category | What it teaches |
|---|---|---|---|
| April 2025 | Tool poisoning proof of concept (Invariant Labs) | Malicious tool description | Tool metadata is untrusted input to the model |
| May 2025 | GitHub MCP prompt injection (Invariant Labs) | Injection through tool output | Correct server code can still be turned against the user |
| July 2025 | CVE-2025-6514 in mcp-remote, CVSS 9.6 | OS command injection from a malicious server | Connecting to an untrusted server is itself a risk |
| September 2025 | postmark-mcp impersonation package | Malicious server in a public registry | Supply chain controls apply to MCP servers |
| April 2026 | OX Security research on STDIO command execution in official SDKs | Unvalidated configuration | MCP configuration files are executable code |
The mcp-remote flaw, reported by JFrog, affected versions 0.0.5 to 0.1.15 of a proxy that lets LLM hosts which only support local servers talk to remote MCP servers. A malicious server could return a crafted authorization_endpoint URL that the tool passed to the operating system. JFrog demonstrated arbitrary command execution on Windows and execution of arbitrary binaries on macOS and Linux. It was fixed in version 0.1.16.
The postmark-mcp package was not published by Postmark, which said it had no involvement. The Hacker News reported that version 1.0.16, released on 17 September 2025, added a hidden BCC copying every email to an outside address, and that Koi Security, which found it, called it the first real-world malicious MCP server.
In April 2026, OX Security reported that the official MCP SDKs pass the configured STDIO command to the operating system without validation, so anyone able to alter an MCP configuration can run commands on the host. According to a Cloud Security Alliance research note, Anthropic characterised the behaviour as expected and left validation to developers.
Is MCP more secure than an API?
Neither is inherently more secure. MCP usually sits on top of APIs: an MCP server translates a model's tool call into API requests, often with the same credentials. What changes is who decides to make the call.
With a conventional integration, code calls an API in a fixed way. With MCP, a model chooses the tool and its arguments, and that choice can be influenced by anything in its context, including tool descriptions and outputs.
The protocol's own authorization has hardened. The 2026-07-28 revision requires clients to validate the issuer of authorization responses to block mix-up attacks, binds client credentials to the authorization server that issued them, and deprecates dynamic client registration in favour of Client ID Metadata Documents. These are real improvements. They secure the connection's credentials, not the model's judgement about how to use them.
MCP security best practices: a risk-to-control map
In May 2026 the NSA's Artificial Intelligence Security Center published a Cybersecurity Information Sheet, "Model Context Protocol (MCP): Security Design Considerations for AI-Driven Automation," warning that gaps in MCP design, implementation and operational posture have created significant and evolving security concerns. The map below pairs each risk with a defence drawn from the specification and the disclosed cases.
| Risk | Control | Where it is enforced |
|---|---|---|
| Tool poisoning and rug pulls | Allow-list approved servers, pin versions, review and hash tool descriptions, alert on change | Server registry and client configuration |
| Injection through tool outputs | Treat outputs as untrusted; limit each session to one trust domain; require approval for cross-boundary actions | Agent runtime and policy point |
| Confused deputy | Per-client consent before third-party authorization; exact redirect URI matching | MCP proxy server |
| Token passthrough | Validate token audience; never forward client tokens downstream | MCP server |
| Over-broad scopes | Minimal initial scopes, step-up elevation, short-lived tokens | Authorization server |
| Malicious packages | Approved-source policy, provenance checks, dependency scanning | Software supply chain |
| Local command execution | Show exact commands, sandbox local servers, restrict file system and network access | MCP client and endpoint |
| SSRF and exfiltration | Block private IP ranges, default-deny egress, inspect outbound traffic | Network egress |
| Undetected misuse | Log every tool call against the calling agent's identity; block anomalous behaviour automatically | Central control point |
Two principles run through the table. First, nothing a model reads from an MCP server is trusted by default: not descriptions, not outputs, not URLs. Second, the controls that hold are the ones outside the model, enforced on the connection.
Key Insight
Every MCP server is a new machine identity with a new set of permissions. If you would not give a contractor standing admin access on day one, do not give it to a tool your model found in a registry.
Treat every MCP connection as a machine identity
The practical shift is to stop treating MCP servers as plug-ins and treat each connection as a machine identity: distinct per agent and per server, scoped to the tools and data the task needs, with credentials that expire and can be revoked individually. Our piece on why every AI agent will need an identity sets out the accountability argument.
It also means routing those connections through a point that can see and stop them. Server logs alone are not enough, because a poisoned agent may use only legitimate tools. The useful signal is behavioural: an agent reading private repositories and then writing to a public one, a tool suddenly sending data to a new destination, a burst of calls no person would make. In the agent containment failures disclosed in 2026, the signal came from the network, not the model.
Finally, the response has to match the speed of the client. An agent can make hundreds of tool calls while an alert waits in a queue. Blocking has to be automatic, at the connection, within seconds.
What to do now
Start with an inventory of every MCP server in use, including the ones developers added to local IDE configurations. For each, record its source, version, the tools it exposes, the credentials it holds and what it can reach. Remove servers nobody owns, pin the rest to reviewed versions, and apply the minimal-scope and no-passthrough rules from the specification.
Then plan for the attacker you will actually face. Autonomous AI attacks run at machine speed against security tools built to alert a person, and an MCP-connected agent with broad credentials is an attractive, fast-moving target. Meanwhile, adversaries pursuing harvest now, decrypt later are recording the encrypted traffic these connections carry, to read once quantum computing matures. CNSA 2.0 requires new US national security system acquisitions to be compliant with its post-quantum algorithms from 1 January 2027.
Conux is the cybersecurity gateway every connection passes through, including each MCP connection between your models, agents and tools. At the gateway, Conux governs machine identities with scoped permissions, enforces policy on every request, logs each action as audit evidence and stops autonomous attacks in seconds, while applying quantum-safe encryption to each connection. It sits in front of existing cloud, identity, applications and AI models, so there is no rip-and-replace and deployment takes weeks.
To map your MCP exposure before an attacker does, talk to our team.




