Hybrid Semantic Tool Discovery for Enterprise MCP Gateway: Architecture and Implementation
作者: Olympia Saha, Amy Wang, Srinivasan Manoharan
分类: cs.IR, cs.AI
发布日期: 2026-08-25
💡 一句话要点
提出SCOUT以解决MCP工具发现与上下文饱和问题
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 大型语言模型 工具发现 上下文优化 MCP协议 企业应用 混合检索 推理成本
📋 核心要点
- 现有方法在处理工具发现时面临上下文饱和和工具选择困难,导致效率低下。
- SCOUT通过选择性注入相关工具,优化上下文使用,解决了工具发现和上下文饱和问题。
- 在PayPal的实际应用中,SCOUT将MCP工具令牌消耗从140.2k减少到1.3k,降低了99%的推理成本。
📝 摘要(中文)
大型语言模型(LLM)代理通过调用外部工具来获取超出预训练知识的信息。模型上下文协议(MCP)标准化了这些工具的呈现方式,但在实际应用中面临上下文工程瓶颈和工具发现障碍。为了解决这些问题,本文提出了SCOUT(选择性上下文优化工具),通过仅注入与当前步骤相关的工具来优化上下文使用。SCOUT引入了两个MCP元工具——tool_search和execute_tool,其中tool_search结合BM25稀疏匹配与密集向量搜索,利用互惠排名融合返回最相关的工具。该方法在PayPal的生产环境中有效减少了MCP工具令牌消耗,显著降低了每次查询的推理成本。
🔬 方法详解
问题定义:本文旨在解决大型语言模型在调用外部工具时的上下文饱和和工具发现障碍。现有方法在处理超过2000个工具时,无法有效识别最佳工具,导致上下文窗口被工具模式占满。
核心思路:SCOUT的核心思想是将工具的暴露视为上下文选择问题,仅注入与当前步骤相关的工具,从而优化上下文使用。通过这种方式,SCOUT能够有效减少上下文的占用,提高工具的发现效率。
技术框架:SCOUT的整体架构包括两个主要模块:tool_search和execute_tool。tool_search负责执行混合检索,结合BM25稀疏匹配和密集向量搜索,通过互惠排名融合返回最相关的工具。execute_tool则用于执行选定的工具。
关键创新:SCOUT的主要创新在于其选择性上下文优化策略,通过动态注入相关工具,解决了上下文饱和和工具发现的双重挑战。这一方法与传统的工具调用方式有本质区别,后者通常会在上下文中加载所有工具。
关键设计:SCOUT的设计包括零停机时间的目录更新管道,确保工具的实时更新。此外,SCOUT作为标准MCP工具呈现,具有模型无关性,无需客户端修改。
🖼️ 关键图片
📊 实验亮点
SCOUT在PayPal的实际应用中,成功将MCP工具令牌消耗从140.2k减少到1.3k,降低了99%的推理成本。这一显著的性能提升证明了SCOUT在处理工具发现和上下文管理方面的有效性,为企业级应用提供了强有力的支持。
🎯 应用场景
SCOUT的研究成果在企业级应用中具有广泛的潜在价值,尤其是在需要调用大量外部工具的场景中,如金融服务、电子商务和客户支持等领域。通过优化上下文使用和工具发现,SCOUT能够显著提高系统的响应速度和效率,降低运营成本,推动智能代理技术的发展。
📄 摘要(原文)
Large language model (LLM) agents invoke external tools to retrieve and reason over information beyond pretrained knowledge. The Model Context Protocol (MCP) standardizes how such tools are surfaced, and a proxy MCP server aggregates many backend servers behind a single endpoint providing a secure, governable chokepoint for authentication, policy enforcement, and observability. This architecture creates two compounding challenges: a context-engineering bottleneck where full tool schemas saturate the model context window before any user query, and a tool discoverability barrier where users and agents cannot identify the best tool among 2,000+ indexed tools across 200+ MCP servers. Prompt caching reduces reprocessing cost but neither frees context capacity nor improves accuracy. We present SCOUT (Selective Context Optimization for Universal Tooling), which reframes tool exposure as a context-selection problem, injecting only tools relevant to the current step. SCOUT surfaces two MCP meta-tools -- tool_search and execute_tool -- where tool_search performs hybrid retrieval, fusing BM25 sparse matching with dense vector search via Reciprocal Rank Fusion to return the top-k relevant tools. Backed by zero-downtime catalog update pipelines, SCOUT resolves both context saturation and tool discovery challenges. In production at PayPal, SCOUT reduces MCP tool-token consumption from 140.2k tokens (70.1% of context) to 1.3k tokens (0.8%), a 99% reduction, cutting per-query inference cost at enterprise scale. Because SCOUT is surfaced as standard MCP tools, it is model-agnostic and requires no client-side modifications.