MCP Server Architecture Patterns for LLM-Integrated Applications

📄 arXiv: 2606.30317v1 📥 PDF

作者: Carson Rodrigues, Oysturn Vas

分类: cs.SE, cs.AI

发布日期: 2026-06-29

备注: 9 pages, IEEEtran conference format, 2 figures. Extended version; a condensed version is under review at IEEE Software. Replication package: https://github.com/rodriguescarson/mcp-patterns-icsme2026


💡 一句话要点

提出MCP服务器架构模式以优化LLM集成应用

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 模型上下文协议 大型语言模型 架构模式 工具协调 系统维护 智能应用 软件工程

📋 核心要点

  1. 现有MCP服务器缺乏系统化的架构模式,导致生产环境中的维护和扩展困难。
  2. 论文通过分析15个独立开发的MCP服务器,提出了五种常见的架构模式,以标准化LLM与外部工具的连接。
  3. 定量评估显示,分类一致性较高,且工具选择准确性在特定上下文中显著下降,揭示了架构设计的潜在问题。

📝 摘要(中文)

模型上下文协议(MCP)由Anthropic于2024年11月提出,定义了将大型语言模型(LLMs)与外部工具、数据源和服务连接的标准化接口。自发布以来,GitHub上出现了数百个社区构建的MCP服务器,但尚无软件维护文献描述该生态系统在生产中的结构。本文记录了在15个独立开发的服务器中观察到的五种重复出现的MCP服务器架构模式,包括资源网关、工具协调器、有状态会话服务器、代理聚合器和特定领域适配器。每种模式都以Gamma等人的结构化形式描述:上下文、问题、解决方案和后果。此外,我们还记录了四种反模式及一组跨切关注点,涉及身份验证、版本控制和可观察性。定量评估贡献了三项测量:54个保留服务器上两位独立LLM评估者的分类一致性(Cohen's kappa = 0.76),传输开销的端到端测量,以及工具选择准确性在10到15个工具上下文中低于90%的工具计数研究。

🔬 方法详解

问题定义:本文旨在解决MCP服务器在生产环境中的架构不一致性和维护挑战。现有方法缺乏系统化的描述,导致开发者在实现时面临困难。

核心思路:通过对15个独立开发的MCP服务器进行分析,识别出五种架构模式,提供了一种标准化的框架,帮助开发者更有效地构建和维护MCP服务器。

技术框架:整体架构包括五个主要模块:资源网关负责数据访问,工具协调器管理工具调用,有状态会话服务器维护用户状态,代理聚合器整合多个服务,特定领域适配器实现特定功能。

关键创新:最重要的创新在于系统化地描述了MCP服务器的架构模式,填补了现有文献的空白,并提供了反模式和跨切关注点的指导。

关键设计:在设计中,重点关注身份验证、版本控制和可观察性等参数设置,以确保服务器的安全性和可维护性。

🖼️ 关键图片

fig_0
fig_1

📊 实验亮点

实验结果显示,分类一致性达到Cohen's kappa = 0.76,表明所提出的架构模式具有较高的可靠性。此外,工具选择准确性在10到15个工具的上下文中低于90%,揭示了在工具管理中的潜在挑战。

🎯 应用场景

该研究的潜在应用领域包括语音助手、智能客服和其他需要与外部工具交互的LLM集成应用。通过标准化架构模式,开发者可以更高效地构建和维护这些系统,提升应用的可靠性和可扩展性,推动行业发展。

📄 摘要(原文)

The Model Context Protocol (MCP), introduced by Anthropic in November 2024, defines a standardized interface for connecting large language models (LLMs) to external tools, data sources, and services. Within months of release, hundreds of community-built MCP servers appeared on GitHub, but no software-maintenance literature has yet described how the ecosystem is being structured in production. This industry experience paper catalogues five recurring MCP server architectural patterns observed across an enumerated corpus of fifteen independently developed servers (five production servers from the ANSYR voice AI platform plus ten public servers from the official MCP registry): Resource Gateway, Tool Orchestrator, Stateful Session Server, Proxy Aggregator, and Domain-Specific Adapter. Each pattern is described in the structured form of Gamma et al.: context, problem, solution, and consequences. We also document four anti-patterns and a set of cross-cutting concerns around authentication, versioning, and observability. The quantitative evaluation contributes three measurements: inter-rater reliability of the taxonomy across two independent LLM raters on 54 held-out servers (Cohen's kappa = 0.76), which also localizes three pattern-boundary ambiguities; transport overhead measured end-to-end on loopback and modeled for cross-host paths; and a tool-count study showing tool-selection accuracy drops below 90% between 10 and 15 tools per context for Claude Haiku 4.5 and between 20 and 30 tools for Sonnet 4. Code, corpus, and prompts are released as a replication package.