给LLM代理加个共享记忆库,让多个服务协作更高效。
Enhancing Model Context Protocol (MCP) with Context-Aware Server Collaboration
- 用共享上下文存储替代原有无状态设计,实现跨服务状态同步。
- 实验显示减少40%以上LLM调用次数,响应失败率下降显著。
- 适合构建复杂多代理系统,尤其需要长期协作的任务场景。
模型上下文协议(MCP)已成为支持大语言模型(LLM)代理与外部工具通信的通用框架。原始实现中,代理、模型与服务器均为无状态,无法访问全局上下文。针对需多代理协调的任务,我们提出上下文感知的MCP(CA-MCP),将执行逻辑移至能读写共享上下文内存的专用服务器,实现实时自主协同。通过维护中间状态和共享变量,上下文管理确保任务执行连续性,避免重复提示。在TravelPlanner(Yang et al., 2024)和REALM-Bench(Geng & Chang, 2025)基准上测试表明,CA-MCP显著降低复杂任务所需LLM调用次数,并减少因条件不满足导致的响应失败,统计学上具有显著优势。
原文摘要 · Abstract (English)
The Model Context Protocol (MCP) (MCP Community, 2025) has emerged as a widely used framework for enabling LLM-based agents to communicate with external tools and services. The original MCP implementation (Anthropic, 2024) relies on a Large Language Model (LLM) to decompose tasks and issue instructions to servers. In particular, the agents, models, and servers are stateless and do not have access to a global context. However, in tasks involving LLM-driven coordination, it is natural that a Shared Context Store (SCS) could improve the efficiency and coherence of multi-agent workflows by reducing redundancy and enabling knowledge transfer between servers. Thus, in this work, we design and assess the performance of a Context-Aware MCP (CA-MCP) that offloads execution logic to specialized MCP servers that read from and write to a shared context memory, allowing them to coordinate more autonomously in real time. In this design, context management serves as the central mechanism that maintains continuity across task executions by tracking intermediate states and shared variables, thereby enabling persistent collaboration among agents without repeated prompting. We present experiments showing that the CA-MCP can outperform the traditional MCP by reducing the number of LLM calls required for complex tasks and decreasing the frequency of response failures when task conditions are not satisfied. In particular, we conducted experiments on the TravelPlanner (Yang et al., 2024) and REALM-Bench (Geng & Chang, 2025) benchmark datasets and observed statistically significant results indicating the potential advantages of incorporating a shared context store via CA-MCP in LLM-driven multi-agent systems.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。