[BUG] Google Sheets connector OAuth fails from CLI (product_surface=cli) but works on Desktop app

Status Open
Reported on v2.1.246
Maintainer reply None cached
Activity 0 comments · opened Aug 26, 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?

When connecting the Google Sheets MCP connector from Claude Code CLI (claude) running inside a terminal, the browser opens the Google OAuth authorize URL, but instead of the normal Google consent screen, it lands on Google's generic Sheets error page: "Sorry, unable to open the file at present. Please check the address and try again."

The failing URL is of the form:
https://sheets.googleapis.com/authorize?response_type=code&client_id=...apps.googleusercontent.com&redirect_uri=https%3A%2F%2Fclaude.ai%2Fapi%2F...

The auth-start link printed by the CLI itself is of the form:
https://claude.ai/api/organizations/<org_id>/mcp/start-auth/mcpsrv_<id>?product_surface=cli

The same "Google Sheets" connector (same connector/org, same Google account) works correctly when connected from the Claude Desktop app - the OAuth flow completes normally and the connector authenticates without issue. Only the CLI-specific auth flow (product_surface=cli) reproduces this failure.

What Should Happen?

Clicking the auth link (or manually pasting it into an already-logged-in browser) should take the user to Google's normal OAuth consent screen for the Google Sheets scope, complete the grant, and return control to the CLI so it can proceed (same behavior as the Desktop app).

Error Messages/Logs

Google's page text: "Sorry, unable to open the file at present. Please check the address and try again."

Displayed URL at time of error (address bar, truncated by browser):
sheets.googleapis.com/authorize?response_type=code&client_id=509117084509-e8fp2nruj94i8hsvuqcv3ge4jv5aua85.apps.googleusercontent.com&redirect_uri=https%3A%2F%2Fclaude.ai%2Fapi%2F...
Google's page text: "Sorry, unable to open the file at present. Please check the address and try again."

Displayed URL at time of error (address bar, truncated by browser):
sheets.googleapis.com/authorize?response_type=code&client_id=509117084509-e8fp2nruj94i8hsvuqcv3ge4jv5aua85.apps.googleusercontent.com&redirect_uri=https%3A%2F%2Fclaude.ai%2Fapi%2F...

Google's page text: "Sorry, unable to open the file at present. Please check the address and try again."

Displayed URL at time of error (address bar, truncated by browser):
sheets.googleapis.com/authorize?response_type=code&client_id=509117084509-e8fp2nruj94i8hsvuqcv3ge4jv5aua85.apps.googleusercontent.com&redirect_uri=https%3A%2F%2Fclaude.ai%2Fapi%2F...

CLI-printed auth-start URL:
https://claude.ai/api/organizations/<org_id>/mcp/start-auth/mcpsrv_01TG6wQMUYbeeuwHip1xx4DS?product_surface=cli

Steps to Reproduce

  1. In Claude Code CLI (running in a terminal — reproduced in both VS Code's integrated terminal and a standalone terminal), connect the "Google Sheets" MCP connector.
  2. The CLI prints an auth-start URL (https://claude.ai/api/organizations/<org_id>/mcp/start-auth/mcpsrv_<id>?product_surface=cli) and opens it in the default browser.
  3. The browser is already logged into the correct Google Workspace account and normally has a working Google session (confirmed: the same account/connector authenticates successfully via the Claude Desktop app).
  4. Instead of reaching Google's OAuth consent screen, the browser lands on a Google Sheets-branded error page: "Sorry, unable to open the file at present. Please check the address and try again."
  5. Also reproduced by manually copying the CLI's printed auth URL and pasting it into an already-authenticated Chrome window (ruling out the CLI auto-opening the wrong browser).
  6. The CLI never receives the completed auth callback, so the connector stays unauthenticated.

Not a regression — this is a new connector auth attempt, not something that previously worked and broke.

Claude Model

None

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.1.246 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

Also reproduced identically outside VS Code, in a standalone terminal app (Terminal.app/iTerm), so this is not specific to VS Code's integrated terminal — it's the CLI's OAuth broker in general (product_surface=cli).

The same connector works fine when authenticated via the Claude Desktop app (no product_surface=cli in that flow), which is what points to the CLI-specific auth-start/redirect path as the source of the bug rather than anything in the local browser, terminal, or Google account/session.

View original on GitHub ↗