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.
MCPXKIT: The Unified Toolkit for Analyzing Model Context Protocol Security
Shenzhen International Graduate School, Tsinghua University, Shenzhen, China(深圳国际研究生院,清华大学,深圳,中国);Ant Group, Hangzhou, China(蚂蚁集团,杭州,中国);Swinburne University of Technology, Melbourne, Australia(斯威本科技大学,墨尔本,澳大利亚);The University of Adelaide, Adelaide, Australia(阿德莱德大学,阿德莱德,澳大利亚);UNSW Sydney, Australia(悉尼大学,澳大利亚)
Breaking the Protocol: Security Analysis of the Model Context Protocol Specification and Prompt Injection Vulnerabilities in Tool-Integrated LLM Agents
ETDI: Mitigating Tool Squatting and Rug Pull Attacks in Model Context Protocol (MCP) by using OAuth-Enhanced Tool Definitions and Policy-Based Access Control
Amazon Independent Researcher(亚马逊独立研究者);Project Kuiper Security (KPES)(项目Kuiper安全);Proactive Security OWASP, Amazon Web Services(主动安全OWASP,亚马逊网络服务);Intuit Adversarial AI Security reSearch (A2RS)(Intuit对抗AI安全reSearch)
本文提出 ETDI 安全扩展,通过密码学身份验证、不可变版本化工具定义、OAuth 2.0 权限管理及基于策略的细粒度访问控制,缓解 MCP 中的工具投毒和 Rug Pull 攻击,构建更安全可控的 AI 工具交互生态。
When the Manual Lies: A Realistic Benchmark to Evaluate MCP Poisoning Attacks for LLM Agents
Institute of Information Engineering, Chinese Academy of Sciences, Beijing, China(中国科学院信息工程研究所);School of Cyber Security, University of Chinese Academy of Sciences, Beijing, China(中国科学院大学网络安全学院)
MCP-SafetyBench: A Benchmark for Safety Evaluation of Large Language Models with Real-World MCP Servers
East China Normal University(东华师范大学);Salesforce AI Research(Salesforce人工智能研究);Singapore Management University(新加坡国立大学);Shanghai AI Laboratory(上海人工智能实验室)
Give Them an Inch and They Will Take a Mile:Understanding and Measuring Caller Identity Confusion in MCP-Based AI Systems
Institute for Clarity in Documentation(清晰文档研究所);Inria Paris-Rocquencourt(巴黎-罗克Quantin 研究院);Rajiv Gandhi University(拉朱·甘地大学);Tsinghua University(清华大学);Palmer Research Laboratories(帕勒尔研究实验室);Shandong University(山东省大学);City University of Hong Kong(香港城市大学)
ChainWatch: A Kill Chain-Aligned Sequential Detection Framework for Multi-Step Attacks in MCP-Based AI Agent Systems
Computer Science New York University New York, USA(计算机科学 新 York 大学 新 York 美国);Cybersecurity University of Maryland, College Park MD, USA(网络安全 美国马里兰大学College Park分校 MD 美国);Carnegie Mellon University Pittsburgh, USA(卡内基梅隆大学 彭博 美国)
A2M: Trace-Optimized Agent Hijacking in the MCP Ecosystem
Shenzhen Institutes of Advanced Technology, Chinese Academy of Sciences(中国科学院深圳先进技术研究院);University of Chinese Academy of Sciences(中国科学院大学);Nanyang Technological University(南洋理工大学);Southern University of Science and Technology(南方科技大学);Shenzhen University of Advanced Technology(深圳先进技术学院);University of Macau(澳门大学)
Plant, Persist, Trigger: Sleeper Attack on Large Language Model Agents
University of Science and Technology of China(中国科学技术大学);National University of Singapore(新加坡国立大学);Singapore Management University(新加坡管理学院);Shanghai Artificial Intelligence Laboratory(上海人工智能实验室)