Preflight Checklist
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"
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 #424 (comment)
Preflight Checklist
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
Steps to Reproduce
Output:
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 #424 (comment)