Skip to main content
Use the google strategy to authenticate users with their Google accounts. This is a preset of the generic OAuth flow with Google’s endpoints pre-configured.

Creating a Google OAuth Client

  1. Go to the Google Cloud Console
  2. Select or create a project
  3. Navigate to APIs & Services > Credentials
  4. Click Create Credentials > OAuth client ID
  5. For Application type, select Web application
  6. Configure the authorized redirect URI:
    • For production: https://your-domain.com/oauth/provider-callback
    • For local development: http://localhost:3000/oauth/provider-callback
  7. Copy the Client ID and Client Secret

Environment Setup

Preset Values

You can override any preset with explicit OAUTH_* values.

Example: Google Sheets + Drive

Available Scopes

Tool Context

When AUTH_STRATEGY=google, successful authentication populates the tool context with:
  • context.providerToken — the Google access token
  • context.resolvedHeaders{ Authorization: "Bearer <google-access-token>" }
  • context.provider — provider info object with accessToken, refreshToken, expiresAt, scopes
  • context.authStrategy"google"

Example Tool

Additional Options

Offline Access

To receive a refresh token (for long-lived access), add access_type=offline to extra auth params:
To force the consent screen to appear every time:

Getting User Info

Use context.getUser() to fetch the authenticated user’s profile from Google:
Or use the standalone getUser helper with USERINFO_ENDPOINTS:
The USERINFO_ENDPOINTS constant provides pre-configured URLs:

Access Google ID Token Claims

When using Google OAuth, the id_token is automatically decoded and available via context.provider?.idTokenClaims:
Common Google ID token claims:
  • email - User’s email address
  • name - User’s full name
  • picture - URL to user’s profile picture
  • sub - User’s unique Google ID