Remote Servers

Bearer token

export ACME_TOKEN="your-api-key"
mcp add acme https://api.acme.dev/mcp --bearer-env ACME_TOKEN
mcp acme tools
mcp acme search --query invoices

The --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 oauth
mcp notion tools

The browser opens automatically the first time. Tokens are persisted in your system keychain and refreshed automatically.

Pre-authenticate

mcp login notion

This 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