環境変数

MCP_TOOL_TIMEOUT

MCP ツール実行のタイムアウト (ミリ秒) (デフォルト: 100000000、約 28 時間)。HTTP、SSE、claude.ai コネクタのサーバーでは、各リクエストはデフォルトで 60 秒後にもタイムアウトする。この変数またはサーバーごとのタイムアウトを 60000 より大きく設定すると、このリクエストごとの上限を引き上げられる。それより低い値にしても全体のツール実行タイムアウトは短縮されるが、リクエストごとの上限は 60 秒のままになる。stdio と WebSocket サーバーにはリクエストごとのタイマーはない。.mcp.json のサーバーごとの timeout フィールドは、そのサーバーに対してこの値を上書きする。1000 以上のサーバーごとのタイムアウトは、そのサーバーのツール呼び出しの最小アイドル時間も設定するため、CLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUT がそれより早く中断することはない。この下限には Claude Code v2.1.203 以降が必要。環境変数の場合は 1000 未満の値は 1 秒に切り上げられ、サーバーごとのフィールドの場合は 1000 未満の値は無視される

使い方・用途

  • 長時間かかるMCPツール呼び出しが既定のタイムアウトで中断されるのを避けたい場合に、全体のツール実行タイムアウトを調整するために設定する。
  • HTTP・SSE・claude.aiコネクタのサーバーで1リクエストあたり60秒の制限を引き上げたい場合に、60000より大きい値を設定して対応する。
  • .mcp.jsonの各サーバーにtimeoutフィールドを書かずに、環境変数一括でツール実行タイムアウトを管理したい場合に利用する。
英語原文(公式ドキュメントより)

Timeout in milliseconds for MCP tool execution (default: 100000000, about 28 hours). For an HTTP, SSE, or claude.ai connector server, each request also times out after 60 seconds by default; set this variable, or the per-server timeout, above 60000 to raise that per-request limit. A lower value still shortens the overall tool-execution timeout but leaves the per-request limit at 60 seconds. Stdio and WebSocket servers have no per-request timer. A per-server timeout field in .mcp.json overrides this for that server. A per-server timeout of at least 1000 also sets the minimum idle window for that server's tool calls, so CLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUT never aborts them sooner; this floor requires Claude Code v2.1.203 or later. For the env variable, values below 1000 are floored to one second; for the per-server field, values below 1000 are ignored

関連ドキュメント

関連する変更履歴

v2.1.162(1件)

Fixed
MCP サーバーごとの timeout 設定で 1000ms 未満の値が 1 秒として処理され、全ツールが強制終了していた問題を修正しました。1000ms 未満の設定は無視されデフォルト値が使用されるようになります
英語原文を表示
Fixed MCP per-server timeout config values below 1000 ms being floored to a 1-second watchdog that aborted every tool call; sub-1000 ms values are now ignored (falling back to MCP_TOOL_TIMEOUT or default), and claude mcp get annotates them accordingly

変更後

誤った設定によるツールの全滅を防ぎつつ、claude mcp get で設定の問題を把握できるため、安定した MCP 連携を維持できます。

関連ドキュメント

v2.1.142(1件)

Fixed
環境変数 MCP_TOOL_TIMEOUT がリモート HTTP および SSE 形式の MCP サーバーに対しても適用されるよう修正
英語原文を表示
Fixed MCP_TOOL_TIMEOUT not raising the per-request fetch timeout for remote HTTP and SSE MCP servers, which capped tool calls at 60 seconds regardless of the configured value

変更後

複雑なデータ処理やネットワーク越しの重いタスクを実行する MCP ツールの安定性が向上します。

関連ドキュメント

v1.0.8(1件)

Fixed
Fixed edge cases where MCP_TIMEOUT and MCP_TOOL_TIMEOUT weren't being respected