Auto-detect auth profiles on session restart#70
Merged
Conversation
When a session was created without authentication and the user later ran `mcpc login <server> && mcpc @session restart`, the restart would not detect the newly created OAuth profile because it only checked the stored profileName (which was undefined). Now restartSession() calls resolveAuthProfile() to auto-detect default profiles, matching the behavior of connectSession(). https://claude.ai/code/session_01TRdQzrv6aVfpXsbJMhzRob
When --profile is not explicitly provided, resolveAuthProfile now only looks for the "default" profile. Previously it would error if non-default profiles existed without a default, which was confusing. Non-default profiles now require an explicit --profile flag. Also simplifies the restart auth resolution by removing the try/catch that was needed to handle the now-removed error case. https://claude.ai/code/session_01TRdQzrv6aVfpXsbJMhzRob
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Session restart now automatically detects and applies OAuth profiles that were created after the session was initially established. This fixes the workflow where a user creates a session without authentication, then runs
mcpc login <server>to create a profile, and finally restarts the session.Changes
restartSession()to attempt profile auto-detection when:resolveAuthProfile()function with the server URLImplementation Details
updateSession()to avoid repeated resolution attempts on subsequent restartshttps://claude.ai/code/session_01TRdQzrv6aVfpXsbJMhzRob