mlsanityData to 14 Oct 2026

Machine Learning-Based Detection of MCP Attacks

arXiv 2604.10534 ↗First posted 12 Apr 2026cs.CR cs.AI cs.SEcited by 0

Not on the map. Why?

Abstract (arXiv)

The Model Context Protocol (MCP) is a new and emerging technology that extends the functionality of large language models, improving workflows but also exposing users to a new attack surface. Several studies have highlighted related security flaws, but MCP attack detection remains underexplored. To address this research gap, this study develops and evaluates a range of supervised machine learning approaches, including both traditional and deep-learning models. We evaluated the systems on the detection of malicious MCP tool descriptions in two scenarios: (1) a binary classification task distinguishing malicious from benign tools, and (2) a multiclass classification task identifying the attack type while separating benign from malicious tools. In addition to the machine learning models, we compared a rule-based approach that serves as a baseline. The results indicate that several of the developed models achieved 100% F1-score on the binary classification task. In the multiclass scenario, the SVC and BERT models performed best, achieving F1 scores of 90.56% and 88.33%, respectively. Confusion matrices were also used to visualize the full distribution of predictions often missed by traditional metrics, providing additional insight for selecting the best-fitting solution in real-world scenarios. This study presents an addition to the MCP defence area, showing that machine learning models can perform exceptionally well in separating malicious and benign data points. To apply the solution in a live environment, a middleware was developed to classify which MCP tools are safe to use before execution, and block the ones that are not safe. Furthermore, the study shows that these models can outperform traditional rule-based solutions currently in use in the field.

Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 8 of its 33 references that are in the map. First posted on arXiv 12 Apr 2026.

Builds on

8 of 33 references.

References · 8

  1. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
  2. 2017Axiomatic Attribution for Deep Networkscited by 3,384
  3. 2020Metrics for Multi-Class Classification: an Overviewcited by 143
  4. 2025MCPTox: A Benchmark for Tool Poisoning Attack on Real-World MCP Serverscited by 66
  5. 2024Middleware for LLMs: Tools Are Instrumental for Language Agents in Complex Environmentscited by 39
  6. 2025MCPXKIT: The Unified Toolkit for Analyzing Model Context Protocol Securitycited by 21
  7. 2025Semantics at an Angle: When Cosine Similarity Works Until It Doesn'tcited by 13
  8. 2025A Framework for Rapidly Developing and Deploying Protection Against Large Language Model Attackscited by 3

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2026Model Context Protocol Threat Modeling and Analyzing Vulnerabilities to Prompt Injection with Tool Poisoning
  2. 2025Beyond the Protocol: Unveiling Attack Vectors in the Model Context Protocol (MCP) Ecosystem
  3. 2025MCPGuard : Automatically Detecting Vulnerabilities in MCP Servers
  4. 2025Model Context Protocol (MCP): Landscape, Security Threats, and Future Research Directions
  5. 2025When MCP Servers Attack: Taxonomy, Feasibility, and Mitigation
  6. 2026MCP-38: A Comprehensive Threat Taxonomy for Model Context Protocol Systems (v1.0)
  7. 2026From Component Manipulation to System Compromise: Understanding and Detecting Malicious MCP Servers
  8. 2025MCPSecBench: A Systematic Security Benchmark and Playground for Testing Model Context Protocols