diff --git a/CHANGELOG.md b/CHANGELOG.md index b2912e3..e380a4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- Fixed auth loss when reconnecting an unauthorized session via `mcpc connect` — the `unauthorized` status was not cleared, causing all subsequent operations to fail with "Authentication required by server" even after successful reconnection + ### Changed - **Breaking:** CLI syntax redesigned to command-first style. All commands now start with a verb; MCP operations require a named session. diff --git a/src/cli/commands/sessions.ts b/src/cli/commands/sessions.ts index 5a9fc91..0a82af4 100644 --- a/src/cli/commands/sessions.ts +++ b/src/cli/commands/sessions.ts @@ -233,6 +233,8 @@ export async function connectSession( ...(proxyConfig && { proxy: proxyConfig }), ...(options.x402 && { x402: true }), ...(options.insecure && { insecure: true }), + // Clear any previous error status (unauthorized, expired) when reconnecting + ...(isReconnect && { status: 'active' }), }; if (isReconnect) {