Persistent 502 Bad Gateway from mcp-proxy.anthropic.com — Gmail connector works in claude.ai chat but fails in Claude Code (VS Code extension)

Resolved 💬 4 comments Opened Apr 15, 2026 by rayns-ship-it Closed May 5, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Environment

Claude Code: VS Code extension (native)
OS: Windows 11 Home 10.0.26200
Region: Perth, Australia (APAC)
Organization ID: 01fbe21b-c66d-49a1-9180-84fe7f3c0dd3
Account: [rayns@rockcap.uk](mailto:rayns@rockcap.uk)
Model: claude-opus-4-6 (1M context)
Summary
Every call to a mcp__claude_ai_Gmail__* tool returns HTTP 502 Bad Gateway from mcp-proxy.anthropic.com. Intermittent but near-constant. Persisted ~2 days so far. The same Gmail connector works correctly when used directly in claude.ai chat — the failure is isolated to the Claude Code → MCP proxy route.

Steps to reproduce

Gmail connected via claude.ai → Settings → Connectors
In Claude Code, invoke any Gmail MCP tool (e.g. search_threads with query="newer_than:7d in:inbox")
Observe 502 Bad Gateway from mcp-proxy.anthropic.com
Expected
Tool returns thread list (as it does in claude.ai chat against the same account).

Actual

Streamable HTTP error: Error POSTing to endpoint
Title: mcp-proxy.anthropic.com | 502: Bad gateway
Error code 502
Evidence — Cloudflare Ray IDs / timestamps (all 2026-04-15 UTC)

9ec85754cf80120c — 04:52:34
9ec8578c583e120c — 04:52:43
9ec8632c9cea8ad0 — 05:00:40
9ec87683ffb9cffa — 05:13:52
9ec876c8ed4bcffa — 05:14:03
Diagnostic notes

Intermittent, appears payload-sensitive: one newer_than:1d call with pageSize:5 succeeded; all newer_than:3d/newer_than:7d calls (with pageSize 20 and 50) failed with 502.
The connector itself is healthy — works in claude.ai chat against the same Google account/scopes.
Started ~13 April 2026. EmailTriage project scaffolding that used the same Gmail MCP on that date worked successfully; failures began shortly after.
Already tried

Disconnect/reconnect Gmail connector in claude.ai Settings
Revoked Anthropic permissions at myaccount.google.com/permissions, re-authed with all scopes granted
VS Code restart
Status page checked — no active incident
Impact
Blocks daily email triage tooling built on the Gmail MCP connector in Claude Code. Workaround is to run triage manually in claude.ai chat, which defeats the purpose of the local VS Code-integrated workflow.

What Should Happen?

Gmail MCP tools in Claude Code (VS Code extension) should return results successfully — matching the behaviour of the same claude.ai Gmail connector when used directly in a claude.ai chat. Specifically, calls to mcp__claude_ai_Gmail__search_threads, get_thread, etc. should proxy through mcp-proxy.anthropic.com and return the Gmail API response, not a 502 Bad Gateway.

Error Messages/Logs

Streamable HTTP error: Error POSTing to endpoint:
<title>mcp-proxy.anthropic.com | 502: Bad gateway</title>
Error code 502
Host: mcp-proxy.anthropic.com — Error
Timestamp: 2026-04-15 05:14:03 UTC
Cloudflare Ray ID: 9ec876c8ed4bcffa

Additional Ray IDs from repeated failures (all 2026-04-15 UTC):
- 9ec85754cf80120c — 04:52:34
- 9ec8578c583e120c — 04:52:43
- 9ec8632c9cea8ad0 — 05:00:40
- 9ec87683ffb9cffa — 05:13:52

Earlier variant (auth scope error after fresh reconnect, before further retries reverted to 502):
{"jsonrpc":"2.0","result":{"content":[{"text":"Request had insufficient authentication scopes.","type":"text"}],"isError":true}}

Steps to Reproduce

  1. Connect Gmail via claude.ai → Settings → Connectors (OAuth completes successfully, all scopes granted).
  2. Open a Claude Code session in the VS Code extension, signed into the same account (rayns@rockcap.uk, Organization ID 01fbe21b-c66d-49a1-9180-84fe7f3c0dd3).
  3. Invoke any Gmail MCP tool, e.g. mcp__claude_ai_Gmail__search_threads with:

{ "query": "newer_than:7d in:inbox", "pageSize": 50 }

  1. Observe HTTP 502 Bad Gateway response from mcp-proxy.anthropic.com.
  2. For comparison, issue the equivalent request in a claude.ai web chat against the same account — it succeeds and returns threads normally.

Additional observation: the failure is intermittent and appears payload-sensitive. A single small request
(newer_than:1d, pageSize:5) returned data once; every retry at larger pageSize or wider date window
(3d / 7d) returned 502.

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

Unknown same extension/version worked on 13 April 2026 (Gmail MCP calls completed successfully that day when building an email-triage project). Failures began shortly after. Extension has not been manually downgraded or reinstalled since.

Claude Code Version

v2.1.109

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Terminal.app (macOS)

Additional Information

Key diagnostic: the same Gmail connector works correctly in claude.ai web chat with the same
account and scopes. The failure is isolated to the Claude Code → mcp-proxy.anthropic.com route.
This points to an issue in the proxy layer rather than the connector, OAuth grant, or Gmail API itself.

Already tried:

  • Full disconnect/reconnect of Gmail in claude.ai Settings → Connectors
  • Revoke at myaccount.google.com/permissions, fresh OAuth with all scopes ticked
  • VS Code restart
  • Anthropic status page: no active incident at time of failure

Account / region:

  • Organization ID: 01fbe21b-c66d-49a1-9180-84fe7f3c0dd3
  • Account email: rayns@rockcap.uk
  • Region: Perth, Australia (APAC)

View original on GitHub ↗

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