Related concepts: Authentication & Credentials, Credential Store, OAuth Flows
The easiest way to add credentials is through the Frontend Web Interface:
oas-mcp serve --cred-store fileThe frontend automatically handles credential storage, never includes secrets in URLs, and will surface environment-imported credentials (see below) for confirmation.
For direct API access or automation:
_auth_*_set names.{ "method":"tools/call", "params": { "name": "oasmcp_auth_apiKey_set", "arguments": { "value": "KEY" } } }
{ "method":"tools/call", "params": { "name": "oasmcp_auth_list_credentials" } }
_auth_apiKey_clear.On server start, variables matching OAS_MCP_<SCHEME>_<ID> are parsed and loaded once (if that credential id absent). Examples:
export OAS_MCP_apiKey_default=sk_live_x
export OAS_MCP_basic_myservice="user:pass"
Scheme portion maps to auth tool prefix (apiKey, basic, bearer, oauth2, cookie).
If started with --auth-server and --proxy-oauth, you can exchange a code directly:
_auth_oauth2_exchange tool (or use frontend) with code, redirect_uri, server id.Continue: OAuth Flows, Security, plus Rate Limiting and Retry Policy for post-auth resilience.