claude-code - 💡(How to fix) Fix [BUG] Cowork Gmail/Outlook MCP connectors lose auth state, require disconnect-reconnect cycles repeatedly [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#55634Fetched 2026-05-03 04:48:21
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Participants
Timeline (top)
labeled ×5

Error Message

(b) Token expiration should be handled silently with refresh, not surfaced as a connection error

Error Messages/Logs

Gmail: "auth/connection error" (connector shows in disconnected state in Settings) Outlook: "infrastructure error (not enabled for REST API)" — recurring even though connector worked previously Outlook: returns no results when account state is degraded — silently empty results rather than explicit error in some cases (silent failure is its own bug variant) (b) Token expiration should be handled silently with refresh, not surfaced as a connection error

  • Does the MCP framework retry transient auth failures, or fail-and-disconnect on first error?

Root Cause

This may share root cause with Issue 1 — Cowork scheduler stalls. Both manifest as background services failing silently after uptime. If a parent process is leaking memory or losing handles, both could be downstream symptoms.

Code Example

Errors observed during MCP calls when connector is in failed state:

Gmail: "auth/connection error" (connector shows in disconnected state in Settings)
Outlook: "infrastructure error (not enabled for REST API)" — recurring even though connector worked previously
Outlook: returns no results when account state is degraded — silently empty results rather than explicit error in some cases (silent failure is its own bug variant)

User cannot access deeper logs — MCP server-side logs not exposed to end users.

If Anthropic has access to MCP server logs filtered to user's account, the disconnect events would be in the OAuth refresh / token-validate handlers.
RAW_BUFFERClick to expand / collapse

Preflight Checklist

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

What's Wrong?

The Gmail and Outlook MCP connectors in Cowork periodically lose authentication / connection state and require the user to manually disconnect and reconnect (re-running OAuth) to restore access. This happens without user action and without explanation.

Environment

  • Affected connectors: Gmail MCP, Outlook MCP (Microsoft 365 mailbox)

What Should Happen?

Gmail and Outlook MCP connectors should maintain authentication state continuously without user intervention. Specifically:

(a) OAuth refresh tokens should be persisted correctly across Claude app restarts (b) Token expiration should be handled silently with refresh, not surfaced as a connection error (c) Transient network failures should retry with backoff, not fail-and-disconnect (d) If a connector does need re-authentication, the system should surface a clear notification and offer one-click re-auth, rather than requiring the user to manually navigate Settings → disconnect → reconnect

User shouldn't have to re-authenticate Gmail/Outlook multiple times per week during normal use.

Error Messages/Logs

Errors observed during MCP calls when connector is in failed state:

Gmail: "auth/connection error" (connector shows in disconnected state in Settings)
Outlook: "infrastructure error (not enabled for REST API)" — recurring even though connector worked previously
Outlook: returns no results when account state is degraded — silently empty results rather than explicit error in some cases (silent failure is its own bug variant)

User cannot access deeper logs — MCP server-side logs not exposed to end users.

If Anthropic has access to MCP server logs filtered to user's account, the disconnect events would be in the OAuth refresh / token-validate handlers.

Steps to Reproduce

Gmail and Outlook MCP connectors should maintain authentication state continuously without user intervention. Specifically:

(a) OAuth refresh tokens should be persisted correctly across Claude app restarts (b) Token expiration should be handled silently with refresh, not surfaced as a connection error (c) Transient network failures should retry with backoff, not fail-and-disconnect (d) If a connector does need re-authentication, the system should surface a clear notification and offer one-click re-auth, rather than requiring the user to manually navigate Settings → disconnect → reconnect

User shouldn't have to re-authenticate Gmail/Outlook multiple times per week during normal use.

Claude Model

Not sure / Multiple models

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

Claude 1.5354.0 (9a9e3d) 2026-04-29T01:14:34.000Z

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

Frequency

"Quite often" — happens repeatedly throughout normal use. User estimates multiple times per week.

Possible relationship to other bugs

This may share root cause with Issue 1 — Cowork scheduler stalls. Both manifest as background services failing silently after uptime. If a parent process is leaking memory or losing handles, both could be downstream symptoms.

Impact

  • Disrupts hourly-email-triage scheduled task (likely silently fails when connector is disconnected, contributing to perceived "scheduler stall")
  • User has to interrupt active work to manually re-authorize
  • Trust degradation: user can't rely on email auto-monitoring

Suggested investigation

  • Are Gmail/Outlook OAuth refresh tokens persisted correctly across Claude app restarts?
  • Is there a token-expiration handler that fails silently?
  • Is one connector (Gmail vs Outlook) more prone than the other?
  • Logs from MCP server processes during a disconnect event would help — can users access these?
  • Does the MCP framework retry transient auth failures, or fail-and-disconnect on first error?

### Labels
`bug`, `cowork`, `mcp`, `gmail`, `outlook`, `oauth`

extent analysis

TL;DR

The most likely fix involves ensuring OAuth refresh tokens are persisted correctly across Claude app restarts and implementing a silent token-expiration handler with retry mechanism for transient auth failures.

Guidance

  • Investigate OAuth refresh token persistence across Claude app restarts to prevent authentication loss.
  • Implement a token-expiration handler that silently refreshes tokens instead of surfacing connection errors.
  • Verify if the MCP framework retries transient auth failures with backoff or fails and disconnects on the first error, and adjust accordingly.
  • Check if one connector (Gmail vs Outlook) is more prone to disconnections than the other to identify specific issues.

Example

No specific code snippet can be provided without more details on the implementation, but ensuring token persistence and silent refresh can be achieved through proper handling of OAuth token storage and refresh mechanisms.

Notes

The exact implementation details depend on the specific OAuth library and framework used by the Claude app. Understanding the MCP server logs during disconnect events could provide crucial insights but requires access to these logs.

Recommendation

Apply a workaround by modifying the OAuth token handling to persist tokens correctly and implement silent refresh with retry for transient failures, as the root cause seems related to token management and error handling rather than a version-specific issue.

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

claude-code - 💡(How to fix) Fix [BUG] Cowork Gmail/Outlook MCP connectors lose auth state, require disconnect-reconnect cycles repeatedly [1 participants]