When to use this
Use this guide when there is no provider-specific credential stubs page for your app. If a specific page exists (e.g. Gmail), use that instead.How credential stubs work
Many MCP servers expect local credential files to exist before they’ll start. When using the OneCLI gateway, real credentials are injected at request time, but the MCP server still needs structurally valid files to boot. Stub files use the sentinel valueonecli-managed wherever a real credential would go. When the MCP server makes an HTTP request using these stubs, the OneCLI gateway intercepts it and returns real credentials from your app connection.
Common credential file locations
If the MCP server isn’t listed, check its README or source for credential file paths (usually
~/.<app>-mcp/, ~/.config/<app>/, or a file in the project root).
Stub patterns
MCP servers use one of three credential file patterns (A, B, and C). Some CLI tools instead read credentials from environment variables (Pattern D). Match the one your tool expects.Pattern A: Two files (Google OAuth)
Most Google MCP servers expect a client key file and a token file. Client key file (e.g.gcp-oauth.keys.json, credentials.json, client_secret.json):
token.json, tokens.json, credentials.json):
expires_at (ISO string) instead of expiry_date (unix ms). Check the server’s source to match the field name.
Pattern B: Single combined file (Dropbox, Spotify)
Some servers store client credentials and tokens in one file. Dropbox style (config.json):
spotify-config.json):
Pattern C: Token-only file (Microsoft, Salesforce)
Some servers read client credentials from env vars and only store tokens on disk.MS_CLIENT_ID / MS_CLIENT_SECRET, which are handled separately by the OneCLI gateway’s secret injection.
Pattern D: CLI tools with environment variable auth
Some tools aren’t MCP servers and never touch credential files. Instead, they accept a pre-obtained token through an environment variable and auto-load a.env file from the working directory at startup (for example, via the dotenvy crate). Use this pattern for those tools.
The .env file sets the token variable to onecli-managed. When the CLI makes an HTTPS request, it routes through HTTPS_PROXY and the gateway injects the real token at the network level, so the placeholder never needs to be a valid credential.
Example: gws (Google Workspace CLI)
1
Install gws
2
Create the .env stub
Create
/workspace/agent/.env, the working directory gws runs from:3
Run the command
gws auto-loads .env from the working directory.gws uses the dotenvy crate to load .env from the working directory, and GOOGLE_WORKSPACE_CLI_TOKEN is the highest-priority auth method in gws.
Forcing a token refresh
Set the expiry field to a past value so the MCP server immediately attempts a refresh via HTTP, which the gateway intercepts: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. - Create directories with
mkdir -pif they don’t exist. - Set file permissions to
0600when the MCP server expects it (most do).