MCP Tool Search: Claude Code Lazy Loading for 95% Context Reduction
Configure enable_tool_search for Claude Code MCP lazy loading. Reduce context usage by 95% with MCP Tool Search and optimize your context window.
Problem: Your MCP servers are eating your context window alive. With 7+ servers configured, you're losing 50-70% of your 200K context before writing a single prompt. Complex tasks become impossible when you start each session with only 60-90K tokens remaining.
Quick Win: Claude Code now automatically enables MCP Tool Search when your MCP tools would consume more than 10% of context. No configuration needed - it just works. Check your context usage with /context to see the difference.
What is MCP Tool Search?
MCP Tool Search is Claude Code's new lazy loading system for MCP servers. Instead of loading all tool definitions at session start, Claude Code loads a lightweight search index and fetches tool details on-demand when you actually need them.
Before MCP Tool Search:
After MCP Tool Search:
The difference is dramatic: 95% reduction in initial context consumption for users with multiple MCP servers.
How MCP Tool Search Works
MCP Tool Search activates automatically when your MCP tool descriptions would use more than 10% of your context window. When triggered:
- Registry Creation: Claude Code builds a lightweight index of tool names and descriptions
- On-Demand Loading: Tools load only when Claude determines they're needed for your request
- Intelligent Caching: Loaded tools stay available for the session duration
- Seamless Experience: MCP tools work exactly as before - no workflow changes required
The system analyzes your input, matches relevant keywords, and loads only the tools likely to help with your current task.
For MCP Server Builders
If you're building MCP servers, the server instructions field becomes critical with MCP Tool Search enabled. This field helps Claude know when to search for your tools.
Think of server instructions like skills - they tell Claude what capabilities your server provides and when to look for them:
Good server instructions should:
- Describe the server's capabilities clearly
- Include keywords users might use in prompts
- Specify when the tools should be activated
- Be concise but comprehensive
Checking Your Context Usage
Monitor how MCP Tool Search affects your context consumption:
With MCP Tool Search active, you'll see significantly lower initial token counts. As you work and Claude loads relevant tools, the count increases - but only for tools you actually use.
Configuration Options
MCP Tool Search works automatically, but you can influence its behavior through settings and commands.
Enable or Disable Tool Search
Control MCP Tool Search globally via your Claude Code settings:
Set enable_tool_search to false if you prefer all MCP tools loaded at session start (legacy behavior).
Per-Server Control
Disable for specific servers (if you always need certain tools immediately):
Force load specific tools when you know you'll need them:
Real-World Impact
The GitHub issue that drove this feature (#7336) documented the problem precisely:
| Resource | Before | After |
|---|---|---|
| MCP tools | 39.8k tokens (19.9%) | ~5k tokens (2.5%) |
| Available context | 92k tokens | 195k tokens |
| Usable for work | 46% | 97.5% |
Users with complex setups - database servers, GitHub integrations, browser automation, custom APIs - can now run full workloads without hitting context limits.
Compatibility Notes
MCP Tool Search works with all existing MCP servers. However, some considerations:
- Older servers: May work less efficiently if they lack good tool descriptions
- Custom servers: Add clear
serverInstructionsfor best results - High-frequency tools: Consider disabling MCP Tool Search for servers you use constantly
What This Enables
With 95% more available context, you can now:
- Run longer, more complex coding sessions
- Use more MCP servers simultaneously without penalty
- Maintain conversation history across extended workflows
- Execute multi-step tasks that previously hit context limits
Next Steps
Maximize your MCP setup with MCP Tool Search:
- Audit your servers: Run
/contextto see your current usage - Update server instructions: Add descriptive instructions to custom servers
- Explore more servers: Check our popular MCP servers guide - you can now run more without penalty
- Learn MCP fundamentals: Review MCP basics if you're new to the protocol
MCP Tool Search removes the primary constraint that limited MCP adoption. Configure the servers you need, and let Claude Code handle the context management automatically.
Last updated on