Skip to main content

Applies to

Other Google services (Calendar, Drive, Sheets) have their own credential stub pages.

Create the stubs

Create the directory if it doesn’t exist: mkdir -p ~/.gmail-mcp

~/.gmail-mcp/gcp-oauth.keys.json

~/.gmail-mcp/credentials.json

Rules

  • Never overwrite existing files that don’t contain onecli-managed values. The user may have real credentials.
  • All sentinel values use the string onecli-managed so they’re easy to detect programmatically.

How it works

expiry_date: 0 tells google-auth-library the token is expired. It immediately sends a refresh request to oauth2.googleapis.com/token with refresh_token: "onecli-managed". The OneCLI gateway intercepts that request and returns a real access token using the app connection you registered.