claude-code - 💡(How to fix) Fix [BUG] Gmail MCP integration uses Google Drive OAuth client — cannot grant Gmail permissions

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…

Error Message

  1. Get "requires re-authorization" error

Error Messages/Logs

  1. Get "requires re-authorization" error

Root Cause

Root Cause (suspected)

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?

Bug Description

The built-in Gmail MCP server (gmailmcp.googleapis.com) consistently routes through the "Claude for Google Drive" OAuth client instead of a Gmail-specific OAuth client. This means the authorization flow can never grant Gmail API scopes, making the Gmail MCP permanently non-functional.

Steps to Reproduce

  1. Use Claude Code with the built-in Gmail MCP integration
  2. Call any Gmail tool (e.g., list_labels, create_draft)
  3. Get "requires re-authorization" error
  4. Call mcp__Gmail__authenticate — receive an auth URL
  5. Open the auth URL in browser
  6. Google shows: "Claude for Google Drive wants additional access" — only Drive file permission checkboxes are shown, NO Gmail permissions
  7. Any token granted has Drive scopes, not Gmail scopes
  8. All Gmail API calls fail with 403

Expected Behavior

The OAuth consent screen should show Gmail permissions ("Read, compose, send and permanently delete all your email") and grant https://mail.google.com/ or https://www.googleapis.com/auth/gmail.modify scopes.

Actual Behavior

Google consent screen shows "Claude for Google Drive wants additional access" with only Drive file scopes. Callback URL always returns: scope=email+drive.readonly+drive.file+userinfo.email+openid

No Gmail scopes are ever granted.

Root Cause (suspected)

The Gmail MCP server OAuth client ID (5a970912-02f9-4e78-b66c-965c0e1a74b0) appears to be the same OAuth app registered for Google Drive, not a Gmail-specific app. Google's OAuth system shows the app name and scopes registered for that client_id, which is Drive-only.

Environment

  • Claude Code (web/CLI)
  • Platform: Linux
  • Gmail MCP server: https://gmailmcp.googleapis.com/mcp/v1
  • MCP server ID: 54fd9acb-7cb9-5d39-8b90-b9d1c7111fb4

Impact

The Gmail MCP integration is completely non-functional for all users. Any workflow relying on Gmail (sending reports, reading email, creating drafts) cannot work until the correct OAuth client is used.

What Should Happen?

It should connect to my gmail to send email response.

Error Messages/Logs

Steps to Reproduce

Bug Description

The built-in Gmail MCP server (gmailmcp.googleapis.com) consistently routes through the "Claude for Google Drive" OAuth client instead of a Gmail-specific OAuth client. This means the authorization flow can never grant Gmail API scopes, making the Gmail MCP permanently non-functional.

Steps to Reproduce

  1. Use Claude Code with the built-in Gmail MCP integration
  2. Call any Gmail tool (e.g., list_labels, create_draft)
  3. Get "requires re-authorization" error
  4. Call mcp__Gmail__authenticate — receive an auth URL
  5. Open the auth URL in browser
  6. Google shows: "Claude for Google Drive wants additional access" — only Drive file permission checkboxes are shown, NO Gmail permissions
  7. Any token granted has Drive scopes, not Gmail scopes
  8. All Gmail API calls fail with 403

Expected Behavior

The OAuth consent screen should show Gmail permissions ("Read, compose, send and permanently delete all your email") and grant https://mail.google.com/ or https://www.googleapis.com/auth/gmail.modify scopes.

Actual Behavior

Google consent screen shows "Claude for Google Drive wants additional access" with only Drive file scopes. Callback URL always returns: scope=email+drive.readonly+drive.file+userinfo.email+openid

No Gmail scopes are ever granted.

Root Cause (suspected)

The Gmail MCP server OAuth client ID (5a970912-02f9-4e78-b66c-965c0e1a74b0) appears to be the same OAuth app registered for Google Drive, not a Gmail-specific app. Google's OAuth system shows the app name and scopes registered for that client_id, which is Drive-only.

Environment

  • Claude Code (web/CLI)
  • Platform: Linux
  • Gmail MCP server: https://gmailmcp.googleapis.com/mcp/v1
  • MCP server ID: 54fd9acb-7cb9-5d39-8b90-b9d1c7111fb4

Impact

The Gmail MCP integration is completely non-functional for all users. Any workflow relying on Gmail (sending reports, reading email, creating drafts) cannot work until the correct OAuth client is used.

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

Sonnet 4.6 (model ID: claude-sonnet-4-6)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

No response

extent analysis

TL;DR

The most likely fix is to use a Gmail-specific OAuth client ID instead of the current one shared with Google Drive.

Guidance

  • Verify the OAuth client ID (5a970912-02f9-4e78-b66c-965c0e1a74b0) is indeed registered for Google Drive and not Gmail by checking the Google Cloud Console.
  • Check the Claude Code configuration to see if there's an option to specify a different OAuth client ID for Gmail MCP integration.
  • Consider creating a new OAuth client ID specifically for Gmail integration and update the Claude Code configuration to use it.
  • Test the Gmail MCP integration with the new OAuth client ID to ensure it grants the correct Gmail scopes.

Example

No code snippet is provided as the issue is related to configuration and OAuth client ID setup.

Notes

The issue seems to be specific to the Claude Code configuration and Google OAuth setup. The fix might require updates to the Claude Code configuration or the Google Cloud Console settings.

Recommendation

Apply a workaround by creating a new OAuth client ID for Gmail integration and update the Claude Code configuration to use it, as the current client ID is shared with Google Drive and causing the 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] Gmail MCP integration uses Google Drive OAuth client — cannot grant Gmail permissions