claude-code - 💡(How to fix) Fix Sustained 502 Bad Gateway from mcp-proxy.anthropic.com (Gmail MCP) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#48277Fetched 2026-04-16 07:04:21
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
0
Timeline (top)
labeled ×4commented ×1cross-referenced ×1subscribed ×1

Error Message

The hosted Gmail MCP endpoint at mcp-proxy.anthropic.com has been returning Cloudflare 502 Bad Gateway errors for at least 2 hours. The Cloudflare error page flags the origin host (mcp-proxy.anthropic.com) as erroring, not Cloudflare itself.

  • Retries within seconds return the same error

Error details

RAW_BUFFERClick to expand / collapse

The hosted Gmail MCP endpoint at mcp-proxy.anthropic.com has been returning Cloudflare 502 Bad Gateway errors for at least 2 hours. The Cloudflare error page flags the origin host (mcp-proxy.anthropic.com) as erroring, not Cloudflare itself.

Behaviour

  • list_labels intermittently succeeds
  • search_threads consistently fails with 502
  • Retries within seconds return the same error
  • Earlier, an agent-based run died with ConnectionRefused against the API — may be related upstream instability

Error details

  • Cloudflare Ray IDs observed: 9ec84578087a1a6e, 9ec8453a0b701a6e
  • Approx start: ~2 hours before 2026-04-15 04:40 UTC
  • Region: AU (Melbourne edge)

Impact

Any workflow that chains multiple Gmail MCP calls fails partway. No client-side recovery possible.

Environment

  • Claude Code CLI v2.1.109
  • macOS
  • Hosted Gmail MCP integration

extent analysis

TL;DR

The issue can be mitigated by implementing retry logic with exponential backoff for the search_threads API call to handle intermittent Cloudflare 502 Bad Gateway errors.

Guidance

  • Investigate the search_threads API call to identify potential causes of the consistent 502 errors, such as payload size or query complexity.
  • Implement retry logic with exponential backoff for the search_threads API call to handle intermittent errors.
  • Verify the retry logic by testing the API call with a small payload and monitoring the response.
  • Consider implementing a circuit breaker pattern to detect and prevent further requests to the failing API endpoint.

Example

No code snippet is provided as the issue does not contain sufficient information about the API implementation.

Notes

The issue may be related to upstream instability, and the retry logic may not completely resolve the issue. Further investigation into the cause of the 502 errors is necessary.

Recommendation

Apply workaround: Implement retry logic with exponential backoff for the search_threads API call, as it can help mitigate the intermittent errors and improve the overall reliability of the system.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING