Implementation:1mcp app Agent authStatusCommand
| Knowledge Sources | |
|---|---|
| Domains | Security, CLI |
| Last Updated | 2026-10-29 00:00 GMT |
Overview
Concrete CLI command for checking OAuth authentication status by resolving the runtime target, loading the saved token, and probing the runtime's inspect endpoint.
Description
The authStatusCommand function resolves the authentication runtime target from CLI options (context or URL), loads the saved OAuth token reference from the RuntimeTargetStore, and probes the runtime's inspect endpoint to determine if the token is still valid. It reports the profile name, URL, saved timestamp, and connection status (connected, token rejected, or unreachable).
Usage
Import this function when you need to:
- Check if the saved OAuth token is still valid for a runtime
- Verify authentication status after enabling auth
- Diagnose token rejection or runtime unreachability
Code Reference
Source Location
- Repository: 1MCP Agent
- File: src/commands/auth/status.ts (L13-39)
Signature
export interface AuthStatusOptions extends GlobalOptions {
context?: string;
url?: string;
}
export async function authStatusCommand(options: AuthStatusOptions): Promise<void>;
Import
import { authStatusCommand } from '@src/commands/auth/status.js';
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| context | string | No | Runtime context name |
| url | string | No | Runtime URL |
Outputs
| Name | Type | Description |
|---|---|---|
| stdout | text | Profile name, saved date, status (connected/rejected/unreachable) |
Usage Examples
Check Auth Status
1mcp auth status
1mcp auth status --context my-runtime
1mcp auth status --url http://localhost:3000