Applies to
| MCP Server | Credential directory |
|---|---|
@gongrzhe/server-gmail-autoauth-mcp | ~/.gmail-mcp/ |
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-managedvalues. The user may have real credentials. - All sentinel values use the string
onecli-managedso 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.