MCP server for Gmail with OAuth2 (personal) and service account (Workspace) support.

stdiocommunityservice

Package Details

Transportstdio
Runtimenpx

Runtime Arguments

Positional
Position 0
-y

Environment Variables

GMAIL_OAUTH_CLIENT_ID
Secret

OAuth2 client ID from Google Cloud Console (for personal Gmail accounts).

GMAIL_OAUTH_CLIENT_SECRET
Secret

OAuth2 client secret from Google Cloud Console.

GMAIL_OAUTH_REFRESH_TOKEN
Secret

Refresh token from the OAuth2 setup script.

GMAIL_SERVICE_ACCOUNT_CLIENT_EMAIL

Service account email address (for Google Workspace).

GMAIL_SERVICE_ACCOUNT_PRIVATE_KEY
Secret

Service account private key in PEM format (for Google Workspace).

GMAIL_IMPERSONATE_EMAIL

Email address to impersonate (required for service account mode).

GMAIL_ENABLED_TOOLGROUPS

Comma-separated list of tool groups to enable (readonly, readwrite, readwrite_external).