arXiv(opens in a new tab)cs.IRAug 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2608.23992

Hybrid Semantic Tool Discovery for Enterprise MCP Gateway: Architecture and Implementation

Olympia Saha, Amy Wang, Srinivasan Manoharan

Abstract

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 through a uniform interface, and a proxy MCP server aggregates many backend servers behind a single endpoint providing the enterprise a secure, governable chokepoint for authentication, policy enforcement, and observability. This architecture, however, creates two compounding challenges. First, a context-engineering bottleneck: when tools span many servers, their full schemas are loaded at the start of every conversation, saturating the model's context window before any user query and increasing inference cost while degrading tool-selection accuracy. Second, a user-facing tool discoverability barrier: with more than 200 MCP servers and 2,000+ indexed tools, users and agents cannot practicably identify which server or tool best addresses a given task through manual catalog inspection. Prompt caching reduces reprocessing cost but neither frees context capacity nor improves accuracy, since the model still attends to the entire catalog on every query. We present SCOUT (Selective Context Optimization for Universal Tooling), which applies context engineering principles, reframing tool exposure as a context-selection problem, injecting only the tools relevant to the current step. SCOUT surfaces two synthetic MCP meta-tools, tool_search and execute_tool, where tool_search performs agentic RAG via hybrid retrieval, fusing BM25 sparse matching with dense vector search through Reciprocal Rank Fusion to return the top-k relevant tools. Backed by coordinated ingestion, refresh, and retrieval pipelines supporting zero-downtime catalog updates, SCOUT resolves both the context saturation problem and the tool discovery challenge, enabling efficient, scalable tool access across enterprise environments. In production deployment 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, directly 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, making it immediately applicable to any MCP-compatible agent framework.

Keywords: Model Context Protocol, Tool Discovery, Context Window Optimization, Hybrid Retrieval, Retrieval-Augmented Generation, LLM Agents, Tool Selection, Enterprise AI, Access Control, Agentic Systems

1 Introduction

Large language model (LLM) agents are increasingly deployed in enterprise settings where they must invoke external tools to retrieve real-time information, execute actions, and synthesize insights across heterogeneous data repositories. The Model Context Protocol (MCP) [1], introduced by Anthropic, provides a standardized JSON-RPC interface that connects LLMs to external data sources and services through a uniform tool-calling abstraction, enabling agents to invoke capabilities autonomously without bespoke integration code for each system. As MCP adoption accelerates across enterprise software ecosystems, tool catalogs will only grow larger, making scalable tool discovery an increasingly critical infrastructure challenge both for agents, which must select among thousands of candidate tool schemas per query, and for users, who cannot manually navigate a catalog of 200+ MCP servers to identify which capability best addresses their task.

In enterprise deployments, a proxy MCP server aggregates multiple backend MCP servers behind a single endpoint, presenting a unified tool namespace to agents while managing authentication, policy enforcement, and observability centrally. This architecture provides a secure and governable chokepoint for AI tool access at organizational scale. However, it introduces two compounding problems. The first is a context-engineering bottleneck: as the number of backend servers grows, the cumulative volume of tool schemas loaded at the start of every conversation rapidly saturates the model's context window before any user query has been processed, inflating inference costs and degrading tool-selection accuracy. Research has shown that LLM reasoning degrades when relevant information is buried among irrelevant content [9], a phenomenon that applies directly to tool selection when agents must choose among 2,000+ indexed tools. At PayPal, before SCOUT, every agent conversation began with 140.2k tokens already consumed by tool schemas, with 70% of the context window saturated before the first user message was processed. The second is a user-facing tool discoverability problem: with more than 200 MCP servers and 2,000+ tools in the catalog, users have no practical means of knowing which server hosts the capability they need or which specific tool to invoke. Manual catalog browsing is not viable at this scale. Natural language query is the only tractable interface for tool discovery in large enterprise catalogs.

Prompt caching partially alleviates the cost of reprocessing static tool schemas, but it does not reduce context window consumption or improve selection accuracy the model still attends to the full tool catalog on every query regardless of relevance. What is needed is not cheaper loading of all tools, but selective loading of the right tools.

We present SCOUT (Selective Context Optimization for Universal Tooling), a context engineering system that reframes tool exposure as a context-selection problem. Rather than returning all 2,000+ tool schemas on every tools/list request, SCOUT surfaces two synthetic MCP meta-tools, tool_search and execute_tool, that decouple discovery from execution. An agent first calls tool_search with a natural-language query to retrieve only the most relevant tool schemas, then calls execute_tool to route the invocation to the appropriate backend server. Because SCOUT is implemented as standard MCP tools, it is model-agnostic and requires no client-side modifications, making it immediately applicable to any MCP-compatible agent framework. We have validated SCOUT across six MCP clients spanning three major providers: Claude Code, Claude Desktop, ChatGPT (Web and Desktop), GitHub Copilot (VS Code), Cursor, and OpenAI Codex CLI.

In production deployment 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 that directly cuts per-query inference cost at enterprise scale. The main contributions of this paper are: (1) a meta-tool protocol that resolves both user-facing tool discoverability and LLM context saturation, embedding semantic tool search natively within the MCP tool-calling flow so users can find the right tool across 200+ MCP servers through natural language rather than manual catalog browsing, without any client-side modifications; (2) a hybrid retrieval engine combining BM25 sparse matching and dense vector search with Reciprocal Rank Fusion, optimized for structured tool document representations; (3) user-scoped authorization filtering that enforces enterprise access control boundaries at the retrieval layer; (4) zero-downtime index management via an insert-before-delete upsert strategy with graceful degradation to full tool lists under infrastructure failure; (5) environment-aware dual-connector routing that enables users to direct tool execution across production and development environments through natural language intent alone, with no manual toggling, client-side configuration, or protocol extensions required; and (6) validated deployment across six MCP clients spanning three major providers, Claude Code, Claude Desktop, ChatGPT (Web and Desktop), GitHub Copilot (VS Code), Cursor, and OpenAI Codex CLI, without any client-side modifications. The remainder of this paper is organized as follows. Section 2 surveys related work. Section 3 describes the AI Proxy platform. Section 4 formalizes the problem. Section 5 presents the system architecture. Section 6 details the implementation. Section 7 discusses broader implications and limitations. Section 8 concludes.

References (13)