研究MCP协议如何影响大模型的性能与成本,发现上下文膨胀会显著增加开销。
Network and Systems Performance Characterization of MCP-Enabled LLM Agents
- 测量MCP交互中上下文长度对性能的影响
- 发现上下文膨胀使令牌消耗和成本大幅上升
- 建议并行调用工具和任务中断机制优化效率
模型上下文协议(MCP)近年来受到广泛关注,为大语言模型(LLMs)与外部工具和服务交互提供标准化方式,显著提升其能力。然而,MCP交互中包含系统提示、工具定义及上下文历史等大量信息,导致令牌使用量急剧增加。由于大模型服务商按令牌计费,这种扩展上下文会迅速推高成本,并加重服务端计算负载。本文对MCP增强型交互进行了全面的基于测量的分析,揭示了能力、性能与成本之间的权衡关系。我们研究了不同大模型和MCP配置对令牌效率、货币成本、任务完成时间及成功率等关键性能指标的影响,并提出潜在优化方案,包括启用并行工具调用和实现可靠的中断机制。这些发现为构建更高效、稳健且成本可控的MCP工作流提供了重要参考。
原文摘要 · Abstract (English)
Model Context Protocol (MCP) has recently gained increased attention within the AI community for providing a standardized way for large language models (LLMs) to interact with external tools and services, significantly enhancing their capabilities. However, the inclusion of extensive contextual information, including system prompts, MCP tool definitions, and context histories, in MCP-enabled LLM interactions, dramatically inflates token usage. Given that LLM providers charge based on tokens, these expanded contexts can quickly escalate monetary costs and increase the computational load on LLM services. This paper presents a comprehensive measurement-based analysis of MCP-enabled interactions with LLMs, revealing trade-offs between capability, performance, and cost. We explore how different LLM models and MCP configurations impact key performance metrics such as token efficiency, monetary cost, task completion times, and task success rates, and suggest potential optimizations, including enabling parallel tool calls and implementing robust task abort mechanisms. These findings provide useful insights for developing more efficient, robust, and cost-effective MCP-enabled workflows.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。