Model Context Protocol (MCP) at First Glance: Studying the Security and Maintainability of MCP Servers

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Hasan, Mohammed Mehedi, Li, Hao, Fallahzadeh, Emad, Rajbahadur, Gopi Krishnan, Adams, Bram, Hassan, Ahmed E.
Format: Preprint
Veröffentlicht: 2025
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866918439957823488
author Hasan, Mohammed Mehedi
Li, Hao
Fallahzadeh, Emad
Rajbahadur, Gopi Krishnan
Adams, Bram
Hassan, Ahmed E.
author_facet Hasan, Mohammed Mehedi
Li, Hao
Fallahzadeh, Emad
Rajbahadur, Gopi Krishnan
Adams, Bram
Hassan, Ahmed E.
contents Although Foundation Models (FMs), such as GPT-4, are increasingly used in domains like finance and software engineering, reliance on textual interfaces limits these models' real-world interaction. To address this, FM providers introduced a tool called -- triggering a proliferation of frameworks with distinct tool interfaces. In late 2024, Anthropic introduced the Model Context Protocol (MCP) to standardize this tool ecosystem. MCP is rapidly emerging as a de facto industry standard. Despite its adoption, MCP's AI-driven, non-deterministic control flow introduces new risks to sustainability, security, and maintainability, warranting closer examination. Towards this end, we present the first large-scale empirical study of MCP. Using state-of-the-art health metrics and a hybrid analysis pipeline that combines a general-purpose static analysis tool with an MCP-specific scanner, we evaluate 1,899 open-source MCP servers to assess their health, security, and maintainability. Despite MCP servers demonstrating strong health metrics, we identify eight distinct vulnerabilities -- only three of which overlap with traditional software vulnerabilities. Additionally, 7.2% of servers contain general vulnerabilities, and 5.5% exhibit MCP-specific tool poisoning. Regarding maintainability, while 66% exhibit code smells, 14.4% contain ten bug patterns overlapping prior research. These findings highlight the need for MCP-specific vulnerability detection techniques while reaffirming the value of traditional analysis and refactoring practices. Furthermore, we advocate for stronger governance across the MCP ecosystem by incorporating MCP-specific vulnerabilities into standardized vulnerability databases, enabling automated security scanning within MCP registries, and promoting responsible development practices to ensure the long-term safety and sustainability of the MCP ecosystem.
format Preprint
id arxiv_https___arxiv_org_abs_2506_13538
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Model Context Protocol (MCP) at First Glance: Studying the Security and Maintainability of MCP Servers
Hasan, Mohammed Mehedi
Li, Hao
Fallahzadeh, Emad
Rajbahadur, Gopi Krishnan
Adams, Bram
Hassan, Ahmed E.
Software Engineering
Emerging Technologies
Although Foundation Models (FMs), such as GPT-4, are increasingly used in domains like finance and software engineering, reliance on textual interfaces limits these models' real-world interaction. To address this, FM providers introduced a tool called -- triggering a proliferation of frameworks with distinct tool interfaces. In late 2024, Anthropic introduced the Model Context Protocol (MCP) to standardize this tool ecosystem. MCP is rapidly emerging as a de facto industry standard. Despite its adoption, MCP's AI-driven, non-deterministic control flow introduces new risks to sustainability, security, and maintainability, warranting closer examination. Towards this end, we present the first large-scale empirical study of MCP. Using state-of-the-art health metrics and a hybrid analysis pipeline that combines a general-purpose static analysis tool with an MCP-specific scanner, we evaluate 1,899 open-source MCP servers to assess their health, security, and maintainability. Despite MCP servers demonstrating strong health metrics, we identify eight distinct vulnerabilities -- only three of which overlap with traditional software vulnerabilities. Additionally, 7.2% of servers contain general vulnerabilities, and 5.5% exhibit MCP-specific tool poisoning. Regarding maintainability, while 66% exhibit code smells, 14.4% contain ten bug patterns overlapping prior research. These findings highlight the need for MCP-specific vulnerability detection techniques while reaffirming the value of traditional analysis and refactoring practices. Furthermore, we advocate for stronger governance across the MCP ecosystem by incorporating MCP-specific vulnerabilities into standardized vulnerability databases, enabling automated security scanning within MCP registries, and promoting responsible development practices to ensure the long-term safety and sustainability of the MCP ecosystem.
title Model Context Protocol (MCP) at First Glance: Studying the Security and Maintainability of MCP Servers
topic Software Engineering
Emerging Technologies
url https://arxiv.org/abs/2506.13538