[BUG] MCPSearch not activating despite meeting 10% threshold (40k/200k tokens, 20%)
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
MCPSearch not activating despite meeting 10% threshold (40k/200k tokens, 20%)
Description
Expected Behavior:
According to the v2.1.7 changelog, when MCP tool descriptions exceed 10% of the context window, they should be automatically deferred and discovered via the MCPSearch tool instead of being loaded upfront.
Actual Behavior:
MCPSearch is not activating despite MCP tools consuming 40.1k tokens (20.0%) of a 200k context window—double the documented 10% threshold.
Environment
Version:
Claude Code 2.1.7 (native installation)
Model:
claude-sonnet-4-5-20250929
Platform:
macOS (Darwin 25.2.0)
Evidence
- Context Usage (from /context command):
Context window: 200k tokens
MCP tools: 40.1k tokens (20.0%)
10% threshold: 20k tokens
Actual percentage: 40.1k / 200k = 20.0%
- Feature Flag Status (from ~/.claude.json):
"cachedGrowthBookFeatures": {
"tengu_mcp_tool_search": true,
"tengu_tool_search_unsupported_models": null
}
- MCPSearch Tool Absence:
When running /context, no MCPSearch tool appears in the MCP tools list (169 tools total, but no MCPSearch).
- Settings Verification:
- MCPSearch is NOT in disallowedTools
- No MCP-related restrictions in settings
- Feature flag shows as true
MCP Servers Configured
Active servers:
- MCP_DOCKER (Docker gateway)
- kapture (browser automation)
- ai-pm (project management)
- plugin:context7
- plugin:episodic-memory
- graphiti
- n8n
- MCP_Docs
- claude-historian-mcp
- sequential-thinking
- claude-in-chrome
Disabled servers:
- home-assistant
- meraki
- unraid-mcp
- XcodeBuildMCP
- kali-tools
- paloalto
- obsidian
Changelog Reference
From ~/.claude/cache/changelog.md:
"Enabled MCP tool search auto mode by default for all users. When MCP tool descriptions exceed 10% of the context window, they are automatically deferred and discovered via the MCPSearch tool instead of being loaded upfront."
Configuration File Locations
Feature flags:
~/.claude.json (line 94: "tengu_mcp_tool_search": true)
Settings:
~/.claude/settings.json (no MCPSearch in disallowedTools)
MCP config:
~/.claude.json (lines 1766-1789: mcpServers configuration)
Steps I've Taken
- ✅ Verified version 2.1.7 is installed
- ✅ Confirmed feature flag is true
- ✅ Checked MCP tools consume 40.1k tokens (20%)
- ✅ Verified tengu_tool_search_unsupported_models: null
- ✅ Confirmed MCPSearch not in disallowedTools
- ✅ Tested with both Opus 4.5 and Sonnet 4.5 (same result)
- ✅ Started fresh sessions to trigger MCP reload
Additional Context
- Total MCP tools: 169 tools across 10+ servers
- Context breakdown shows clear 20% MCP tool usage
- All documented conditions appear to be met
- Feature appears to be client-side flagged but not server-side activated
What Should Happen?
According to the v2.1.7 changelog, when MCP tool descriptions exceed 10% of the context window, they should be automatically deferred and discovered via the MCPSearch tool instead of being loaded upfront.
Error Messages/Logs
Steps to Reproduce
- Install Claude Code version 2.1.7 (native installation)
- Configure multiple MCP servers in ~/.claude.json to create >40k tokens of tool definitions. Example minimal configuration:
"mcpServers": {
"MCP_DOCKER": {
"command": "docker",
"args": ["mcp", "gateway", "run"]
},
"kapture": {
"command": "npx",
"args": ["-y", "kapture-mcp@latest", "bridge"]
},
"sequential-thinking": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-sequential-thinking"]
},
"ai-pm": {
"command": "node",
"args": ["/path/to/ai-pm/server.js"]
}
}
- Verify feature flag is enabled (should be default in 2.1.7):
grep "tengu_mcp_tool_search" ~/.claude.json
- Expected: "tengu_mcp_tool_search": true
- Start Claude Code and create a new conversation
- Run the /context command to view context usage
- Observe the "MCP tools" section in the output
Expected Result:
- MCP tools should show significantly reduced token usage (~5-10k)
- MCPSearch tool should appear in the MCP tools list
- Most individual MCP tool definitions should be deferred
Actual Result:
- MCP tools show 40.1k tokens (20.0% of context)
- No MCPSearch tool in the tools list
- All 169 MCP tools loaded upfront
Note: The issue occurs regardless of which model is selected (Opus 4.5 or Sonnet 4.5) and persists across fresh sessions.
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
Claude Code 2.1.7 (native installation)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
_No response_
This issue has 8 comments on GitHub. Read the full discussion on GitHub ↗