Cached MCP server discovery is dropped after repeated connection failures instead of only on age.
What's wrong with this entry?
Cached results of discovering MCP servers (the external tool servers Claude Code connects to over the Model Context Protocol) are now dropped based on how often a server fails to answer, rather than purely on how old the entry is. A separate ceiling still bounds how long any entry can live, so a generous cache lifetime cannot keep a stale entry around indefinitely.
- The number of failed connections tolerated before an entry is discarded comes from the environment variable
MCP_DISCOVERY_CACHE_STRIKES, which defaults to 1 when unset or set to a value that is not positive, so out of the box a single failed dial drops the entry. MCP_DISCOVERY_CACHE_MAX_STALE_Sno longer ages entries out on its own; it now serves as an upper bound on the cache lifetime configured byMCP_DISCOVERY_CACHE_TTL_S, and is itself clamped to a built-in ceiling, so a very large TTL is silently reduced to that bound.- A failed-dial signal is emitted alongside the existing cache-adopt signal, so a cached server that cannot be reached is reported rather than quietly expiring.
MCP_DISCOVERY_CACHE_STRIKES, MCP_DISCOVERY_CACHE_MAX_STALE_S
Strings lifted out of the shipped bundle, so the claim above can be checked against them.