feat(cli): print the OAuth authorization URL in daemon-mode auth login - #1229
Merged
Conversation
POST /api/v1/servers/{name}/login already returns browser_opened and auth_url,
but cliclient discarded them, so 'mcpproxy auth login --server=<name>' in
daemon mode only printed a generic success line. On a headless host that left
the user with no way to finish the flow.
- cliclient: add OAuthLoginResult and TriggerOAuthLoginWithResult; the old
TriggerOAuthLogin wraps it, so the TUI interface is unchanged.
- auth login (daemon branch): print the URL prominently when the browser could
not be opened (with the daemon's reason), and as an 'if the browser did not
open, visit:' fallback when it did, matching the standalone path.
- Tests: httptest decode coverage for both browser states and the API-error
path; output assertions for the three CLI branches.
Unblocks the diagnostics 'Sign in' fixer from #1218 promising the URL is
printed for its headless fallback.
Deploying mcpproxy-docs with
|
| Latest commit: |
33fade5
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://339f4a1b.mcpproxy-docs.pages.dev |
| Branch Preview URL: | https://claude-affectionate-clarke-d.mcpproxy-docs.pages.dev |
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Contributor
📦 Build ArtifactsWorkflow Run: View Run Available Artifacts
How to DownloadOption 1: GitHub Web UI (easiest)
Option 2: GitHub CLI gh run download 34306924055 --repo smart-mcp-proxy/mcpproxy-go
|
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
mcpproxy auth login --server=<name>in daemon mode printed only "OAuth authentication flow initiated successfully". The REST route it calls (POST /api/v1/servers/{name}/login) already returnsbrowser_openedandauth_url, butcliclient.TriggerOAuthLogindecoded onlyserver/action/successand dropped them, so on a headless host the user had no URL to visit.OAuthLoginResult+TriggerOAuthLoginWithResult;TriggerOAuthLoginnow wraps it (TUI interface untouched). Decodes thecontracts.OAuthStartResponsefields and keeps the legacyserverfield as a fallback.browser_opened=falseprints a warning, the daemon'sbrowser_errorreason, and the URL; whentrueprints an "If the browser did not open, visit:" line with the URL. Matches the standalone path inconnection_oauth.go.printDaemonOAuthLoginResulttakes anio.Writer).Context: the diagnostics "Sign in" fixer from #1218 points users at this command as the headless fallback and could not promise the URL is printed until this lands.
Test plan
go test -race ./internal/cliclient/ ./cmd/mcpproxy/ ./internal/tui/golangci-lint run --config .github/.golangci.ymlon the touched packages: 0 issues