[BUG] Claude code does not obey values of MCP_TIMEOUT longer than 60 seconds

Resolved 💬 8 comments Opened Sep 14, 2025 by marcindulak Closed Jan 8, 2026

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?

Claude code does not obey values of MCP_TIMEOUT longer than 60 seconds

What Should Happen?

Claude code should obey longer values of MCP_TIMEOUT. This is needed for MCP servers that have a long startup times, e.g. download some resources.

Error Messages/Logs

[DEBUG] MCP server "sleep": Starting connection with timeout of 100000ms
[DEBUG] MCP server "sleep": Connection failed after 60031ms: MCP error -32001: Request timed out

Steps to Reproduce

rm -rf /tmp/claude-60seconds-timeout
mkdir /tmp/claude-60seconds-timeout
cd /tmp/claude-60seconds-timeout
export MCP_TIMEOUT=100000 # 100 seconds
claude mcp remove sleep || true
claude mcp add sleep -- bash -c "sleep infinity"
claude mcp list --debug

Output:

Removed MCP server "sleep" from local config
File modified: /home/user/.claude.json [project: /tmp/claude-60seconds-timeout]
Added stdio MCP server sleep with command: bash -c sleep infinity to local config
File modified: /home/user/.claude.json [project: /tmp/claude-60seconds-timeout]
[DEBUG] Writing to temp file: /home/user/.claude.json.tmp.518189.1757834898685
[DEBUG] Preserving file permissions: 100664
[DEBUG] Temp file written successfully, size: 75128 bytes
[DEBUG] Applied original permissions to temp file
[DEBUG] Renaming /home/user/.claude.json.tmp.518189.1757834898685 to /home/user/.claude.json
[DEBUG] File /home/user/.claude.json written atomically
Checking MCP server health...

[DEBUG] MCP server "sleep": Starting connection with timeout of 100000ms
[DEBUG] MCP server "sleep": Connection failed after 60028ms: MCP error -32001: Request timed out
[ERROR] MCP server "sleep" Connection failed: MCP error -32001: Request timed out
sleep: bash -c sleep infinity - ✗ Failed to connect

Claude Model

Sonnet (default)

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

1.0.113 (Claude Code)

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Xterm

Additional Information

The problem with the ingored timeout value may be related to the hard-code timeout mentioned in https://github.com/anthropics/claude-code/issues/424#issuecomment-2722227863

View original on GitHub ↗

This issue has 8 comments on GitHub. Read the full discussion on GitHub ↗