Auth Command
Manage authentication profiles for named Runtime Target Contexts.
Synopsis
bash
npx -y @1mcp/agent auth <subcommand> [options]Subcommands
login- Save a bearer token for a Runtime Target Contextstatus- Show the saved authentication profile for a Runtime Target Contextlogout- Remove a saved authentication profile for a Runtime Target Context
auth login
Save a bearer token so that inspect, run, and instructions can authenticate automatically.
bash
npx -y @1mcp/agent auth login [options]How token resolution works
--tokenflag (explicit)- Stdin pipe (
echo $TOKEN | npx -y @1mcp/agent auth login --context <name>) - Auto-generated CLI token for localhost servers (when the server supports it)
If the server has auth disabled, login exits early with a message — no token is stored.
Options
--context <name>- Runtime Target Context name. Required.--url, -u <url>- Unsupported for auth credential commands; usetarget add <name> <url>and then--context <name>.--token, -t <token>- Bearer token to save
Examples
bash
# Save token for the local runtime context
npx -y @1mcp/agent auth login --context local --token mytoken
# Pipe token from a secret manager
op read "op://vault/1mcp/token" | npx -y @1mcp/agent auth login --context prod
# Save token for a named remote target
npx -y @1mcp/agent target add prod https://1mcp.example.com
npx -y @1mcp/agent auth login --context prod --token mytokenauth status
Show saved authentication profiles and verify connectivity.
bash
npx -y @1mcp/agent auth status [options]status requires an explicit Runtime Target Context and checks only that context's scoped token.
Options
--context <name>- Runtime Target Context name. Required.--url, -u <url>- Unsupported for auth credential commands.
Examples
bash
# Check the local runtime context
npx -y @1mcp/agent auth status --context local
# Check a named remote target
npx -y @1mcp/agent auth status --context prodauth logout
Remove a saved authentication profile.
bash
npx -y @1mcp/agent auth logout [options]logout requires an explicit Runtime Target Context and clears only the token for the observed runtime identity.
Options
--context <name>- Runtime Target Context name. Required.--url, -u <url>- Unsupported for auth credential commands.--all- Unsupported for Runtime Target Context credentials.--all-local- With--context local, clear every local OAuth token reference without contacting a runtime.
Examples
bash
# Remove the local runtime context profile
npx -y @1mcp/agent auth logout --context local
# Remove a named remote target profile
npx -y @1mcp/agent auth logout --context prod
# Clear every local OAuth token reference without contacting a runtime
npx -y @1mcp/agent auth logout --context local --all-localSee Also
- CLI Mode Guide - Overview of the CLI workflow
- Instructions Command - Start the CLI playbook
- Inspect Command - Discover tools from a running server
- Run Command - Execute a tool call
