Don't believe everything you read: understanding and measuring MCP behavior under misleading tool descriptionsDon't believe everything you read: Understanding and Measuring MCP Behavior under Misleading Tool Descriptions
MCPDiFF statically analyzes 10,240 MCP servers; the authors state that about 13% of descriptions and code are partial or rare matches.
- MCP connects LLMs to external tools using natural-language tool descriptions, but does not enforce that descriptions match the code. The authors state that servers often run locally with broad permissions, yet descriptions are treated as semantic contracts; when inconsistent, undocumented operations may be triggered without awareness.
- MCPDiFF uses Tree-Sitter to build function call chains, then uses a large model to compare the semantic coverage between code and repository descriptions. Code present but not in the description is considered potentially hidden; the reverse is negligible under its threat model. Consistency is divided into four levels: full match, 80%–100%, 40%–80%, and below 40%.
- Among 10,240 servers, Fully Match is 5,303, and Partial and Rare are 1,079 and 314, which the authors state account for about 13%. As stars increase, the Full Match proportion decreases. The three cases are undocumented process termination, trading, and user information modification.
- The paper does not state method limitations. The open directions are how descriptions shape agent beliefs, whether mismatches lead to predictable decision biases, and whether the failure modes parallel human misreading of documentation. The measurement is static analysis of 10,240 servers plus three consequence evaluations; the model used for semantic analysis is not reported, and actual agent decisions are not measured.
- Benchmarks
- 10240 MCP applicationsMCP MarketSmitheryMCP World
- Metrics
- Full MatchMostly MatchPartial MatchRare Matchcoverage
The researchers performed static analysis on 10,240 real MCP servers and found that about 13% of tool descriptions are clearly inconsistent with their code implementations, potentially triggering undeclared privileged operations, hidden state modifications, or unauthorized financial operations. The study designed a static analysis framework, MCPDiFF, which quantifies consistency by constructing function call chains and comparing semantic vectors of descriptions and code. Results show that large categories such as developer tools and API development have the highest absolute number of inconsistent servers, the official category has only about 41.5% exact match rate, and highly popular tools are not fully consistent either. In case studies, mcpx-py contains an undeclared killtree function, longport-mcp does not disclose submit_order and cancel_order, and zerops-mcp's read-only GitHub integration includes updateUser that modifies user information.
Why it was selectedThe paper performs static analysis on 10,240 MCP servers, quantifying the proportion of inconsistencies between tool descriptions and code implementations, which can serve as a reference for teams auditing the MCP ecosystem.
Paper analysis
What problem does this paper attempt to solve?
MCP descriptions need not equal the code; the authors use MCPDiFF to measure this gap across 10,240 servers.
MCP does not enforce that tool descriptions match the code, yet agents rely on them to judge capabilities and risks.
- Scenario: MCP connects LLMs to external tools via natural-language descriptions; the authors state this underpins many AI agent applications. Servers often run locally with relatively broad system permissions and little isolation, and descriptions are treated by users and LLMs as the primary semantic contract.
- Risk: The protocol does not check whether documented functionality equals actual execution. The authors state that once this assumption breaks, applications may change persistent state, invoke privileged system calls, or trigger irreversible actions without the user or model knowing; even without obvious malicious intent, subtle differences are enough to mislead agents that rely on descriptions for reasoning and planning.
- Authors' contrast: The authors state that platforms such as Android perform explicit permission checks, whereas MCP relies mainly on descriptions and does not enforce that this behavioral contract is correct. The authors frame description–code inconsistency as a previously underexplored source of systematic misalignment between "how tools are understood" and "how tools actually behave."
- Analysis setup: The authors write that features claimed by descriptions but not implemented in code can be ignored under their threat model; features present in code but absent from descriptions may indicate hidden functionality, and potential risk is estimated accordingly. The analysis targets MCP Server source code and repository descriptions.
- What this paper does: The authors propose a static analysis framework, MCPDiFF, applied to 10,240 real MCP Servers across 36 categories, comparing declared capabilities with implemented behavior. The authors state this is the first large-scale identification, formalization, and measurement of this inconsistency.
What related research exists?
Related work mostly focuses on protocols and attack surfaces; the authors position this paper on the semantic gap between descriptions and code.
In Related Work, the authors group existing work into three groups; the introduction additionally uses traditional permission platforms as a contrast. The experiments have no comparison baseline.
Protocol layer and ecosystem
- Interoperability and governance: The authors group Errico et al. (2025), Hou et al. (2025), Hechuan Guo et al. (2025), Lin et al. (2025), Sarkar and Sarkar (2025), and Tupe and Thube (2025) together, stating that these works treat MCP as an agent–tool interoperability layer and propose threat models, taxonomies, or architectural principles to improve security, scalability, and reliability. The paper does not describe the differences between them one by one.
- Permission platform contrast: The introduction states that traditional APIs and Android perform explicit permission checks, citing PScout by Au et al. (2012), Barrera et al. (2010), Felt et al. (2011), and AutoCog by Qu et al. (2014). This is the authors' contrast, not an experimental baseline.
Automated analysis and real-world risk
- Attack surface and defense evaluation: The authors group MCPGuard (Wang et al., 2025), MPMA preference manipulation attacks (Wang et al., 2025), MCP-Guard (Xing et al., 2025), and MCPSecBench (Yang et al., 2025) as formalization of the MCP attack surface and benchmark-style defense evaluation. The paper only categorizes them and does not state what these works lack relative to this paper.
- Malicious servers and measurement: The authors group Yongjian Guo et al. (2025), Hasan et al. (2025), He et al. (2025), Zhao et al. (2025), and Hou et al. (2025) again into another group, stating that they measure malicious servers, ecosystem-level security and maintainability, and the transferability of MCP-specific attacks.
Broader agent communication
- Protocol risks and extensions: Kong et al. (2025) survey LLM-driven agent communication, covering protocol manipulation, tool poisoning, and defensive countermeasures, and discuss scalability optimizations for MCP systems. MCP-Zero by Fei et al. (2025) studies proactive tool discovery by autonomous LLM agents. The authors place both outside the MCP protocol-layer work.
The authors state that this paper shifts the focus from protocol-layer specifications and attack surfaces to the semantic gap between tool descriptions and actual code behavior, and performs implementation-level, execution-aware analysis at ecosystem scale. The paper does not report comparative experiments against the above detectors or benchmarks.
How does the paper address this problem?
MCPDiFF statically builds call chains and compares code and description coverage; only hidden functionality counts toward risk.
MCPDiFF statically compares what an MCP Server claims to do with what the code actually does. Figure 2 is divided into three stages: building the call chain, extracting semantics, comparing coverage and flagging risk. Related Work describes the analysis as implementation-level and execution-aware; the methods section describes static parsing and semantic comparison.
Objects Compared
- Description side: tool descriptions contain the name, natural-language description, and input/output schema, which the Host passes to the LLM as-is as the semantic basis for selection and invocation. The JSON example in the paper declares querying data by user ID, and states that this layer cannot see database logic or side effects.
- Implementation side: in Figure 1, alongside the implementation matching "query user profile" there is also a database update not written in the description; another passage writes the declared query as deleting user records. The authors use this to show that a read-only description may still perform destructive operations, and that the protocol does not enforce consistency between the two.
- Direction: present in the description but absent from function features, which the authors state can be ignored under their threat model. Present in the code but absent from the description, which the authors state may indicate that the functionality is concealed.
Call Chain (P-I)
- Parsing: Tree-Sitter is used for static analysis of multilingual source code, extracting function signatures, function bodies, and call relationships. The paper does not list the languages.
- Graph and traversal: call relationships are built into a directed graph. Nodes with in-degree 0 are treated as main entry points, and non-zero in-degree as intermediate helper functions. Depth-first traversal from all entry points yields the complete call chain.
- Rationale: the authors state this is to improve code analysis accuracy and reduce the cost of subsequent semantic analysis.
Semantic Extraction (P-II)
- Code: the call chain is used as context for the main functional routine, and a large language model analyzes semantic features. The paper does not state the model, prompts, or sampling settings.
- Text: repository descriptions such as README and manifest are read, and a large model is then used to extract functional information. The experiments section separately writes that semantic similarity is computed with tool descriptions. The paper does not state how repository descriptions are aligned with individual tool description fields.
Coverage and Grading (P-III)
- Comparison: feature texts from both sides are embedded as vectors and their similarity compared. Figure 2 labels a Coverage Risk Score Indicator as well as Low Risk and High Risk. Only δ=f and f=∑ remain of the formula in the figure; the main text does not give a complete definition.
- Coverage: coverage is computed for described features. The authors state that the higher the coverage, the more consistent the code features are with the external declaration; the lower the coverage, the more features are not externally disclosed, and the higher the likelihood of potential risk.
- Four tiers: the experiments divide "the proportion of consistency between tool descriptions and functional code" into Full Match (fully consistent), Mostly Match (80%–100%), Partial Match (40%–80%), Rare Match (less than 40%). The paper does not state how this proportion converts to coverage or vector similarity.
What experiments did the paper conduct?
Among 10,240 servers, Fully Match was 5,303; the authors state that about 13% were partial or rare match.
Experimental setup
- Corpus: 10,240 MCP applications were collected from MCP Market, Smithery, and MCP World, with category and GitHub stars recorded. The abstract states 36 categories are covered. Table 3's source names are written as mcp_world, mcpmarket, and smithery; the paper does not state whether these correspond one-to-one with the three names above.
- Target and tools: The analyzed objects are MCP Server source code and descriptions, not named LLMs. Semantic analysis uses a large language model; the paper does not give its name. There is no comparison baseline and no number of repetitions.
- Tiers: Full Match means fully consistent; Mostly Match is 80%–100%; Partial Match is 40%–80%; Rare Match is below 40%. The main text states that semantic analysis is performed on normalized source code, and semantic similarity is then computed against tool descriptions.
- Cross-tabulation: Categories are in Table 1; star bins are 0–9, 10–99, 100–999, 1000–9999, and 10000+ (Table 2); download sources are in Table 3.
- Cases: The consequence evaluation only discusses mcpx-py, longport-mcp, and zerops-mcp. The paper does not report MCPDiFF's agreement rate or accuracy against human judgment.
Main results
Figure 3 gives the four-tier counts for 10,240 servers. The x-axis is Match Level, the y-axis is Number of MCP Servers, and the bar labels are as follows.
| Level | Count (Figure 3) | Definition | | Fully Match | 5,303 | Fully consistent | | Mostly Match | 3,544 | 80%–100% | | Partial Match | 1,079 | 40%–80% | | Rare Match | 314 | ≤40% |
- The authors state that Fully Match is the most common, over half, and most servers match their declared functionality; Mostly Match is a slight but acceptable deviation.
- Partial and Rare combined, the authors state, account for about 13% of the sample, and state that mismatches mislead agents, leading to unintended or unsafe tool calls.
- The abstract states that this roughly 13% of substantial mismatches can enable undocumented privileged operations, hidden state modifications, or unauthorized financial actions. That sentence is tied to the four-tier counts, not a per-server human review proportion.
Category differences
- What was measured: Table 1 gives F/M/P/R counts by category. Ratios given in the main text: Developer Tools totals 6,474, Full Match 3,094, about 48%; API Development about 53.2%; AI coding context tools about 45.0%.
- Results: youtube content analysis, document conversation tools, and transit and traffic data have Full Match rates of 76.7%, 62.3%, and 61.3%, respectively. Official is about 41.5% (F=17, Total=41 in the table).
- Authors' interpretation: Large and complex categories have the highest absolute number of inconsistencies and uneven internal quality; smaller, more specialized categories tend to have higher consistency. The authors state that Official is even lower than many third-party categories and therefore express concern about the reliability of official tools. Table 1 includes rows such as Popular, Official, and Featured; the paper does not state whether the categories are mutually exclusive.
Popularity and source
- Popularity (Table 2): 0–9 totals 7,858, Full Match is 4,202/7,858 (about 53.5%), Rare Match is 277/7,858 (about 3.5%). Full Match is then 894/1,874 (about 47.7%) for 10–99, 178/404 (about 44.1%) for 100–999, and 25/86 (about 29.1%) for 1000–9999. 10000+ totals 19, with 0 Rare Match; that row's F/M/P is 4/10/5. The authors state that the Full Match proportion varies inversely with popularity, Rare Match decreases with popularity, and popularity does not monotonically improve consistency. The abstract states that severe mismatches largely disappear among highly popular tools, but widely used servers can still deviate from their claims.
- Source (Table 3): smithery's Full Match is 1,899/3,357 (about 56.6%). mcp_world is 2,841/5,819 (about 48.8%), Partial is 484/5,819 (8.3%), Rare is 175/5,819 (3.0%). mcpmarket is 1,788/3,545 (50.4%), Partial is 638/3,545 (18.0%), Rare is 151/3,545 (4.3%).
- Authors' interpretation: The authors state that smithery is most likely to have descriptions highly consistent with functionality; mcp_world is not the most precise but has the lowest risk of significant or severe functional deviation; mcpmarket has the highest Partial and Rare proportions of the three. The main text writes "significant differences" and does not report statistical tests.
High-risk cases
- C1: The authors state that mcpx-py is positioned as a general MCP development framework, and the audit found an undocumented killtree that can terminate arbitrary processes and their descendants given a PID. The authors state this could be used to forcibly stop critical services, constituting denial of service.
- C2: The authors state that longport-mcp claims to connect to the Longport OpenAPI, and the documentation does not mention submit_order or cancel_order. The authors state that when authorization is weak or absent, trades can be initiated or canceled without user consent, causing direct financial loss.
- C3: The authors state that zerops-mcp's documentation is a read-only GitHub integration, but an undocumented updateUser exists that can modify user information. The authors state that scope inconsistency can escalate into integrity and privacy risks.
Other ablations and analyses
- The paper does not report ablations, threshold sensitivity, language stratification, or repeated runs.
- Exception: Full Match proportion decreases as stars increase (Table 2: 0–9 about 53.5%, 1000–9999 about 29.1%). The authors directly write that popularity does not monotonically improve consistency.
- Official's Full Match is about 41.5%, which the authors state is lower than many third-party categories.
- 10000+ has 0 Rare Match; that row in Table 2 still has 5 Partial Match (out of 19).
What are some points that can be further explored?
The paper does not state method limitations; it only lists belief formation and decision bias as open questions.
Limitations and future directions noted by the authors
The paper has no Limitations section, nor does it frame the analysis method, sample, or model errors as limitations. Open Questions and Future Directions lists three open directions:
- Belief formation: The authors ask how agents convert natural-language tool descriptions into internal beliefs about action affordances and risks, and state that future work could examine how language framing and specificity affect belief formation and downstream decisions. (Open Questions)
- Decision bias: The authors ask whether mismatches lead to predictable biases, such as trusting descriptions that sound benign more, or being less sensitive to undocumented side effects; they state that characterizing these patterns could help identify cognitive failure modes caused by misleading semantic cues. (Open Questions)
- Similarities and differences with humans: The authors ask whether the observed failure modes parallel human misreading of documentation or reflect properties specific to current language models. The section states that the paper focuses on AI agents and finds the comparison with human cognition inviting. (Open Questions)
The Conclusion calls for systematic auditing and stronger transparency guarantees; this is a recommendation, not a self-reported limitation.
Experimental coverage
- The measurement target was 10,240 MCP applications; the abstract says 36 categories; the cross-tabulation is by Table 1's categories, Table 2's five star bins, and Table 3's three sources.
- The consequence evaluation only mentions mcpx-py, longport-mcp, and zerops-mcp, with no attack success rate.
- The paper does not report the models, prompts, or number of repetitions used for semantic analysis, nor MCPDiFF's agreement rate or accuracy relative to human judgment.
- The paper does not report experiments on actual agent tool selection or decisions; Open Questions lists belief formation and decision bias as open questions. The method section is static analysis; the paper does not report observations after executing these tools.
- Developer Tools, API Development, and AI coding context tools have totals of 6,474, 3,075, and 2,963 respectively, which cannot serve as a mutually exclusive partition of 10,240. The three sources in Table 3 have totals of 5,819, 3,545, and 3,357. The paper does not state whether categories or sources are double-counted.
Summarize the main content of the paper
MCPDiFF measures description–code consistency across 10,240 servers; the authors state that about 13% have mismatches.
The authors use MCPDiFF to measure whether tool descriptions of real MCP Servers reflect code behavior, and state this is the first large-scale study of the problem.
- Problem: MCP treats tool descriptions as the semantic contract by which LLMs select and invoke tools, but does not enforce that they match the code. The authors believe servers often run locally with broad permissions, and this gap can lead agents to form incorrect capability and risk judgments; this can happen even without obvious malicious intent.
- Method: Tree-Sitter builds call chains from multilingual source code; a large language model extracts semantics from the code as well as from READMEs and manifests, then embeddings are compared. Features present in code but absent from descriptions are treated as possibly hidden functionality; the reverse case is ignored under their threat model. Consistency is divided into four tiers: fully match, 80%–100%, 40%–80%, and below 40%. The model used and the conversion of proportions are not stated in the paper.
- Overall: Among 10,240 servers, Fully Match is 5,303, Mostly Match is 3,544, Partial Match is 1,079, and Rare Match is 314 (Figure 3). The authors state that the latter two tiers account for about 13%, and state that such mismatches can enable undocumented privileged operations, hidden state modifications, or unauthorized financial actions.
- Distribution: Developer Tools has about 48% Full Match (3,094/6,474); Official about 41.5%. The 0–9 star bin has about 53.5% Full Match (4,202/7,858), 1000–9999 about 29.1% (25/86), and 10000+ has 0 Rare Match. Smithery has about 56.6% Full Match (1,899/3,357); mcpmarket has 18.0% Partial Match (638/3,545) and 4.3% Rare Match (151/3,545).
- Cases and conclusion: The authors report that mcpx-py has an undocumented killtree, longport-mcp's documentation does not mention submit_order and cancel_order, and zerops-mcp has an undocumented updateUser. The authors state that inconsistency is a structural feature of the current MCP ecosystem and call for systematic auditing and stronger transparency guarantees. Belief formation and decision bias are listed as open questions; this paper has no corresponding experiments.