Skip to content

Fix auth loss when reconnecting unauthorized sessions#85

Merged
jancurn merged 1 commit intomainfrom
claude/fix-mcp-auth-loss-abtty
Mar 17, 2026
Merged

Fix auth loss when reconnecting unauthorized sessions#85
jancurn merged 1 commit intomainfrom
claude/fix-mcp-auth-loss-abtty

Conversation

@jancurn
Copy link
Member

@jancurn jancurn commented Mar 17, 2026

Summary

Fixed an issue where reconnecting an unauthorized session via mcpc connect would fail with "Authentication required by server" even after successful reconnection. The unauthorized status was not being cleared during reconnection, causing all subsequent operations to fail.

Changes

  • Clear the status field when reconnecting a session, resetting it to 'active' state
  • This ensures that previous error statuses (unauthorized, expired, etc.) don't persist after a successful reconnection
  • Added clarifying comment explaining the purpose of the status reset

Implementation Details

The fix is minimal and surgical: when isReconnect is true, the session configuration now explicitly sets status: 'active' to override any previous error state. This allows the reconnection to proceed cleanly without being blocked by stale authentication errors.

https://claude.ai/code/session_014EiYUjqZVMENeNqPiarPkC

When reconnecting an existing session via `mcpc connect` that had been
marked as `unauthorized`, the status field was not cleared. This caused
`ensureBridgeReady` to see the stale `unauthorized` status and
immediately throw "Authentication required by server" even though the
bridge had successfully reconnected with valid credentials.

The fix resets the session status to `active` during the reconnect path,
matching what `restartSession` already does.

https://claude.ai/code/session_014EiYUjqZVMENeNqPiarPkC
@jancurn jancurn merged commit 73361b4 into main Mar 17, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants