Problem
MCP tool calls that take longer than ~30-60 seconds fail with socket hang up errors. This affects any MCP server with long-running operations, most notably Google Stitch (generate_screen_from_text takes 2-10 minutes) but also any AI generation, build, or processing tool.
The MCP_TIMEOUT env var only controls startup timeout, not tool call execution timeout. There is currently no way to configure the tool call socket timeout.
Evidence
This has been reported 6+ times across different issues and platforms. Each time it's closed as stale without a fix.
Reproduction
- Configure any MCP server with a tool that takes >60 seconds
- Call the tool from Claude Code
- After ~30-60s:
Error: Network error: socket hang up
Specific example with Google Stitch MCP:
mcp__stitch__generate_screen_from_text → socket hang up (every time, 8+ attempts)
mcp__stitch__list_projects → works fine (fast operation)
mcp__stitch__list_screens → works fine (fast operation)
Proposed Solution
Add a configurable MCP_TOOL_TIMEOUT environment variable that controls the socket timeout for MCP tool call execution (not just startup).
# Example: set 10-minute timeout for tool calls
MCP_TOOL_TIMEOUT=600000 claude
Or per-server in settings:
{
"mcpServers": {
"stitch": {
"command": "stitch-mcp",
"timeout": 600000
}
}
}
Current Workaround
The only working workaround is using a proxy server that implements polling-based recovery when the connection drops (e.g., obinnaokechukwu/stitch-mcp for Google Stitch specifically). This shouldn't be necessary — the timeout should be configurable in Claude Code itself.
Impact
This blocks usage of any MCP server with long-running operations, including:
- Google Stitch (UI generation)
- Build/CI tools
- AI image/video generation servers
- Database migration tools
- Any tool doing network-intensive work
Environment
- Claude Code latest (April 2026)
- macOS Darwin 25.3.0
- Affects all transports (stdio, SSE, HTTP)
Problem
MCP tool calls that take longer than ~30-60 seconds fail with
socket hang uperrors. This affects any MCP server with long-running operations, most notably Google Stitch (generate_screen_from_texttakes 2-10 minutes) but also any AI generation, build, or processing tool.The
MCP_TIMEOUTenv var only controls startup timeout, not tool call execution timeout. There is currently no way to configure the tool call socket timeout.Evidence
[BUG] mcp-cli only partially respects MCP_TOOL_TIMEOUT(closed as stale, not fixed)MCP_TOOL_TIMEOUT not respected for long-running HTTP tool callsClaude code does not obey values of MCP_TIMEOUT longer than 60 secondsMCP Server Timeout Configuration Ignored in Streamable SSE HTTP ConnectionsClaude Desktop MCP tool calls silently timeout after 4min on Windows[Feature Request] Make MCP tool timeouts configurableThis has been reported 6+ times across different issues and platforms. Each time it's closed as stale without a fix.
Reproduction
Error: Network error: socket hang upSpecific example with Google Stitch MCP:
Proposed Solution
Add a configurable
MCP_TOOL_TIMEOUTenvironment variable that controls the socket timeout for MCP tool call execution (not just startup).# Example: set 10-minute timeout for tool calls MCP_TOOL_TIMEOUT=600000 claudeOr per-server in settings:
{ "mcpServers": { "stitch": { "command": "stitch-mcp", "timeout": 600000 } } }Current Workaround
The only working workaround is using a proxy server that implements polling-based recovery when the connection drops (e.g., obinnaokechukwu/stitch-mcp for Google Stitch specifically). This shouldn't be necessary — the timeout should be configurable in Claude Code itself.
Impact
This blocks usage of any MCP server with long-running operations, including:
Environment