feat(desktop): auto-connect OAuth catalog installs and render post_install notes - #66660
feat(desktop): auto-connect OAuth catalog installs and render post_install notes#66660joelbrilliant wants to merge 2 commits into
Conversation
…stall Installing an OAuth-over-HTTP connector from the desktop MCP catalog only wrote config/env — it never minted a token, so the user had to separately trigger auth from the Servers tab before the connector worked. Chain the install straight into the existing desktop OAuth flow (the same completeMcpDesktopOAuth machinery the Servers tab already uses for re-auth) when entry.auth_type === 'oauth' && entry.transport === 'http'. The launch is best-effort: a cancelled or failed auth leaves the install intact and surfaces a connect-later notification rather than crashing. Also render entry.post_install as a "Setup notes" block on the catalog card, mirroring the web dashboard's McpPage. Guarded on truthiness so older runtimes that omit the field don't break the newer desktop that reads it. Both changes are additive and version-skew-guarded; no install API contract or OAuth machinery was modified. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
Auto-chains OAuth launch on catalog install + renders post_install notes. Clean desktop changes:
- OAuth launch on
install()only whenauth_type === 'oauth' && transport === 'http', mirroring existingcompleteMcpDesktopOAuthflow - Best-effort: cancelled/failed auth leaves install intact with a "connect to finish" notification
post_installrendered with truthy guard for version-skew- 172 new vitest test cases covering the full chain
- TypeScript clean (
tsc -p apps/desktop --noEmit)
No issues found. LGTM.
Reviewed by Hermes Agent
teknium1
left a comment
There was a problem hiding this comment.
Thanks for extending the existing desktop OAuth path and matching the web catalog’s post_install presentation. The two reported gaps are present on current main: McpCatalog installs and immediately calls onInstalled() at apps/desktop/src/app/skills/mcp-tab.tsx:1373-1397, while the web catalog already renders setup notes at web/src/pages/McpPage.tsx:860-868.
Problems
apps/desktop/src/app/skills/mcp-tab.tsx:1409awaits OAuth beforeonInstalled()at line 1427. The shared helper polls every second until approval/error (apps/desktop/src/lib/mcp-dashboard-oauth.ts:43-69); an abandoned browser flow remains pending until the backend’s 15-minute flow GC (hermes_cli/web_server.py:11329-11346). During that intervalinstallingremains set, so the claimed best-effort cancellation path does not release the catalog UI.
Suggested changes
- Refresh the installed catalog/config immediately after the install succeeds, and start OAuth as a non-blocking follow-up. Refresh again on OAuth success if the post-auth configuration needs reconciliation; use the connect-later notice for errors.
- Add a test for a persistently
authorization_requiredOAuth status, asserting installation completion is not held behind browser authorization.
Automated hermes-sweeper review.
|
Sweeper follow-up is pushed in
Verification: 9 focused Vitest tests passed, the renderer TypeScript check passed, targeted ESLint passed, and the diff check passed. |
Two additive fixes to the desktop MCP catalog so an installed OAuth connector actually connects and shows its setup notes — both reusing machinery that already exists on
main.\n>\n> 1. Install → OAuth auto-launch. Todayinstall()inapps/desktop/src/app/skills/mcp-tab.tsxcallsinstallMcpCatalogEntry→POST /api/mcp/catalog/install, which only writes config/env. For an OAuth-over-HTTP connector that mints no token, so the user has to go find the Servers tab and trigger auth separately. This chains straight into the existing desktop OAuth flow — the samecompleteMcpDesktopOAuththe Servers tab already uses for re-auth (mcp-tab.tsx:583) — whenentry.auth_type === 'oauth' && entry.transport === 'http'. Best-effort: a cancelled/failed auth leaves the install intact and surfaces a "connect to finish" notification instead of crashing. No new OAuth code; success is persisted server-side and picked up by the existingonInstalled()refetch.\n>\n> 2. Renderpost_install. The desktop catalog card never showedentry.post_installeven though the type carries it and the API returns it — the web dashboard already renders it (web/src/pages/McpPage.tsx:860). Added a truthy-guarded "Setup notes" block mirroring that render.\n>\n> Both changes are additive, guard every new field read for the version-skew case (Desktop newer than the runtime it talks to), and touch neither the install API contract nor the OAuth machinery. Complements the connector-catalog work in #66653; independent of the presentation PRs #59692 / #59872.\n>\n> Tests (vitest): oauth+http install chains into the OAuth launch (assertscompleteMcpDesktopOAuthcalled with the entry's server name); non-oauth and oauth-on-non-http installs do not launch OAuth; an OAuth-launch failure leaves the install succeeded (no throw, routes to the connect-later notify,onInstalledstill fires);post_installrenders when present and is absent when empty.tsc -p apps/desktop --noEmitclean, eslint clean.