unblocked commands — including the MCP server and every context-* command — need to call the Unblocked API on your behalf. Authentication is how you grant that access.
Interactive auth
- The CLI prints a login URL and, when a browser is available, opens it for you.
- You sign in to Unblocked and authorize the session.
- The CLI stores the resulting credential securely. Subsequent commands reuse it until it expires or you sign out with
unblocked uninstall.
~/.unblocked/auth/oauth-refresh-token, with the directory restricted to its owner and the file created with owner-only permissions.
The install-mcp.sh quick install script triggers this flow automatically at the end of its run. If you installed with install.sh (CLI only), run unblocked auth manually before using any other command.
Headless authentication
In CI runners, containers, remote shells, and other noninteractive environments, use a personal or team API token. The same tokens that power Unblocked MCP in CI work with the CLI.Secret-mounted file (recommended)
Point the CLI at a file populated by your secret manager:Unblocked credential file
To store a dedicated token on a persistent Linux host, pipe it to the CLI:~/.unblocked/auth/agent-token, with the directory restricted to its owner and the file created with owner-only permissions. Piping the token avoids placing it in shell history or process arguments.
Environment variable
For short-lived jobs, you can provide the token directly in the environment:.env files.
If more than one source is configured, the CLI checks UNBLOCKED_API_TOKEN, then UNBLOCKED_API_TOKEN_FILE, then the Unblocked credential file. See the per-agent guides for creating tokens, including the Claude Code headless automation guide.
Signing out
To clear the cached credentials along with all other local Unblocked state, rununblocked uninstall.