Skip to content

feat(cli): print the OAuth authorization URL in daemon-mode auth login - #1229

Merged
Dumbris merged 1 commit into
mainfrom
claude/affectionate-clarke-d897b3
Sep 9, 2026
Merged

feat(cli): print the OAuth authorization URL in daemon-mode auth login#1229
Dumbris merged 1 commit into
mainfrom
claude/affectionate-clarke-d897b3

Conversation

@Dumbris

@Dumbris Dumbris commented Sep 9, 2026

Copy link
Copy Markdown
Member

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 returns browser_opened and auth_url, but cliclient.TriggerOAuthLogin decoded only server/action/success and dropped them, so on a headless host the user had no URL to visit.

  • cliclient: new OAuthLoginResult + TriggerOAuthLoginWithResult; TriggerOAuthLogin now wraps it (TUI interface untouched). Decodes the contracts.OAuthStartResponse fields and keeps the legacy server field as a fallback.
  • auth login daemon branch: when browser_opened=false prints a warning, the daemon's browser_error reason, and the URL; when true prints an "If the browser did not open, visit:" line with the URL. Matches the standalone path in connection_oauth.go.
  • Tests: httptest decode for browser-opened / not-opened / API-error, and output assertions for the three CLI branches (printDaemonOAuthLoginResult takes an io.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.yml on the touched packages: 0 issues

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.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 9, 2026

Copy link
Copy Markdown

Deploying mcpproxy-docs with  Cloudflare Pages  Cloudflare Pages

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

View logs

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 74.46809% with 12 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/cliclient/client.go 70.00% 8 Missing and 1 partial ⚠️
cmd/mcpproxy/auth_cmd.go 82.35% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

📦 Build Artifacts

Workflow Run: View Run
Branch: claude/affectionate-clarke-d897b3

Available Artifacts

  • archive-darwin-amd64 (29 MB)
  • archive-darwin-arm64 (27 MB)
  • archive-linux-amd64 (17 MB)
  • archive-linux-arm64 (16 MB)
  • archive-windows-amd64 (29 MB)
  • archive-windows-arm64 (26 MB)
  • frontend-dist-pr (0 MB)
  • installer-dmg-darwin-amd64 (24 MB)
  • installer-dmg-darwin-arm64 (21 MB)

How to Download

Option 1: GitHub Web UI (easiest)

  1. Go to the workflow run page linked above
  2. Scroll to the bottom "Artifacts" section
  3. Click on the artifact you want to download

Option 2: GitHub CLI

gh run download 34306924055 --repo smart-mcp-proxy/mcpproxy-go

Note: Artifacts expire in 14 days.

@Dumbris
Dumbris merged commit 284f837 into main Sep 9, 2026
40 checks passed
@Dumbris
Dumbris deleted the claude/affectionate-clarke-d897b3 branch September 9, 2026 07:11
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.

2 participants