Compatibility at a Cost: Systematic Discovery and Exploitation of MCP Clause-Compliance Vulnerabilities
Organizations: University of Minnesota Minneapolis, USA
Abstract
The Model Context Protocol (MCP) is a recently proposed interoperability standard that unifies how AI agents connect with external tools and data sources. By defining a set of common client-server message exchange clauses, MCP replaces fragmented integrations with a standardized, plug-and-play framework. However, to be compatible with diverse AI agents, the MCP specification relaxes many behavioral constraints into optional clauses, leading to misuse-prone SDK implementation. We identify it as a new attack surface that allows adversaries to achieve multiple attacks (e.g, silent prompt injection, DoS, etc.), named as compatibility-abusing attacks. In this work, we present the first systematic framework for analyzing this new attack surface across multi-language MCP SDKs. First, we construct a universal and language-agnostic intermediate representation (IR) generator that normalizes SDKs of different languages. Next, based on the new IR, we propose auditable static analysis with LLM-guided semantic reasoning for cross-language/clause compliance analysis. Third, by formalizing the attack semantics of the MCP clauses, we build three attack modalities and develop a modality-guided pipeline to uncover exploitable non-compliance issues.
Figures & tables
| Compatibility | RFC Keywords | Count | Share |
|---|---|---|---|
| Mandatory | Unconditional MUST | 59 | 21.5% |
| Optional | Conditional MUST | 78 | 28.4% |
| Non-MUST | 138 | 50.2% |
| SDKs | I | NI-O | NI-NO | NI | Exploitable |
|---|---|---|---|---|---|
| Python | 182 | 76 | 17 | 93 | 93 |
| TypeScript | 193 | 62 | 20 | 82 | 81 |
| Go | 195 | 62 | 18 | 80 | 80 |
| Kotlin | 128 | 111 | 36 | 147 | 147 |
| Swift | 104 | 135 | 35 | 170 | 170 |
| Java | 169 | 82 | 24 | 106 | 106 |
| SDK | TP | FP | TN | FN | Precision | Recall |
|---|---|---|---|---|---|---|
| Python | 13 | 7 | 19 | 1 | 65.0% | 92.9% |
| TypeScript | 15 | 5 | 17 | 3 | 75.0% | 83.3% |
| Go | 18 | 2 | 18 | 2 | 90.0% | 90.0% |
| Kotlin | 18 | 2 | 17 | 3 | 90.0% | 85.7% |
| Swift | 20 | 0 | 14 | 6 | 100.0% | 76.9% |
| Java | 18 | 2 | 18 | 2 | 90.0% | 90.0% |
MCP Security
Model Context Protocol (MCP) security studies how to protect AI agents, tool servers, and data flows from attacks and misuse.
See all 41 papers