[BUG] MCP tool responses lost for long-running HTTP tools (works in Cursor, fails in Claude Code)

Resolved 💬 3 comments Opened Jan 16, 2026 by tony-nekola-silk Closed Jan 20, 2026

Description

Claude Code receives empty responses from MCP tools that take >60 seconds, even though the server successfully sends the response. The same tool, same server, same execution time works correctly in Cursor.

Evidence: Server Successfully Sends Response

Our MCP server logs prove the response IS sent:

13:55:40.734 - Request received (Claude Code, protocol 2025-11-25)
13:55:40.746 - Tool handler starts
13:56:54.783 - Backend returns 5021 bytes content
13:56:54.784 - HTTP 200 sent (status code logged)
13:56:54.784 - Body sent: 5251 bytes, more_body=false
13:56:54.784 - Request complete, response_started=true, elapsed=74049ms

The server sent 5251 bytes with HTTP 200. Claude Code received nothing.

Reproduction

| Client | Same Server | Same Tool | Duration | Result |
|--------|-------------|-----------|----------|--------|
| Claude Code 2.1.9 | ✅ | ✅ | 74s | ❌ Empty response |
| Cursor | ✅ | ✅ | 74s | ✅ Works |
| curl | ✅ | ✅ | 74s | ✅ Works |
| Python MCP client | ✅ | ✅ | 74s | ✅ Works |

Environment

  • Claude Code version: 2.1.9
  • OS: Linux 6.8.0-85-generic
  • MCP Transport: Streamable HTTP
  • MCP Protocol: 2025-11-25
  • Server: Custom MCP gateway (mcp-sdk 1.25.0, Python)

Attempted Workarounds (None Worked)

1. MCP_TOOL_TIMEOUT environment variable

{
  "env": {
    "MCP_TIMEOUT": "120000",
    "MCP_TOOL_TIMEOUT": "600000"
  }
}

Result: No effect. Claude Code still receives empty response.

2. Different stateless/stateful configurations

Tried both stateless=True and stateless=False on server side - same behavior.

What This Rules Out

  • ❌ Server not sending response (logs prove it sends 5251 bytes)
  • ❌ Backend failure (analysis completes successfully)
  • ❌ Network issues (Cursor works on same machine, same server)
  • ❌ Timeout configuration (env vars had no effect)

Likely Cause

Something in Claude Code's MCP HTTP client either:

  1. Disconnects before the response arrives (after ~60s?)
  2. Fails to read the response body after a delay
  3. Has a timeout that ignores MCP_TOOL_TIMEOUT configuration

The fact that Cursor works with identical conditions strongly suggests this is a Claude Code client-specific issue.

Related Issues

  • #17662 - MCP_TOOL_TIMEOUT not respected for long-running HTTP tool calls
  • #16837 - Claude code does not obey values of MCP_TIMEOUT longer than 60 seconds
  • #470 - resetTimeoutOnProgress request (closed as NOT_PLANNED)

Impact

Any MCP tool that takes >60 seconds is unusable in Claude Code, even when the server correctly processes and returns the response. This affects AI-powered analysis tools, code generation, and other long-running operations.

View original on GitHub ↗

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