Remote Servers
Bearer token
export ACME_TOKEN="your-api-key"mcp add acme https://api.acme.dev/mcp --bearer-env ACME_TOKENmcp acme toolsmcp acme search --query invoicesThe --bearer-env flag tells mcptocli which environment variable holds the token. The token is never stored in config.
OAuth (browser login)
mcp add notion https://mcp.notion.com/mcp --auth oauthmcp notion toolsThe browser opens automatically the first time. Tokens are persisted in your system keychain and refreshed automatically.
Pre-authenticate
mcp login notionThis triggers the OAuth flow without calling any tool — useful for ensuring auth is ready before scripting.
Custom headers
For services that use non-standard auth:
mcp tool --url https://api.example.com/mcp --header "X-API-Key: secret" list-items