MCP Streamable HTTP: ~20% intermittent timeout on tool calls taking 300-500ms

Resolved 💬 3 comments Opened Apr 6, 2026 by vonsensey Closed May 20, 2026

Summary

Claude Code's MCP Streamable HTTP client intermittently times out on tool calls that complete successfully on the server side (~20% failure rate). The same MCP server, endpoint, and payloads work 92-100% reliably through other MCP clients (factory.ai Droid IDE across 8 different AI models) and 100% through direct REST API calls.

Environment

  • Claude Code CLI v2.1.92
  • OS: Linux 6.19.10-arch1-1 (Arch Linux)
  • Tested in: Cursor IDE terminal AND standalone terminal (same results)
  • MCP server: Custom Laravel MCP endpoint (Streamable HTTP transport)
  • Server response time: p50 322ms, p95 437ms

Reproduction

  1. Configure an MCP server with a tool that takes 300-500ms to respond
  2. Call the tool 10+ times sequentially
  3. ~2 out of 10 calls fail with: Streamable HTTP error: Error POSTing to endpoint: Gateway Timeout
  4. Retrying the failed call immediately succeeds

Evidence: 10-Client Controlled Benchmark

We ran 27 identical MCP operations across 10 client configurations (same server, same payloads):

| # | Model | MCP Client | Writes (20) | Total (27) | Rate |
|---|-------|------------|-------------|------------|------|
| 1 | Claude Opus 4.6 | Droid (factory.ai) | 20/20 | 27/27 | 100% |
| 2 | Claude Sonnet 4.6 | Droid (factory.ai) | 20/20 | 27/27 | 100% |
| 3 | GPT-5.4 | Droid (factory.ai) | 20/20 | 27/27 | 100% |
| 4 | Kimi K2.5 | Droid (factory.ai) | 19/20 | 26/27 | 96.3% |
| 5 | GLM-5 | Droid (factory.ai) | 19/20 | 26/27 | 96.3% |
| 6 | MiniMax M2.5 | Droid (factory.ai) | 19/20 | 25/27 | 92.6% |
| 7 | Gemini 3.1 Pro | Droid (factory.ai) | 19/20 | 25/27 | 92.6% |
| 8 | GPT-5.3 Codex | Droid (under load) | 18/20 | 23/27 | 85.2% |
| — | N/A | REST API (curl) | 10/10 | 23/23 | 100% |
| 9 | Claude Opus 4.6 | Claude Code CLI (Cursor) | ~8/10 | — | ~80% |
| 10 | Claude Opus 4.6 | Claude Code CLI (Terminal) | ~8/10 | — | ~75% |

Key findings:

  • Same model (Claude Opus), different client: 100% in Droid vs 75-80% in Claude Code CLI
  • Claude Code CLI is the worst performer — even the cheapest model (MiniMax M2.5) in Droid outperforms it
  • Cursor vs Terminal identical — eliminates IDE as a factor
  • REST API always 100% — server is not the bottleneck
  • Failures are random — no pattern by content type or operation

Error Message

Streamable HTTP error: Error POSTing to endpoint: Gateway Timeout

No additional debug info provided (was the request sent? did the connection fail? did the server return 504?).

Impact

Developers using Claude Code with MCP servers that respond in 300-500ms experience ~20% tool call failures. We spent a full day investigating server-side before isolating the client as the cause.

Suggested Investigation

  1. Check Streamable HTTP client timeout — may be too aggressive for 300-500ms responses
  2. Check connection keep-alive / pooling — intermittent pattern suggests connection reuse issues
  3. Compare with factory.ai Droid's MCP client which handles identical requests at 92-100%

View original on GitHub ↗

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