Claude Code (New Lazy-MCP Loading): They FINALLY FIXED the BIGGEST ISSUE of CLAUDE CODE!
By AICodeKing
MCP Tool Search in Claude Code: A Detailed Overview
Key Concepts:
- MCP (Model Context Protocol): A system for connecting Claude to external tools and data sources like databases, APIs, and file systems.
- Context Window: The limited amount of text Claude can process at once, measured in tokens.
- Tool Definitions: The descriptions of tools available through MCP, which consume tokens when loaded into the context window.
- MCP Tool Search: A new feature that dynamically loads tools on demand, reducing context window usage.
- Defer Loading: A setting to prevent tools from being loaded into the context window until explicitly needed.
- BM25: A ranking function used for information retrieval, employed in one variant of the tool search.
- Reject Patterns: A method used in the tool search to identify relevant tools by excluding those that don't match specific criteria.
- Similarity Search: The underlying mechanism used to find relevant tools based on keywords.
The Problem: Context Window Saturation with MCP
The primary issue addressed in this video concerns the escalating consumption of Claude’s context window when utilizing multiple MCP servers. Each MCP server contributes its tool definitions to the context, rapidly depleting available tokens before any actual prompting occurs. The speaker highlights reports of users experiencing 67,000 token usage simply from tool definitions with seven or more MCP servers active. Given a typical context window of around 200,000 tokens, this represents a significant loss – approximately one-third of the available space – dedicated solely to tool descriptions, hindering effective task execution.
Beyond token usage, the video explains that an excessive number of available tools (over 30-50) demonstrably decreases Claude’s ability to select the most appropriate tool for a given task, impacting performance. Research supports this claim, indicating a degradation in tool selection accuracy with increased tool availability.
Introducing MCP Tool Search: Dynamic Tool Loading
Anthropic has introduced MCP Tool Search to mitigate these issues. This feature fundamentally alters how Claude interacts with MCP tools. Instead of pre-loading all tool definitions into the context window, Claude now dynamically discovers and loads tools only when needed. The system triggers a search-based approach when tool descriptions would exceed 10% of the context window.
This on-demand loading is achieved through a similarity search tool operating client-side. When a task requires a tool, Claude searches a tool catalog using keywords and loads only the relevant tools into the context. This contrasts sharply with the previous method, where all tools were loaded regardless of relevance.
Performance Gains: Token Savings and Accuracy Improvements
The performance improvements offered by MCP Tool Search are substantial. Anthropic’s data reveals a preservation of approximately 191,300 tokens compared to the 122,800 tokens consumed by the traditional approach – an 85% reduction in token usage. This allows for more complex prompts and larger datasets to be processed within the context window.
Furthermore, the feature demonstrably improves tool selection accuracy. Internal testing showed Opus 4’s accuracy on MCP evaluations increased from 49% to 74%, while Opus 4.5 improved from 79.5% to 88.1% when utilizing the tool search with large tool libraries. This represents a significant enhancement in Claude’s ability to effectively leverage its connected tools.
Technical Implementation & Variants
The tool search functionality utilizes a client-side similarity search tool. This tool accepts keywords as input and returns a list of matching tool names. Crucially, it operates within Claude’s agent loop, enabling iterative searches, keyword refinement, and parallel calls to identify the optimal tools.
Two variants of the tool search are available:
- Reject Patterns: Claude constructs patterns to exclude irrelevant tools, focusing the search on those that match desired criteria (e.g., searching for "weather" or "get data").
- BM25: A ranking function that allows Claude to use natural language queries to search for tools, providing a more flexible and intuitive search experience.
The video recommends utilizing the “defer loading” setting (set to true) for tools that are not frequently used. This prevents them from being loaded into the context window initially, further optimizing token usage. It suggests keeping 3-5 frequently used tools non-deferred for immediate access.
Integration and Current Status
MCP Tool Search is currently in public beta and requires the use of a beta header in API requests. It is compatible with Claude Opus 4.5 and Claude Sonnet 4.5 on the main API, as well as Google Cloud’s Vertex AI and Amazon Bedrock.
For Claude Code specifically, the feature is automatically enabled when a large number of MCP tools are detected, requiring no manual configuration. Prompt caching is also supported, allowing Claude to reuse previously discovered tools in subsequent turns of a conversation, enhancing efficiency.
Real-World Application & Personal Workflow
The speaker shares a personal example of how this feature impacts their workflow. Previously, they maintained separate Claude Code instances with distinct MCP configurations to avoid context overflow when working with tools like Verdant (a graphical coding environment). They used separate coders to manage different sets of tools for frontend and backend tasks. With MCP Tool Search, this separation is no longer necessary, streamlining their development process.
Conclusion: A Significant Advancement for the MCP Ecosystem
The speaker concludes that MCP Tool Search is a substantial improvement to the MCP and Claude Code ecosystem, addressing a long-standing community request for lazy loading of MCP servers. With Claude Code reportedly used by 115,000 developers weekly and generating a billion-dollar annualized run rate, Anthropic’s responsiveness to user feedback is particularly noteworthy. The feature empowers developers to connect Claude to a wider range of databases and services without the constraints of context window limitations, representing a significant step forward in the capabilities of the platform.
Notable Quote:
“It was actually the most requested feature on their GitHub and they finally implemented it. People have been asking for lazy loading on MCP servers for a long time and this is essentially what this feature provides.” – The speaker, emphasizing the community-driven nature of this improvement.
Chat with this Video
AI-PoweredLoad the transcript when you're ready to chat so the initial page stays lighter.
Related Videos

AI System Design: From Idea to Production - Apoorva Joshi, MongoDB
AI Engineer

When All Context Matters: Extended Cache Augmented Generation - Luis Romero-Sevilla, Orbis
AI Engineer

Bypassing the Multimodal Tax: Hybrid RAG, SQL RRF & UI Telemetry - Abed Matini, Ogilvy
AI Engineer

OpenClaw in Your Hand: Building a Physical AI Terminal - Lech Kalinowski, Callstack
AI Engineer

GPT 5.6 Mythos Level Intelligence
Prompt Engineering

GPT 5.6 SOL: TBH, IT'S OKAY.. I have SERIOUS CONCERNS.
AICodeKing

Sakana Fugu Ultra BEATS Fable 5 & GPT-5.5? (Fully Tested)
WorldofAI