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
| MCP Server | Credential path |
|---|---|
@gongrzhe/server-gmail-autoauth-mcp | ~/.gmail-mcp/ |
@piotr-agier/google-drive-mcp | ~/.config/google-drive-mcp/ |
@cocal/google-calendar-mcp | ~/.config/google-calendar-mcp/ |
@a-bonus/google-docs-mcp | ~/.config/google-docs-mcp/ |
go.ngs.io/dropbox-mcp-server | ~/.dropbox-mcp-server/ |
spotify-mcp-server | ./spotify-config.json |
@aiondadotcom/mcp-salesforce | ~/.mcp-salesforce.json |
outlook-mcp | ~/.outlook-mcp-tokens.json |
~/.<app>-mcp/, ~/.config/<app>/, or a file in the project root).
Stub patterns
MCP servers use one of three credential file patterns. Match the one your MCP server 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 — those are handled separately by the OneCLI gateway’s secret injection.
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:| Field name | Expired value |
|---|---|
expiry_date | 0 |
expires_at | "1970-01-01T00:00:00Z" |
expiresAt | 0 |
expiry | "1970-01-01T00:00:00.000000Z" |
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).