auth
Check authentication status or initiate OAuth flow for Microsoft Graph API. Use device-code mode for headless environments or browser mode for redirect. Tokens auto-refresh and persist.
Instructions
Manage authentication with the Microsoft Graph API. action=status (default) returns the current auth state and auto-refreshes the access token if it's expired but the refresh token is still valid (~90-day window) — call this first to check before other tools. action=authenticate starts the OAuth flow: with method: "device-code" (default, works headlessly) it returns a code + URL for the user to visit; with method: "browser" it opens the local auth server on :3333 (run npm run auth-server first). Pass force: true to re-authenticate over an existing valid session. action=device-code-complete finishes device-code auth after the user enters the code in their browser — call this once authentication shows as successful in the browser. action=about returns server version, configured audience, scope list, and other diagnostic info. Tokens persist to ~/.outlook-assistant-tokens.json and survive server restarts.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | No | Action to perform (default: status) | |
| method | No | Auth method for action=authenticate. device-code (default): no auth server needed, works remotely. browser: traditional OAuth redirect via port 3333. | |
| force | No | Force re-authentication even if already authenticated (action=authenticate only) |