Skip to content

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

@marcindulak

Description

@marcindulak

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • 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:

grep -E 'timeout|sleep' ~/.claude/debug/54bfa90c-4134-48e4-a4d3-81368ead51f8.txt 
2026-01-08T10:50:33.576Z [DEBUG] MCP server "stt-mcp-server-linux": Starting connection with timeout of 100000ms
2026-01-08T10:50:33.583Z [DEBUG] MCP server "sleep": Starting connection with timeout of 100000ms
2026-01-08T10:51:33.602Z [DEBUG] MCP server "sleep": Connection failed after 60021ms: MCP error -32001: Request timed out
2026-01-08T10:51:33.603Z [ERROR] MCP server "sleep" Connection failed: MCP error -32001: Request timed out

Claude Model

Not sure / Multiple models

Is this a regression?

No, this never worked

Last Working Version

No response

Claude Code Version

2.1.1

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

This is a new instance of the #7575 issue, which was incorectly closed with "60 days of inactivity", despite human comments being present. This behavior of the autoclose bot is reported in #16497.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:mcpbugSomething isn't workinghas reproHas detailed reproduction stepsplatform:linuxIssue specifically occurs on Linux

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions