環境変数

MCP_DISCOVERY_CACHE_TTL_S

キャッシュのエントリを、バックグラウンド更新を行わずにそのまま使用する期間(秒)を設定します。

使い方・用途

  • デフォルト値: 900。
  • この値を超えると、キャッシュを使用しつつバックグラウンドで更新を試みます。
  • MCP_DISCOVERY_CACHE_MAX_STALE_S を超えるとキャッシュは破棄されます(デフォルトでは 4 時間に制限されます)。
英語原文(公式ドキュメントより)

Seconds for which Claude Code uses a discovery-cache entry without refreshing it (default: 900). At a start where the entry is older than that, Claude Code still uses it but refreshes it in the background. Once the entry is older than MCP_DISCOVERY_CACHE_MAX_STALE_S, Claude Code discards it instead. Claude Code caps the value at MCP_DISCOVERY_CACHE_MAX_STALE_S, which is 4 hours by default. Before v2.1.238, Claude Code didn't cap the value