SCOUT通过智能筛选工具,让大模型在企业级系统中高效调用2000+工具。
Hybrid Semantic Tool Discovery for Enterprise MCP Gateway: Architecture and Implementation
- 将工具调用转为上下文选择问题,仅注入相关工具以节省内存。
- 在PayPal生产环境实现99%的工具令牌消耗降低,从140.2k降至1.3k。
- 无需修改客户端,兼容所有模型,适合大规模企业部署。
大型语言模型代理需要调用外部工具以获取预训练知识之外的信息。模型上下文协议(MCP)标准化了工具的暴露方式,而代理MCP服务器将多个后端服务聚合到单一入口,提供安全、可控的认证、策略执行和可观测性节点。该架构带来两个叠加挑战:上下文工程瓶颈——完整工具模式在用户查询前就占满模型上下文窗口;工具可发现性障碍——用户与代理难以在200多个MCP服务器上的2000多个工具中找到最优选项。提示缓存虽降低重复计算成本,但无法释放上下文容量或提升准确性。本文提出SCOUT(通用工具的有选择性上下文优化),将工具暴露重构为上下文选择问题,仅注入当前步骤相关的工具。SCOUT提供两个MCP元工具——tool_search与execute_tool,其中tool_search采用混合检索:结合BM25稀疏匹配与密集向量搜索,通过倒数排名融合返回前k个相关工具。依托零停机目录更新流水线,SCOUT同时解决上下文饱和与工具发现难题。在PayPal生产环境中,SCOUT将工具令牌消耗从140.2千(占上下文70.1%)降至1.3千(0.8%),减少99%,显著降低企业规模下的每查询推理成本。由于SCOUT作为标准MCP工具暴露,具备模型无关性,无需客户端修改。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。