claude-code - 💡(How to fix) Fix MCP Google Drive OAuth flow redirects to claude.ai web instead of completing in CLI [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#48101Fetched 2026-04-15 06:33:11
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Participants
Timeline (top)
labeled ×4

When authenticating the claude.ai Google Drive MCP server from Claude Code CLI, the OAuth flow redirects to https://claude.ai/settings/mcp/auth_done?authed_mcp_server_id=... instead of a localhost callback URL that the CLI can capture.

Root Cause

When authenticating the claude.ai Google Drive MCP server from Claude Code CLI, the OAuth flow redirects to https://claude.ai/settings/mcp/auth_done?authed_mcp_server_id=... instead of a localhost callback URL that the CLI can capture.

RAW_BUFFERClick to expand / collapse

Description

When authenticating the claude.ai Google Drive MCP server from Claude Code CLI, the OAuth flow redirects to https://claude.ai/settings/mcp/auth_done?authed_mcp_server_id=... instead of a localhost callback URL that the CLI can capture.

Steps to Reproduce

  1. In Claude Code CLI, trigger Google Drive MCP authentication (e.g., try to read a Google Doc)
  2. The mcp__claude_ai_Google_Drive__authenticate tool tells the user to run /mcp and select "claude.ai Google Drive"
  3. User runs /mcp, selects Google Drive, completes OAuth in browser
  4. Browser redirects to https://claude.ai/settings/mcp/auth_done?authed_mcp_server_id=<id> — a web app page, not a localhost callback
  5. CLI never receives the auth callback

Expected Behavior

The OAuth flow should redirect to a localhost:<port>/callback?code=...&state=... URL so the CLI can complete the flow via complete_authentication. Alternatively, the /mcp OAuth flow in CLI should handle the token exchange directly.

Actual Behavior

  • authenticate tool says to run /mcp — no OAuth URL is provided directly
  • /mcp completes OAuth on the web side but the CLI has no record of the flow
  • complete_authentication fails with "No OAuth flow is in progress"
  • Google Drive MCP tools remain unavailable in the CLI session

Environment

  • Claude Code CLI (macOS, Darwin 24.6.0)
  • Model: Claude Opus 4.6 (1M context)
  • MCP server: claude.ai Google Drive (claudeai-proxy at https://drivemcp.googleapis.com/mcp/v1)

extent analysis

TL;DR

The OAuth flow for authenticating the claude.ai Google Drive MCP server from Claude Code CLI can be fixed by modifying the redirect URI to use a localhost callback URL.

Guidance

  • The issue is likely caused by the OAuth flow redirecting to a web app page (https://claude.ai/settings/mcp/auth_done) instead of a localhost callback URL that the CLI can capture.
  • To verify the issue, try modifying the OAuth flow to use a localhost callback URL and check if the CLI receives the auth callback.
  • The /mcp OAuth flow in CLI should be modified to handle the token exchange directly or provide the OAuth URL directly to the authenticate tool.
  • The complete_authentication function should be updated to handle the case where the OAuth flow is completed on the web side.

Example

No code snippet is provided as the issue does not contain enough information about the implementation details.

Notes

The solution may require modifications to the Claude Code CLI and/or the claude.ai Google Drive MCP server. The exact changes will depend on the implementation details of the OAuth flow and the CLI.

Recommendation

Apply a workaround by modifying the OAuth flow to use a localhost callback URL, as this is the most likely fix for the issue. This will allow the CLI to capture the auth callback and complete the authentication flow.

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