From b25bda58ab3e7d62fe1af2d259f374d35faad11c Mon Sep 17 00:00:00 2001 From: Ed Zynda Date: Wed, 25 Jun 2025 15:02:23 +0300 Subject: [PATCH] update README --- AGENTS.md | 13 +++++++++++++ README.md | 14 ++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index a39a7a07..cd1695da 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -111,6 +111,19 @@ MCPHost includes a powerful script system for automation and reusable workflows. - **Edge Cases**: Empty defaults, complex values, mixed required/optional variables - **Backward Compatibility**: Ensures existing scripts continue working unchanged +## Authentication System +MCPHost includes optional OAuth authentication for Anthropic Claude as an alternative to API keys. + +### Authentication Commands +- **Location**: `cmd/auth.go` (main implementation) +- **Purpose**: Manage Anthropic OAuth credentials (alternative to API keys) +- **Commands**: `login anthropic`, `logout anthropic`, `status` + +### OAuth Implementation +- **Location**: `internal/auth/oauth.go` (OAuth client), `internal/auth/credentials.go` (credential management) +- **Features**: PKCE security, automatic token refresh, encrypted storage, browser-based flow +- **Priority**: OAuth credentials > API keys (environment variables/flags) + ## Recent Bug Fixes ### Legacy MCP Server Configuration Fix diff --git a/README.md b/README.md index 6fcbcb3d..1e95cc9a 100644 --- a/README.md +++ b/README.md @@ -574,6 +574,13 @@ mcphost -p "Generate a random UUID" --quiet | tr '[:lower:]' '[:upper:]' - `-p, --prompt string`: **Run in non-interactive mode with the given prompt** - `--quiet`: **Suppress all output except the AI response (only works with --prompt)** +### Authentication Subcommands +- `mcphost auth login anthropic`: Authenticate with Anthropic using OAuth (alternative to API keys) +- `mcphost auth logout anthropic`: Remove stored OAuth credentials +- `mcphost auth status`: Show authentication status + +**Note**: OAuth credentials (when present) take precedence over API keys from environment variables and `--provider-api-key` flags. + #### Model Generation Parameters - `--max-tokens int`: Maximum number of tokens in the response (default: 4096) - `--temperature float32`: Controls randomness in responses (0.0-1.0, default: 0.7) @@ -636,6 +643,13 @@ While chatting, you can use: - `/quit`: Exit the application - `Ctrl+C`: Exit at any time +### Authentication Commands + +Optional OAuth authentication for Anthropic (alternative to API keys): +- `mcphost auth login anthropic`: Authenticate using OAuth +- `mcphost auth logout anthropic`: Remove stored OAuth credentials +- `mcphost auth status`: Show authentication status + ### Global Flags - `--config`: Specify custom config file location