MCP Security Bench (MSB): Benchmarking Attacks Against Model Context Protocol in LLM Agents

Dongsen Zhang, Zekun Li, Xu Luo, Xuannan Liu, Pei Pei Li, Wenjun Xu

TL;DR

The Model Context Protocol (MCP) was designed to make Large Language Model (LLM) agents more interoperable, but it also opened a Pandora’s box of security vulnerabilities. Researchers have introduced MSB (MCP Security Bench), the first end-to-end evaluation suite that reveals a sobering "inverse scaling law": the more capable an agent is at following instructions and using tools, the more susceptible it is to sophisticated MCP-specific attacks.

What Problem Does This Paper Address?

As LLM agents evolve from simple chatbots into autonomous assistants, they increasingly rely on external tools to perform real-world tasks. Anthropic’s Model Context Protocol (MCP) emerged as a standard to help these agents discover and call tools across different platforms. However, by standardizing how tools describe themselves in natural language, MCP inadvertently expanded the attack surface.

Existing security benchmarks mostly focus on "function calling" in isolated environments. They fail to capture vulnerabilities unique to the MCP workflow—where malicious tools can manipulate their own metadata (names and descriptions) to trick agents or inject "poisoned" responses that impersonate users. The authors address this gap by creating a systematic way to measure how well agents resist attacks throughout the entire tool-use pipeline: planning, invocation, and response handling.

Methods

The authors developed MSB, which consists of three core components:

  1. A Taxonomy of 12 Attacks: These are categorized by the stage of the MCP workflow they target.
  2. Planning Stage: Attacks like Name Collision (naming a malicious tool similarly to a benign one) and Preference Manipulation.
  3. Invocation Stage: Out-of-Scope Parameter requests that trick agents into leaking sensitive data (like model names).
  4. Response Handling: User Impersonation (where a tool response pretends to be a new user command) and False Error Escalation.
Overview of MCP attack vectors and examples of specific exploits across the tool-use pipeline.
  1. An Evaluation Harness: Unlike previous benchmarks that simulate tool outputs, MSB executes real tools (both benign and malicious) via an actual MCP server. This dynamic environment reflects real-world operational conditions.
  2. The NRP Metric: They propose Net Resilient Performance (NRP), calculated as $PUA \times (1 - ASR)$. This metric is crucial because it quantifies the trade-off between an agent's utility (Performance Under Attack) and its security (Attack Success Rate).

Datasets

The researchers constructed a massive testing ground for MSB:

  • 10 Domains: Including Academic Search, IT Development, Travel, and Team Management.
  • 405 Tools: Comprising 304 benign tools and 101 malicious/mutated tools.
  • 2,000 Attack Instances: Generated by combining 65 realistic user tasks with various attack vectors.
  • Models Evaluated: They tested 10 popular LLM backbones, including DeepSeek-V3.1, GPT-4o-mini, and future-dated placeholders like GPT-5 and Claude 4 Sonnet.

Key Insights and Ideas

  • The Inverse Scaling Law of Security: One of the most striking findings is that "stronger" models are often more vulnerable. Because these models are better at following instructions and calling tools, they are more likely to "obediently" follow a malicious instruction embedded in a tool's metadata or response.
  • MCP-Specific Attacks are Aggressive: Novel attacks introduced by MCP, such as User Impersonation (UI) and False Error (FE), achieved significantly higher success rates than traditional prompt injections. UI, in particular, is highly effective because it exploits the agent's trust in the conversation flow.
  • Synergistic "Mixed" Attacks: Combining multiple attack vectors (e.g., Prompt Injection + User Impersonation) often results in a higher success rate than the sum of their parts, suggesting that multi-stage intrusions can bypass safety layers more effectively.
  • The Defense Dilemma: Current defenses (like the MCIP classifier) tend to be over-cautious. While they reduce the attack success rate, they also cause "functional degradation" by over-rejecting benign tool calls, leading to a lower overall utility for the user.

Key Results

  • High Vulnerability: The overall average Attack Success Rate (ASR) across all tested models was 40.35%.
  • Most Effective Attack: The Out-of-Scope Parameter (OP) attack was the most devastating, with a peak average ASR of 76.5%.
  • Model Performance: GPT-5 achieved the highest NRP score, indicating it currently offers the best balance of task completion and resilience, though it still suffered from a 37% ASR.
  • Defense Impact: Implementing a baseline defense reduced the average ASR by 11.66% but also decreased the user task completion rate (PUA) by 7.59%.

Limitations and Future Work

The authors acknowledge that their current defense evaluation is based on a static classifier, which struggles with the dynamic nature of MCP interactions. They suggest that future research should focus on:

  • Dynamic, Context-Aware Defenses: Developing systems that can sanitize tool parameters and responses in real-time without breaking the agent's functionality.
  • Hardening MCP Agents: Using MSB as a baseline to fine-tune models specifically for adversarial tool-use scenarios.
  • Expanding the Taxonomy: As the MCP ecosystem grows, new attack vectors involving multi-agent orchestration or complex tool-chaining will likely emerge and need to be benchmarked.

Summary updated

BibTeX
@inproceedings{zhang2026mcp,
  author = {Dongsen Zhang and Zekun Li and Xu Luo and Xuannan Liu and Pei Pei Li and Wenjun Xu},
  title = {{MCP Security Bench (MSB): Benchmarking Attacks Against Model Context Protocol in LLM Agents}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=irxxkFMrry},
}
Figure