claude-code - 💡(How to fix) Fix [BUG] MCP OAuth tokens not refreshed for claude.ai proxy connections (mcp-proxy.anthropic.com) [1 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#46328Fetched 2026-04-11 06:23:11
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Participants
Timeline (top)
labeled ×4

Code Example

MCP server "claude.ai BigQuery": SSE transport closed/disconnected, attempting automatic reconnection
MCP server "claude.ai BigQuery": Using claude.ai proxy at https://mcp-proxy.anthropic.com/v1/mcp/...
MCP server "claude.ai BigQuery": SSE reconnection successful after 756ms (attempt 1)
RAW_BUFFERClick to expand / collapse

What's Wrong?

MCP servers connected via the claude.ai proxy (mcp-proxy.anthropic.com) never refresh OAuth tokens. When a token expires, the client reconnects the SSE transport to the proxy and reports success, but never initiates an OAuth refresh or reauth flow. The expired token is then sent on the next tool call, which fails at the upstream API.

Server logs show zero /token or /authorize requests after the expiry. Client debug logs confirm only a transport reconnection:

MCP server "claude.ai BigQuery": SSE transport closed/disconnected, attempting automatic reconnection
MCP server "claude.ai BigQuery": Using claude.ai proxy at https://mcp-proxy.anthropic.com/v1/mcp/...
MCP server "claude.ai BigQuery": SSE reconnection successful after 756ms (attempt 1)

No OAuth activity follows. The next tool call hits the upstream API with the stale token and fails.

Distinction from #5706

Token refresh was fixed for direct HTTP MCP connections in ~v2.1.59. This bug is specific to the claude.ai proxy path (claudeai-proxy transport), where the client delegates to mcp-proxy.anthropic.com instead of connecting to the server directly.

Related: #5706, #10250

Environment

  • Claude Code v2.1.100, macOS
  • MCP server: custom BigQuery server on Cloud Run (stateless_http=True, streamable-http)
  • Connected via claude.ai connectors page (marketplace)

extent analysis

TL;DR

The issue can be addressed by modifying the OAuth token refresh mechanism to work with the claude.ai proxy (mcp-proxy.anthropic.com) specifically for the claudeai-proxy transport.

Guidance

  • Investigate the OAuth token refresh implementation for the claudeai-proxy transport to identify why it's not initiating a refresh or reauth flow after token expiry.
  • Verify that the /token and /authorize endpoints are correctly configured and accessible for the claude.ai proxy.
  • Check the client debug logs for any errors or warnings related to OAuth token refresh that may indicate the root cause of the issue.
  • Consider updating the client to handle token refresh differently when connected via the claude.ai proxy, potentially by adding custom logic for this specific transport.

Example

No code snippet is provided due to the lack of specific implementation details in the issue.

Notes

The solution may require modifications to the client or server-side implementation, depending on where the OAuth token refresh logic is handled. The fix should ensure that the token refresh mechanism works correctly for both direct HTTP MCP connections and connections via the claude.ai proxy.

Recommendation

Apply a workaround by modifying the client to handle OAuth token refresh specifically for the claudeai-proxy transport, as the root cause of the issue seems to be related to the proxy connection. This workaround can be implemented until a more permanent fix is available.

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