Skip to content

Open-source SEO, GEO, and marketing skills for AI agents.

feat(notfair-cmo): Apple-flavored design system + onboarding redesign

Yuting Zhong080f43aca911
diff --git a/notfair-cmo/DESIGN.md b/notfair-cmo/DESIGN.md
new file mode 100644
index 00000000..b51fde75
--- /dev/null
+++ b/notfair-cmo/DESIGN.md
@@ -0,0 +1,204 @@
+# notfair-cmo Design System
+
+**Direction.** Apple-flavored product UI anchored on the Notfair brand green. Cool neutrals, generous whitespace, layered hairlines, restrained shadows. No warm cream, no editorial flourishes, no paper grain. The accent green from the Notfair logo (`#4CAF6E`) carries the brand; everything else stays out of its way.
+
+If a design choice would feel at home in macOS System Settings, iOS Settings, or apple.com — it belongs. If it would feel at home in a magazine, a brutalist landing page, a hacker terminal, or a warm letterpress site — it doesn't.
+
+---
+
+## Brand
+
+The mark lives at `notfair-cmo/public/notfair-mark-light.svg` (mirrored from the marketing site). It is the only acceptable brand artifact in product chrome — no monogram alternates, no "C" mark for "CMO," no lockup variations.
+
+The green `#4CAF6E` lifted from the mark is `--accent`. Use it sparingly but distinctly: the brand mark itself, the primary CTA fill, the active progress step, "connected" status, sub-action text links, footnote anchors. **Never** use it for body text, generic info, or anything that competes with content.
+
+---
+
+## Color
+
+### Surfaces
+
+| Token | Hex | HSL | Use |
+|---|---|---|---|
+| `--bg` | `#F5F5F7` | `240 8% 96%` | Page background |
+| `--surface` | `#FFFFFF` | `0 0% 100%` | Cards, list groups |
+| `--surface-2` | `#EFEFF1` | `240 6% 94%` | Inset surfaces, hover states, app-icon glyph backgrounds |
+
+### Ink
+
+| Token | Hex | HSL | Use |
+|---|---|---|---|
+| `--ink` | `#1D1D1F` | `240 3% 12%` | Headings, primary text |
+| `--ink-2` | `#2C2C2E` | `240 2% 18%` | Strong body emphasis (`<b>`, lead paragraph) |
+| `--ink-3` | `#424245` | `240 2% 26%` | Body text |
+| `--ink-4` | `#6E6E73` | `240 2% 44%` | Labels, status, secondary metadata |
+
+Contrast targets: body text against `--bg` is ~11:1 (well past WCAG AAA). The intentional "soft" tier (`--ink-4`) lands at ~5.5:1 — still readable, but reserved for support text.
+
+### Borders
+
+| Token | Hex | HSL | Use |
+|---|---|---|---|
+| `--border` | `#D2D2D7` | `240 6% 83%` | Hairlines, card edges, dividers (`.5px` where retina-supported, `1px` fallback) |
+| `--border-strong` | `#B8B8BE` | `240 5% 73%` | Focus rings, button outlines, separators that need to stand up |
+
+### Accent (Notfair green)
+
+| Token | Hex | HSL | Use |
+|---|---|---|---|
+| `--accent` | `#4CAF6E` | `138 39% 49%` | Brand mark, primary CTA, active state, "connected" indicator, links |
+| `--accent-soft` | `#EDF7F0` | `138 31% 95%` | Glyph background on connected items, ghost-button hover fill |
+| `--accent-border` | `#A5D7B6` | `137 35% 75%` | Accent rings, focus halos |
+
+### What we don't have
+
+No warm cream. No paper-grain texture. No gradient backgrounds. No drop-shadow brand colors. No purple/violet "tech" accent. No status-state palette yet — when we need success/warning/error colors, we'll add them as a separate scale; the brand green stays brand-only.
+
+---
+
+## Typography
+
+**Stack.** System SF Pro via `-apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display'` with `'Inter'` as the cross-platform fallback. We do not load a web font for body text — SF Pro on Apple devices renders perfectly; Inter on the rest is close enough that the design holds.
+
+**Scale.** All sizes have negative letter-spacing (Apple convention — display sans wants `-0.02em` to `-0.04em` depending on size).
+
+| Token | Size | Weight | Letter-spacing | Use |
+|---|---|---|---|---|
+| Display | 56px | 600 | -0.04em | Page hero (`h1` on a wizard step) |
+| Title | 32px | 600 | -0.03em | Section pages (Settings, Workspace home) |
+| Subtitle | 21px | 400 | -0.015em | Lead paragraph under a Display |
+| Section heading | 19px | 600 | -0.022em | "Recommended", "Other" group headers in a list |
+| Body | 15px | 400 | -0.01em | Default text size, list-row titles |
+| Body small | 13px | 400 | -0.005em | List-row descriptions, sub-actions, link labels |
+| Caption | 12.5px | 500 | -0.005em | Footnotes, palette swatches, micro-meta |
+
+**Rules.** Use weight to express hierarchy, never to fake contrast. If text looks weak, change the color (`--ink-3` → `--ink-2`), don't bump the weight. Italics are reserved for true citations; we do not use italic emphasis as a design element.
+
+---
+
+## Spacing
+
+8px grid. Common gaps: `8px`, `12px`, `16px`, `24px`, `32px`, `48px`, `64px`. The wizard container is `max-width: 780px` with `64px` top padding and `144px` bottom padding — Apple-grade breathing room.
+
+Internal card padding is `18px × 22px` (vertical × horizontal). Gap between glyph and content in a list row is `16px`.
+
+---
+
+## Radii
+
+| Token | Value | Use |
+|---|---|---|
+| Pill | `980px` | Buttons, status pills |
+| Card | `18px` | List group containers |
+| App-icon glyph | `9px` | The 38px square next to a list-row title (echoes iOS app icons) |
+| Toggle / small chip | `6px` | Avoid larger UI — small chips are toggle-sized |
+
+---
+
+## Shadows
+
+Three crisp levels. No inner highlights, no warm tints — Apple shadows are diffuse cool drops.
+
+```css
+--shadow-sm: 0 1px 2px rgba(0,0,0,.04), 0 0 0 .5px rgba(0,0,0,.04);
+--shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px -8px rgba(0,0,0,.10);
+--shadow-lg: 0 2px 4px rgba(0,0,0,.06), 0 20px 50px -12px rgba(0,0,0,.18);
+```
+
+Use `--shadow` for primary cards (a list group, a primary surface). `--shadow-sm` for resting buttons, pills, palette swatches. `--shadow-lg` for floating panels (dropdown menus, dialogs).
+
+---
+
+## Components
+
+### Frosted topbar
+
+Sticky, translucent, backdrop-blurred. The Notfair SVG mark sits at `22px` tall with a `.5px` vertical separator at `--border-strong` between mark and the per-page label. Nav links are `13px` `--ink-3` with `--ink` hover.
+
+```css
+.topbar {
+ background: rgba(245,245,247,.72);
+ backdrop-filter: saturate(180%) blur(20px);
+ border-bottom: .5px solid rgba(0,0,0,.08);
+ position: sticky; top: 0;
+}
+```
+
+### Hero
+
+`56px / 600 / -0.04em` headline. `21px / 400 / -0.015em` sub. `48px` between topbar and headline, `18px` between headline and sub. The hero is left-aligned on app screens, centered only on marketing surfaces (none in v1).
+
+### Grouped list (iOS Settings pattern)
+
+One shared rounded container, hairline (`.5px`) dividers between rows, no per-row shadow. Each row is `18px × 22px` padding, gets a `38px` app-icon glyph on the left, title + description in the middle, status on the right.
+
+```html
+<ol class="list">
+ <li class="tile">
+ <div class="glyph">G</div>
+ <div class="body">
+ <p class="name">Google Ads</p>
+ <p class="desc">Campaigns, bids, keywords, search terms.</p>
+ </div>
+ <div class="status"><span class="pill">Connected</span></div>
+ </li>
+</ol>
+```
+
+### Buttons
+
+Pill-shaped (`980px` radius), no shadow, solid fill. Two variants:
+
+- **Primary.** Filled `--accent`, white text, `11px × 22px` padding, `15px / 500 / -0.012em`.
+- **Ghost.** Transparent, `--accent` text, no border. Hover gives `--accent-soft` fill.
+
+No outlined buttons, no shadowed buttons, no gradient buttons. If we need a destructive button, it gets a separate red token added; we do not improvise.
+
+### Sub-action (text link with chevron)
+
+`13px / 500` `--accent` text + `›` chevron (Unicode U+203A). No pill chrome, no border. iOS Settings-row "Tap to choose" convention.
+
+### Connected indicator
+
+A `7px` filled circle in `--accent` followed by the word "Connected" in `--accent` color. No pill background, no border. Inline next to the row's name or in the status column.
+
+### Progress pips
+
+`22px` circular dots in a horizontal row with `32px / .5px` hairline connectors. Done = filled `--ink`. Active = filled `--accent`. Pending = `--surface` with hairline border. The numeric label sits inside the dot at `11px / 500`.
+
+---
+
+## Motion
+
+Defaults to `0.15s ease` for color/opacity/background. `0.18s cubic-bezier(.2,.7,.3,1)` for elevation / position transforms (lifts, translates). Avoid bounce, springs, and over-the-top entrance animations — Apple's product surfaces are nearly motionless; movement is reserved for navigation transitions.
+
+---
+
+## DO / DON'T
+
+**DO**
+- Trust whitespace. Apple ships pages with what feels like too much space — it isn't.
+- Use color to express state (`--accent` = active/connected; `--ink-3` vs `--ink-4` = primary vs support).
+- Make components "settings-row shaped" by default — grouped list, hairline divider, glyph + title + status.
+- Use `.5px` hairlines on retina, `1px` fallback.
+
+**DON'T**
+- Don't add font weights to fake contrast. Change color instead.
+- Don't bring back italics, eyebrows, mono micro-labels, all-caps section headers, dashed rules, or paper-grain textures.
+- Don't introduce new accent colors. The brand green is the only chromatic moment. Greys do the rest.
+- Don't use shadcn defaults verbatim — most arrive cooler-than-Apple by mistake (purple-tinted neutrals, gray borders too dark). Verify against `--ink` / `--border` tokens.
+- Don't reach for emoji as glyphs — use a 1–2 letter app-icon letterform or an SVG icon.
+
+---
+
+## Open questions (parked, not blocking v1)
+
+- **Dark mode.** Out of scope for v1. When we add it, we mirror Apple: a deep ink (`#0F0F11` or so), surfaces a single notch lighter, and the same `--accent` green — Apple keeps brand color identical across themes.
+- **Status colors.** No success/warning/error tokens yet. Add when first needed; do not preempt.
+- **Data display.** When dense tables or charts arrive, refine table-specific tokens (zebra rows, sticky headers). Don't extrapolate from settings-row conventions.
+
+---
+
+## Prototype reference
+
+The Apple-flavored prototype that locked this system in lives at `/tmp/notfair-design-explore/06-notfair.html` for the duration of this design session. After application, treat this `DESIGN.md` as the source of truth — the prototype is disposable.
diff --git a/notfair-cmo/public/notfair-mark.svg b/notfair-cmo/public/notfair-mark.svg
new file mode 100644
index 00000000..2b9a42df
--- /dev/null
+++ b/notfair-cmo/public/notfair-mark.svg
@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="-12 -155.6 178.036 168.6" width="178.036" height="168.6">
+ <path d="M52.200-143.600L43-46.800L17.200-46.800L8.200-143.600L52.200-143.600ZM46.300-35.200Q52.600-29.200 52.600-20Q52.600-10.800 46.200-4.900Q39.800 1 30.200 1Q20.600 1 14.300-4.900Q8-10.800 8-20Q8-29.200 14.200-35.200Q20.400-41.200 30.200-41.200Q40-41.200 46.300-35.200Z" fill="#4CAF6E" transform="translate(-8 0)"></path>
+ <path d="M51.800-51.400L51.800 0L14 0L14-143.600L111.800-143.600L111.800-110.800L51.800-110.800L51.800-84.200L102-84.200L102-51.400L51.800-51.400Z" fill="#1A1917" transform="translate(42.236363636363635 0)"></path>
+</svg>
\ No newline at end of file
diff --git a/notfair-cmo/src/app/globals.css b/notfair-cmo/src/app/globals.css
index 3b258cdb..d6d1ff67 100644
--- a/notfair-cmo/src/app/globals.css
+++ b/notfair-cmo/src/app/globals.css
@@ -4,26 +4,65 @@
@layer base {
:root {
- --background: 0 0% 100%;
- --foreground: 240 10% 3.9%;
+ /* ── notfair-cmo design system (see DESIGN.md) ───────────────────
+ Apple-flavored cool neutrals anchored on the Notfair brand
+ green #4CAF6E. Surfaces are pure white / Apple off-white; ink
+ is Apple's neutral scale; the accent does all chromatic work.
+
+ shadcn primitives are mapped onto these tokens so existing
+ Card/Button/etc. components inherit the system automatically. */
+
+ /* surfaces */
+ --background: 240 8% 96%; /* #F5F5F7 */
+ --foreground: 240 3% 12%; /* #1D1D1F */
--card: 0 0% 100%;
- --card-foreground: 240 10% 3.9%;
+ --card-foreground: 240 3% 12%;
--popover: 0 0% 100%;
- --popover-foreground: 240 10% 3.9%;
- --primary: 240 5.9% 10%;
- --primary-foreground: 0 0% 98%;
- --secondary: 240 4.8% 95.9%;
- --secondary-foreground: 240 5.9% 10%;
- --muted: 240 4.8% 95.9%;
- --muted-foreground: 240 3.8% 46.1%;
- --accent: 240 4.8% 95.9%;
- --accent-foreground: 240 5.9% 10%;
- --destructive: 0 84.2% 60.2%;
- --destructive-foreground: 0 0% 98%;
- --border: 240 5.9% 90%;
- --input: 240 5.9% 90%;
- --ring: 240 5.9% 10%;
- --radius: 0.5rem;
+ --popover-foreground: 240 3% 12%;
+
+ /* primary CTA — brand green */
+ --primary: 138 39% 49%; /* #4CAF6E */
+ --primary-foreground: 0 0% 100%;
+
+ /* secondary surface (used by Button variant=secondary, etc.) */
+ --secondary: 240 6% 94%; /* #EFEFF1 */
+ --secondary-foreground: 240 3% 12%;
+
+ /* muted text + surfaces */
+ --muted: 240 6% 94%;
+ --muted-foreground: 240 2% 44%; /* #6E6E73 */
+
+ /* shadcn "accent" surface (hover bg on dropdowns, etc.) — NOT the
+ brand accent. Keep neutral so brand green stays uncrowded. */
+ --accent: 240 6% 94%;
+ --accent-foreground: 240 3% 12%;
+
+ --destructive: 0 72% 51%;
+ --destructive-foreground: 0 0% 100%;
+
+ --border: 240 6% 83%; /* #D2D2D7 */
+ --input: 240 6% 83%;
+ --ring: 138 39% 49%; /* focus ring uses brand green */
+
+ --radius: 0.625rem; /* 10px — between sm and md per DESIGN.md */
+
+ /* ── DESIGN.md tokens (non-shadcn) ───────────────────────────────
+ Use these directly in custom components when the shadcn mapping
+ above isn't expressive enough. Comment names match DESIGN.md. */
+ --notfair-ink: 240 3% 12%; /* #1D1D1F — primary text */
+ --notfair-ink-2: 240 2% 18%; /* #2C2C2E — strong body */
+ --notfair-ink-3: 240 2% 26%; /* #424245 — body text */
+ --notfair-ink-4: 240 2% 44%; /* #6E6E73 — labels, support */
+ --notfair-surface-2: 240 6% 94%; /* #EFEFF1 — inset / glyph bg */
+ --notfair-border-strong: 240 5% 73%; /* #B8B8BE */
+ --notfair-accent: 138 39% 49%; /* #4CAF6E brand green */
+ --notfair-accent-soft: 138 31% 95%;/* #EDF7F0 */
+ --notfair-accent-border: 137 35% 75%; /* #A5D7B6 */
+
+ /* Apple-style diffuse shadows. No warm tints, no inner highlights. */
+ --notfair-shadow-sm: 0 1px 2px rgba(0,0,0,.04), 0 0 0 .5px rgba(0,0,0,.04);
+ --notfair-shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px -8px rgba(0,0,0,.10);
+ --notfair-shadow-lg: 0 2px 4px rgba(0,0,0,.06), 0 20px 50px -12px rgba(0,0,0,.18);
}
.dark {
@@ -86,6 +125,16 @@
* {
border-color: hsl(var(--border));
}
+ html, body {
+ /* SF Pro via system stack on Apple platforms, Inter elsewhere.
+ See DESIGN.md → Typography. */
+ font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text',
+ 'SF Pro Display', 'Inter', ui-sans-serif, system-ui, sans-serif;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ text-rendering: optimizeLegibility;
+ letter-spacing: -0.01em;
+ }
}
/* ────────────────────────────────────────────────────────────────────
@@ -159,3 +208,217 @@
--sidebar-border: hsl(240 3.7% 15.9%);
--sidebar-ring: hsl(217.2 91.2% 59.8%);
}
+
+/* ────────────────────────────────────────────────────────────────────
+ notfair-cmo design-system component classes.
+
+ These are the named building blocks called out in DESIGN.md so
+ onboarding (and later, every other surface) can compose them
+ directly. Naming convention: `.ns-*` ("notfair system") to keep
+ them visually distinct from generic Tailwind utilities and from
+ shadcn primitives.
+ ──────────────────────────────────────────────────────────────────── */
+
+@layer components {
+ /* Page container — compact: fits a standard 720–800px viewport without
+ scrolling so the Skip / Continue button is always visible. */
+ .ns-page { @apply mx-auto w-full max-w-[720px] px-6 pt-6 pb-10; }
+
+ /* Hero — tightened from 56px to 34px so headline + sub + content +
+ footer all fit in one viewport. Still confident, just less luxurious. */
+ .ns-hero-title {
+ @apply text-foreground;
+ font-size: 34px; line-height: 1.1; letter-spacing: -0.028em;
+ font-weight: 600; margin: 0 0 8px;
+ }
+ .ns-hero-sub {
+ color: hsl(var(--notfair-ink-3));
+ font-size: 15px; line-height: 1.45; letter-spacing: -0.008em;
+ max-width: 560px; margin: 0;
+ }
+ .ns-hero-sub b { color: hsl(var(--notfair-ink)); font-weight: 500; }
+
+ /* Section heading — quiet H2 above a grouped list. */
+ .ns-section-head {
+ @apply flex items-baseline justify-between gap-3;
+ margin-top: 24px;
+ }
+ .ns-section-head > :first-child {
+ @apply text-foreground;
+ font-size: 14px; font-weight: 600; letter-spacing: -0.012em;
+ }
+ .ns-section-head > :last-child {
+ color: hsl(var(--notfair-ink-4));
+ font-size: 12px; font-weight: 500; letter-spacing: -0.005em;
+ }
+
+ /* Grouped list — single rounded container, hairline dividers. */
+ .ns-list {
+ @apply flex flex-col bg-card rounded-[14px] overflow-hidden;
+ margin-top: 20px;
+ box-shadow: var(--notfair-shadow);
+ }
+ .ns-tile {
+ @apply flex items-center gap-3 bg-card border-0 cursor-pointer transition-colors;
+ padding: 12px 16px;
+ border-bottom: 0.5px solid hsl(var(--border));
+ text-align: left;
+ width: 100%;
+ }
+ .ns-tile:last-child { border-bottom: 0; }
+ .ns-tile:hover { background: #FAFAFC; }
+ .ns-tile:disabled { cursor: not-allowed; opacity: 0.6; }
+ .ns-tile-glyph {
+ @apply grid place-items-center flex-shrink-0 font-semibold uppercase;
+ width: 32px; height: 32px; border-radius: 8px;
+ background: hsl(var(--notfair-surface-2));
+ color: hsl(var(--notfair-ink-2));
+ font-size: 14px; letter-spacing: -0.018em;
+ }
+ .ns-tile-body { @apply flex-1 min-w-0; }
+ /* Title row hosts the MCP name + the "Required for X agent" badge so
+ they sit on the same baseline. Wraps to a new line on narrow tiles. */
+ .ns-tile-name-row {
+ @apply flex flex-wrap items-baseline gap-x-2 gap-y-1;
+ margin: 0;
+ }
+ .ns-tile-name {
+ @apply text-foreground m-0;
+ font-weight: 500; font-size: 14.5px; letter-spacing: -0.012em;
+ line-height: 1.3;
+ }
+ /* "Required for X agent" badge — quiet accent chip that makes the
+ MCP↔agent dependency visible at a glance. */
+ .ns-tile-badge {
+ display: inline-flex; align-items: center;
+ font-size: 10.5px; font-weight: 500; letter-spacing: 0;
+ line-height: 1; padding: 3px 8px; border-radius: 999px;
+ background: hsl(var(--notfair-accent-soft));
+ color: hsl(var(--notfair-accent));
+ white-space: nowrap;
+ }
+ .ns-tile-desc {
+ color: hsl(var(--notfair-ink-4));
+ font-size: 12.5px; line-height: 1.35; letter-spacing: -0.003em;
+ margin: 1px 0 0;
+ }
+ .ns-tile-status {
+ @apply flex flex-col items-end flex-shrink-0;
+ gap: 4px;
+ color: hsl(var(--notfair-ink-4));
+ font-size: 12.5px; font-weight: 500; letter-spacing: -0.005em;
+ }
+ .ns-tile-status .arrow { font-size: 16px; font-weight: 300; line-height: 1; }
+
+ /* "Connected" indicator — small dot + word in accent green. */
+ .ns-status-connected {
+ color: hsl(var(--notfair-accent));
+ font-weight: 500; font-size: 12.5px; letter-spacing: -0.005em;
+ display: inline-flex; align-items: center; gap: 6px;
+ }
+ .ns-status-connected::before {
+ content: ""; display: inline-block; width: 6px; height: 6px;
+ border-radius: 50%; background: hsl(var(--notfair-accent));
+ }
+
+ /* Connected tile — accent-tinted glyph. */
+ .ns-tile.is-connected .ns-tile-glyph {
+ background: hsl(var(--notfair-accent-soft));
+ color: hsl(var(--notfair-accent));
+ }
+
+ /* Sub-action — Apple text link with chevron. */
+ .ns-subaction {
+ @apply inline-flex items-center;
+ color: hsl(var(--notfair-accent));
+ font-weight: 500; font-size: 12.5px; letter-spacing: -0.005em;
+ margin-top: 4px; gap: 4px;
+ background: transparent; border: 0; cursor: pointer; padding: 0;
+ }
+ .ns-subaction:hover { opacity: 0.85; }
+ .ns-subaction::after {
+ content: "\203A"; font-size: 16px; line-height: 1;
+ margin-left: 2px; font-weight: 400;
+ }
+
+ /* Footer — bottom row of a wizard step. Sticks below the list, no
+ huge top margin. */
+ .ns-foot {
+ @apply flex flex-wrap items-center justify-between gap-4;
+ margin-top: 20px;
+ }
+ .ns-footnote {
+ color: hsl(var(--notfair-ink-4));
+ font-size: 12px; line-height: 1.45; letter-spacing: -0.005em;
+ max-width: 440px; margin: 0;
+ }
+ .ns-footnote a { color: hsl(var(--notfair-accent)); text-decoration: none; }
+ .ns-footnote a:hover { text-decoration: underline; }
+
+ /* Pill buttons — Apple shape, solid fill / ghost. Compact for compact
+ wizard steps. */
+ .ns-btn {
+ @apply inline-flex items-center gap-2 cursor-pointer;
+ font: inherit; font-size: 14px; font-weight: 500;
+ letter-spacing: -0.012em;
+ padding: 9px 18px; border-radius: 980px; border: 0;
+ transition: 0.15s ease;
+ }
+ .ns-btn-primary { background: hsl(var(--notfair-accent)); color: #fff; }
+ .ns-btn-primary:hover { filter: brightness(0.94); }
+ .ns-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
+ .ns-btn-ghost {
+ background: transparent; color: hsl(var(--notfair-accent));
+ padding: 9px 14px;
+ }
+ .ns-btn-ghost:hover { background: hsl(var(--notfair-accent-soft)); }
+ /* Compact pill used inside grouped-list rows as the right-side action.
+ Not a button element — the whole row is the clickable target. */
+ .ns-btn-sm {
+ font-size: 12.5px; padding: 5px 12px;
+ }
+
+ /* Progress pips — small numbered circles + hairlines. */
+ .ns-progress {
+ @apply flex items-center;
+ gap: 10px;
+ color: hsl(var(--notfair-ink-4));
+ font-size: 12px; font-weight: 500; letter-spacing: -0.006em;
+ }
+ .ns-pip { @apply flex items-center; gap: 7px; }
+ .ns-pip-dot {
+ @apply grid place-items-center;
+ width: 18px; height: 18px; border-radius: 50%;
+ background: hsl(var(--card));
+ border: 0.5px solid hsl(var(--border));
+ color: hsl(var(--notfair-ink-4));
+ font-size: 10px; font-weight: 500;
+ }
+ .ns-pip.is-done .ns-pip-dot {
+ background: hsl(var(--notfair-ink));
+ color: #fff; border-color: hsl(var(--notfair-ink));
+ }
+ .ns-pip.is-active .ns-pip-dot {
+ background: hsl(var(--notfair-accent));
+ color: #fff; border-color: hsl(var(--notfair-accent));
+ }
+ .ns-pip.is-active { color: hsl(var(--notfair-ink)); }
+ .ns-pip-line {
+ display: inline-block; width: 20px; height: 0.5px;
+ background: hsl(var(--notfair-border-strong)); opacity: 0.6;
+ }
+
+ /* Top brand bar — Notfair mark + per-page label, no nav. */
+ .ns-topbar {
+ @apply flex items-center;
+ gap: 12px;
+ margin-bottom: 16px;
+ }
+ .ns-topbar img { height: 18px; width: auto; }
+ .ns-topbar-label {
+ color: hsl(var(--notfair-ink-4));
+ font-size: 12px; letter-spacing: -0.005em; font-weight: 400;
+ padding-left: 12px;
+ border-left: 0.5px solid hsl(var(--notfair-border-strong));
+ }
+}
diff --git a/notfair-cmo/src/components/add-mcp-server-card.tsx b/notfair-cmo/src/components/add-mcp-server-card.tsx
index fd119f52..12abd4fe 100644
--- a/notfair-cmo/src/components/add-mcp-server-card.tsx
+++ b/notfair-cmo/src/components/add-mcp-server-card.tsx
@@ -1,6 +1,6 @@
"use client";
-import { useState } from "react";
+import { type ReactNode, useState } from "react";
import { useRouter } from "next/navigation";
import { Plus, Loader2, BookOpenText, MoreHorizontal } from "lucide-react";
@@ -42,14 +42,28 @@ import { BrowseConnectorsDialog } from "@/components/browse-connectors-dialog";
export function AddMcpServerMenu({
connectedKeys = [],
connectedResourceUrls = [],
+ hideKeys = [],
+ trigger,
+ align = "end",
}: {
/** Catalog keys whose runtime status is `connected`. Browse tiles for
- * these render as non-clickable "connected" pills. */
+ * these are filtered out of the grid entirely. */
connectedKeys?: string[];
/** Normalized resource URLs of connected entries — paired with
* `connectedKeys` so legacy rows (where the key was slugified
* differently than the trusted-connector id) still match by URL. */
connectedResourceUrls?: string[];
+ /** Browse-dialog `hideKeys` passthrough — exclude specific catalog
+ * entries from the grid (used by onboarding's connect step to hide
+ * the recommended trio that already has first-class tiles). */
+ hideKeys?: string[];
+ /** Optional custom trigger. When omitted, renders the default pill
+ * "Add server" button used by the Connections page header. Pass a
+ * custom button-shaped node when slotting this into a list row,
+ * grouped list, or other in-line surface. */
+ trigger?: ReactNode;
+ /** Radix `align` for the dropdown content. */
+ align?: "start" | "center" | "end";
}) {
const [browseOpen, setBrowseOpen] = useState(false);
const [customOpen, setCustomOpen] = useState(false);
@@ -58,16 +72,18 @@ export function AddMcpServerMenu({
<>
<DropdownMenu>
<DropdownMenuTrigger asChild>
- <Button
- type="button"
- size="sm"
- className="h-9 gap-1.5 rounded-full px-4 shadow-sm"
- >
- <Plus className="size-3.5" />
- Add server
- </Button>
+ {trigger ?? (
+ <Button
+ type="button"
+ size="sm"
+ className="h-9 gap-1.5 rounded-full px-4 shadow-sm"
+ >
+ <Plus className="size-3.5" />
+ Add server
+ </Button>
+ )}
</DropdownMenuTrigger>
- <DropdownMenuContent align="end" className="w-60">
+ <DropdownMenuContent align={align} className="w-60">
<DropdownMenuItem
onSelect={() => setBrowseOpen(true)}
className="gap-2 py-2.5"
@@ -100,6 +116,7 @@ export function AddMcpServerMenu({
onOpenChange={setBrowseOpen}
connectedKeys={connectedKeys}
connectedResourceUrls={connectedResourceUrls}
+ hideKeys={hideKeys}
/>
<CustomConnectorDialog open={customOpen} onOpenChange={setCustomOpen} />
</>
diff --git a/notfair-cmo/src/components/browse-connectors-dialog.tsx b/notfair-cmo/src/components/browse-connectors-dialog.tsx
index f9a7f84f..94dbd476 100644
--- a/notfair-cmo/src/components/browse-connectors-dialog.tsx
+++ b/notfair-cmo/src/components/browse-connectors-dialog.tsx
@@ -2,7 +2,7 @@
import { useState, useTransition } from "react";
import { useRouter } from "next/navigation";
-import { CheckCircle2, Loader2 } from "lucide-react";
+import { Loader2 } from "lucide-react";
import {
Dialog,
@@ -42,16 +42,16 @@ type Props = {
};
/**
- * Two-column grid of trusted MCP connectors. Clicking a tile is a
- * one-shot setup: `addUserMcpServerAction` writes the row (idempotent —
- * re-clicking a stale row is fine), then `startMcpConnect` is fired
- * immediately and the browser is redirected to the issuer's authorize
- * URL. The user lands back on the connections page already connected —
- * no second "Connect" click required.
+ * Two-column grid of trusted MCP connectors that aren't yet connected for
+ * this project. Clicking a tile is a one-shot setup:
+ * `addUserMcpServerAction` writes the row (idempotent — re-clicking a
+ * stale row is fine), then `startMcpConnect` is fired immediately and the
+ * browser is redirected to the issuer's authorize URL.
*
- * Tiles for connectors already showing as `connected` on the page are
- * rendered non-interactive with a green "connected" indicator so users
- * don't re-trigger an OAuth roundtrip for something that's already live.
+ * Already-connected connectors are filtered out entirely (rather than
+ * rendered greyed-out) so the dialog only ever surfaces actionable
+ * options. When every available connector is already wired, the dialog
+ * shows an empty-state message.
*/
export function BrowseConnectorsDialog({
open,
@@ -63,9 +63,12 @@ export function BrowseConnectorsDialog({
const connectedKeySet = new Set(connectedKeys);
const connectedUrlSet = new Set(connectedResourceUrls);
const hideKeySet = new Set(hideKeys);
- const visibleConnectors = TRUSTED_CONNECTORS.filter(
- (c) => !hideKeySet.has(c.id),
- );
+ const availableConnectors = TRUSTED_CONNECTORS.filter((c) => {
+ if (hideKeySet.has(c.id)) return false;
+ if (connectedKeySet.has(c.id)) return false;
+ if (connectedUrlSet.has(normalizeResourceUrl(c.resource_url))) return false;
+ return true;
+ });
return (
<Dialog open={open} onOpenChange={onOpenChange}>
<DialogContent className="sm:max-w-2xl">
@@ -76,21 +79,21 @@ export function BrowseConnectorsDialog({
flow in one step.
</DialogDescription>
</DialogHeader>
- <div className="grid grid-cols-1 gap-2 sm:grid-cols-2">
- {visibleConnectors.map((c) => {
- const alreadyConnected =
- connectedKeySet.has(c.id) ||
- connectedUrlSet.has(normalizeResourceUrl(c.resource_url));
- return (
+ {availableConnectors.length === 0 ? (
+ <p className="py-8 text-center text-sm text-muted-foreground">
+ All available connectors are already connected.
+ </p>
+ ) : (
+ <div className="grid grid-cols-1 gap-2 sm:grid-cols-2">
+ {availableConnectors.map((c) => (
<ConnectorTile
key={c.id}
connector={c}
- alreadyConnected={alreadyConnected}
onAdded={() => onOpenChange(false)}
/>
- );
- })}
- </div>
+ ))}
+ </div>
+ )}
</DialogContent>
</Dialog>
);
@@ -98,11 +101,9 @@ export function BrowseConnectorsDialog({
function ConnectorTile({
connector,
- alreadyConnected,
onAdded,
}: {
connector: TrustedConnector;
- alreadyConnected: boolean;
onAdded: () => void;
}) {
const [pending, startTransition] = useTransition();
@@ -153,33 +154,6 @@ function ConnectorTile({
});
}
- if (alreadyConnected) {
- return (
- <div
- aria-disabled
- className="flex items-start gap-3 rounded-md border border-emerald-500/30 bg-emerald-500/5 p-3 text-left ring-1 ring-inset ring-emerald-500/10"
- >
- <McpIcon
- resourceUrl={connector.resource_url}
- alt={connector.display_name}
- size="lg"
- />
- <div className="min-w-0 flex-1">
- <div className="flex items-center gap-2">
- <p className="text-sm font-medium">{connector.display_name}</p>
- <span className="inline-flex items-center gap-1 font-mono text-[10px] uppercase tracking-[0.14em] text-emerald-700 dark:text-emerald-400">
- <CheckCircle2 className="size-3" />
- connected
- </span>
- </div>
- <p className="mt-0.5 line-clamp-2 text-xs text-muted-foreground">
- {connector.description}
- </p>
- </div>
- </div>
- );
- }
-
return (
<button
type="button"
diff --git a/notfair-cmo/src/components/onboarding-flow.test.tsx b/notfair-cmo/src/components/onboarding-flow.test.tsx
index 8ec0ee1b..7867923c 100644
--- a/notfair-cmo/src/components/onboarding-flow.test.tsx
+++ b/notfair-cmo/src/components/onboarding-flow.test.tsx
@@ -129,6 +129,7 @@ beforeEach(() => {
googleads: { connected: false, account_selected: false },
metaads: { connected: false, account_selected: false },
gsc: { connected: false, account_selected: false },
+ extras: [],
extra_connected_count: 0,
website_url: null,
},
@@ -143,7 +144,7 @@ describe("OnboardingFlow — NameStep (default step)", () => {
it("renders the project-name form when no step param is set", () => {
render(<OnboardingFlow />);
expect(
- screen.getByRole("heading", { name: /Let.s set up your CMO/i }),
+ screen.getByRole("heading", { name: /Let.s set up your workspace/i }),
).toBeInTheDocument();
expect(screen.getByLabelText(/Name/i)).toBeInTheDocument();
expect(screen.getByRole("button", { name: /Continue/i })).toBeInTheDocument();
@@ -234,7 +235,7 @@ describe("OnboardingFlow — ConnectStep", () => {
setStep("connect", "acme");
render(<OnboardingFlow />);
expect(
- await screen.findByRole("heading", { name: /Connect your tools/i }),
+ await screen.findByRole("heading", { name: /Connect MCPs to your agents/i }),
).toBeInTheDocument();
expect(
screen.getByRole("button", { name: /^Google Ads/i }),
@@ -249,7 +250,7 @@ describe("OnboardingFlow — ConnectStep", () => {
screen.getByRole("button", { name: /More tools/i }),
).toBeInTheDocument();
expect(
- screen.getByRole("button", { name: /Skip for now/i }),
+ screen.getByRole("button", { name: /^Skip/i }),
).toBeInTheDocument();
});
@@ -298,29 +299,30 @@ describe("OnboardingFlow — ConnectStep", () => {
it("hands off to the setup screen via Skip when zero MCPs are connected", async () => {
setStep("connect", "acme");
render(<OnboardingFlow />);
- fireEvent.click(await screen.findByRole("button", { name: /Skip for now/i }));
+ fireEvent.click(await screen.findByRole("button", { name: /^Skip/i }));
expect(routerReplace).toHaveBeenCalledWith(
"/onboarding?step=setup&slug=acme&from=skip",
);
});
- it("flips Skip → 'Done adding MCPs — next step' once at least one MCP is connected", async () => {
+ it("flips Skip → 'Next' once at least one MCP is connected", async () => {
getConnectStepStateAction.mockResolvedValue({
ok: true,
state: {
googleads: { connected: true, account_selected: true },
metaads: { connected: false, account_selected: false },
gsc: { connected: false, account_selected: false },
+ extras: [],
extra_connected_count: 0,
website_url: null,
},
});
setStep("connect", "acme");
render(<OnboardingFlow />);
- const done = await screen.findByRole("button", { name: /Done adding MCPs/i });
+ const done = await screen.findByRole("button", { name: /^Next/i });
expect(done).toBeInTheDocument();
expect(
- screen.queryByRole("button", { name: /Skip for now/i }),
+ screen.queryByRole("button", { name: /^Skip/i }),
).not.toBeInTheDocument();
fireEvent.click(done);
expect(routerReplace).toHaveBeenCalledWith(
@@ -328,6 +330,42 @@ describe("OnboardingFlow — ConnectStep", () => {
);
});
+ it("renders a row for each extra MCP connected via the More dialog", async () => {
+ getConnectStepStateAction.mockResolvedValue({
+ ok: true,
+ state: {
+ googleads: { connected: false, account_selected: false },
+ metaads: { connected: false, account_selected: false },
+ gsc: { connected: false, account_selected: false },
+ extras: [
+ {
+ key: "stripe",
+ display_name: "Stripe",
+ description: "Payments.",
+ resource_url: "https://mcp.stripe.com/",
+ },
+ {
+ key: "supabase",
+ display_name: "Supabase",
+ description: "Postgres.",
+ resource_url: "https://mcp.supabase.com/mcp",
+ },
+ ],
+ extra_connected_count: 2,
+ website_url: null,
+ },
+ });
+ setStep("connect", "acme");
+ render(<OnboardingFlow />);
+ // Both extras render as new rows in the grouped list, each with their
+ // display name visible.
+ expect(await screen.findByText("Stripe")).toBeInTheDocument();
+ expect(screen.getByText("Supabase")).toBeInTheDocument();
+ // The "More tools" tile still surfaces the count so the user can see
+ // at a glance how many extras are wired up.
+ expect(screen.getByText(/2 connected/)).toBeInTheDocument();
+ });
+
it("shows a 'Select Google Ads account' sub-action when the MCP is connected but no account is picked", async () => {
getConnectStepStateAction.mockResolvedValue({
ok: true,
@@ -335,6 +373,7 @@ describe("OnboardingFlow — ConnectStep", () => {
googleads: { connected: true, account_selected: false },
metaads: { connected: false, account_selected: false },
gsc: { connected: false, account_selected: false },
+ extras: [],
extra_connected_count: 0,
website_url: null,
},
diff --git a/notfair-cmo/src/components/onboarding-flow.tsx b/notfair-cmo/src/components/onboarding-flow.tsx
index 1049839c..08f31342 100644
--- a/notfair-cmo/src/components/onboarding-flow.tsx
+++ b/notfair-cmo/src/components/onboarding-flow.tsx
@@ -29,7 +29,8 @@ import {
type GscProperty,
type ConnectStepState,
} from "@/server/onboarding/accounts";
-import { BrowseConnectorsDialog } from "@/components/browse-connectors-dialog";
+import { AddMcpServerMenu } from "@/components/add-mcp-server-card";
+import { McpIcon } from "@/components/mcp-icon";
type Step =
| "name"
@@ -61,15 +62,47 @@ function OnboardingFlowInner() {
? stepParam
: "name";
+ // Step → progress-pip state mapping. The pickers (account, meta-account,
+ // gsc-property) all roll up under "Connect" because they're sub-flows
+ // launched from the connect step and return to it.
+ const phase: "name" | "connect" | "setup" =
+ step === "name" ? "name" : step === "setup" ? "setup" : "connect";
+
return (
- <div className="mx-auto w-full max-w-[720px] space-y-6 pt-8 pb-12">
+ <div className="ns-page">
<a
href="#onboarding-main"
className="sr-only focus:not-sr-only focus:absolute focus:top-2 focus:left-2 focus:z-50 focus:rounded-md focus:bg-background focus:px-3 focus:py-2 focus:text-sm focus:shadow"
>
Skip to content
</a>
- <main id="onboarding-main" className="space-y-6">
+
+ {/* Brand row + progress pips. The mark anchors the wizard so the user
+ always sees where they are; the pips show how far they've gone. */}
+ <div className="ns-topbar">
+ {/* eslint-disable-next-line @next/next/no-img-element */}
+ <img src="/notfair-mark.svg" alt="Notfair" />
+ <span className="ns-topbar-label">Notfair CMO</span>
+ <div className="ml-auto">
+ <div className="ns-progress">
+ <Pip n={1} label="Workspace" state={phase === "name" ? "active" : "done"} />
+ <span className="ns-pip-line" />
+ <Pip
+ n={2}
+ label="Connect"
+ state={phase === "name" ? "pending" : phase === "connect" ? "active" : "done"}
+ />
+ <span className="ns-pip-line" />
+ <Pip
+ n={3}
+ label="Setup"
+ state={phase === "setup" ? "active" : "pending"}
+ />
+ </div>
+ </div>
+ </div>
+
+ <main id="onboarding-main">
{step === "name" && (
<NameStep
onCreated={(s) =>
@@ -93,6 +126,25 @@ function OnboardingFlowInner() {
);
}
+function Pip({
+ n,
+ label,
+ state,
+}: {
+ n: number;
+ label: string;
+ state: "pending" | "active" | "done";
+}) {
+ return (
+ <div
+ className={`ns-pip ${state === "done" ? "is-done" : ""} ${state === "active" ? "is-active" : ""}`}
+ >
+ <span className="ns-pip-dot">{state === "done" ? "✓" : n}</span>
+ <span className="hidden sm:inline">{label}</span>
+ </div>
+ );
+}
+
// ── Codebase folder picker (Step 1 helper) ─────────────────────────
//
// Browsers don't expose absolute paths from `<input type="file"
@@ -176,84 +228,82 @@ function NameStep({ onCreated }: { onCreated: (slug: string) => void }) {
return (
<>
- <header className="space-y-2">
- <h1 className="text-3xl font-semibold tracking-tight text-foreground">
- Let&rsquo;s set up your CMO.
- </h1>
- <p className="text-sm text-muted-foreground">
+ <header>
+ <h1 className="ns-hero-title">Let&rsquo;s set up your workspace.</h1>
+ <p className="ns-hero-sub">
Tell me what this workspace is so I can hit the ground running.
</p>
</header>
- <Card>
- <CardHeader>
- <CardTitle className="text-base">Workspace basics</CardTitle>
- <CardDescription>
- Name is required. Site and codebase are optional but help the
- CMO write a more accurate first plan. Slug (used in agent
- names) is derived from the name and immutable.
- </CardDescription>
- </CardHeader>
- <CardContent>
- <form action={formAction} className="space-y-4">
- <div className="space-y-2">
- <Label htmlFor="display_name">Workspace name</Label>
- <Input
- id="display_name"
- name="display_name"
- required
- autoFocus
- placeholder="Notfair"
- maxLength={80}
- disabled={isPending}
- />
- </div>
+ <form action={formAction} className="mt-5 space-y-3.5">
+ <div className="space-y-1.5">
+ <Label htmlFor="display_name" className="text-[13px] font-medium">
+ Workspace name
+ </Label>
+ <Input
+ id="display_name"
+ name="display_name"
+ required
+ autoFocus
+ placeholder="Notfair"
+ maxLength={80}
+ disabled={isPending}
+ className="h-9 rounded-lg text-[14px]"
+ />
+ </div>
- <div className="space-y-2">
- <Label htmlFor="website_url">
- Website URL{" "}
- <span className="text-xs font-normal text-muted-foreground">
- (optional)
- </span>
- </Label>
- <Input
- id="website_url"
- name="website_url"
- type="url"
- placeholder="https://notfair.co"
- maxLength={500}
- disabled={isPending}
- />
- <p className="text-xs text-muted-foreground">
- The CMO will skim a few pages to learn what you sell.
- </p>
- </div>
- <div className="space-y-2">
- <Label htmlFor="codebase_path">
- Local codebase folder{" "}
- <span className="text-xs font-normal text-muted-foreground">
- (optional)
- </span>
- </Label>
- <CodebasePathPicker disabled={isPending} />
- <p className="text-xs text-muted-foreground">
- Folder the CMO can read locally — README, package.json,
- top-level files. Skim only, not a code review.
- </p>
- </div>
- <HarnessPicker disabled={isPending} />
- {errorMessage && (
- <p role="alert" className="text-sm text-destructive">
- {errorMessage}
- </p>
- )}
- <Button type="submit" size="lg" disabled={isPending}>
- {isPending ? <Loader2 className="mr-1.5 size-4 animate-spin" /> : null}
- Continue
- </Button>
- </form>
- </CardContent>
- </Card>
+ <div className="space-y-1.5">
+ <Label htmlFor="website_url" className="text-[13px] font-medium">
+ Website URL{" "}
+ <span className="text-[12px] font-normal text-muted-foreground">
+ (optional)
+ </span>
+ </Label>
+ <Input
+ id="website_url"
+ name="website_url"
+ type="url"
+ placeholder="https://notfair.co"
+ maxLength={500}
+ disabled={isPending}
+ className="h-9 rounded-lg text-[14px]"
+ />
+ <p className="text-[11.5px] text-muted-foreground leading-tight">
+ The CMO will skim a few pages to learn what you sell.
+ </p>
+ </div>
+
+ <div className="space-y-1.5">
+ <Label htmlFor="codebase_path" className="text-[13px] font-medium">
+ Local codebase folder{" "}
+ <span className="text-[12px] font-normal text-muted-foreground">
+ (optional)
+ </span>
+ </Label>
+ <CodebasePathPicker disabled={isPending} />
+ <p className="text-[11.5px] text-muted-foreground leading-tight">
+ Folder the CMO can read locally — README, package.json, top-level
+ files. Skim only.
+ </p>
+ </div>
+
+ <HarnessPicker disabled={isPending} />
+
+ {errorMessage && (
+ <p role="alert" className="text-[13px] text-destructive">
+ {errorMessage}
+ </p>
+ )}
+
+ <button
+ type="submit"
+ disabled={isPending}
+ className="ns-btn ns-btn-primary"
+ >
+ {isPending ? <Loader2 className="size-4 animate-spin" /> : null}
+ Continue
+ </button>
+ </form>
</>
);
}
@@ -342,9 +392,21 @@ function HarnessPicker({ disabled }: { disabled: boolean }) {
*/
type RecommendedTile = {
mcp_key: string;
- display_name: string;
- /** Short description shown under the title when the tile isn't connected. */
+ /** Primary row title — the MCP name, e.g. "Google Ads MCP". Doubles
+ * as the tile's aria-label so existing tests that match by platform
+ * prefix (`/^Google Ads/`) still resolve. */
+ mcp_display_name: string;
+ /** Short agent label rendered as a pill badge next to the title,
+ * e.g. "Google Ads agent". The badge makes the MCP↔agent dependency
+ * explicit so users understand connecting this MCP enables that agent. */
+ agent_badge: string;
+ /** What the user gets — phrased as the agent's capabilities (verbs),
+ * not the MCP's data surfaces (nouns). Concrete benefit over abstract
+ * feature listing. */
description: string;
+ /** Resource URL the OAuth flow targets — also feeds <McpIcon>'s favicon
+ * lookup so each tile shows the brand mark the connections page uses. */
+ resource_url: string;
/** Sub-step the OAuth callback should land on so the user can pick an
* account/property when their token covers more than one. */
account_step: "account" | "meta-account" | "gsc-property";
@@ -355,22 +417,33 @@ type RecommendedTile = {
const RECOMMENDED_TILES: RecommendedTile[] = [
{
mcp_key: "notfair-googleads",
- display_name: "Google Ads",
- description: "Campaigns, bids, keywords, search terms, change history.",
+ mcp_display_name: "Google Ads MCP",
+ agent_badge: "Google Ads agent",
+ description:
+ "Audits campaigns, finds wasted spend, proposes bid changes.",
+ resource_url: "https://notfair.co/api/mcp/google_ads",
account_step: "account",
account_action_label: "Select Google Ads account",
},
{
mcp_key: "notfair-metaads",
- display_name: "Meta Ads",
- description: "Facebook + Instagram campaigns, ad sets, creative, insights.",
+ mcp_display_name: "Meta Ads MCP",
+ agent_badge: "Meta Ads agent",
+ description:
+ "Audits ad sets, diagnoses creative fatigue, surfaces ROAS winners.",
+ resource_url: "https://notfair.co/api/mcp/meta_ads",
account_step: "meta-account",
account_action_label: "Select Meta ad account",
},
{
mcp_key: "notfair-googlesearchconsole",
- display_name: "Google Search Console",
- description: "Organic search performance, queries, pages, indexing.",
+ mcp_display_name: "Google Search Console MCP",
+ // SEO agent owns Search Console — there's no dedicated GSC agent.
+ // See SPECIALIST_TEMPLATE_BY_MCP_KEY in agent-templates.ts.
+ agent_badge: "SEO agent",
+ description:
+ "Pulls organic performance, surfaces query and page movers, diagnoses indexing.",
+ resource_url: "https://notfair.co/api/mcp/google_search_console",
account_step: "gsc-property",
account_action_label: "Select GSC property",
},
@@ -384,7 +457,6 @@ type ConnectStepStateView =
function ConnectStep({ slug }: { slug: string }) {
const router = useRouter();
const [view, setView] = useState<ConnectStepStateView>({ phase: "loading" });
- const [moreOpen, setMoreOpen] = useState(false);
const [tileBusy, setTileBusy] = useState<string | null>(null);
const [advancing, setAdvancing] = useState(false);
const connectionsHref = projectHref(slug, "/connections");
@@ -455,33 +527,27 @@ function ConnectStep({ slug }: { slug: string }) {
if (view.phase === "loading") {
return (
- <Card>
- <CardContent className="space-y-2 pt-6 pb-6">
- <div className="flex items-center gap-3 text-sm">
- <Loader2 className="size-4 animate-spin text-muted-foreground" aria-hidden />
- <span className="font-medium">Loading your connections&hellip;</span>
- </div>
- </CardContent>
- </Card>
+ <div className="flex items-center gap-3 text-sm text-muted-foreground py-8">
+ <Loader2 className="size-4 animate-spin" aria-hidden />
+ <span>Loading your connections&hellip;</span>
+ </div>
);
}
if (view.phase === "error") {
return (
- <Card role="alert">
- <CardContent className="space-y-3 pt-6 pb-6">
- <div className="flex items-center gap-2">
- <AlertCircle className="size-4 text-amber-600" aria-hidden />
- <span className="font-medium text-sm">
- Couldn&rsquo;t load connection state.
- </span>
- </div>
- <p className="text-xs text-muted-foreground">{view.message}</p>
- <Button asChild>
- <Link href="/onboarding">Start over</Link>
- </Button>
- </CardContent>
- </Card>
+ <div role="alert" className="ns-list p-6 space-y-3">
+ <div className="flex items-center gap-2">
+ <AlertCircle className="size-4 text-amber-600" aria-hidden />
+ <span className="font-medium text-sm">
+ Couldn&rsquo;t load connection state.
+ </span>
+ </div>
+ <p className="text-xs text-muted-foreground">{view.message}</p>
+ <Link href="/onboarding" className="ns-btn ns-btn-primary">
+ Start over
+ </Link>
+ </div>
);
}
@@ -499,18 +565,15 @@ function ConnectStep({ slug }: { slug: string }) {
return (
<>
- <header className="space-y-2">
- <h1 className="text-3xl font-semibold tracking-tight text-foreground">
- Connect your tools.
- </h1>
- <p className="text-sm text-muted-foreground">
- Each tool you connect lets one of your specialist agents come
- online. Read-only at first &mdash; nothing changes until you
- approve a write.
+ <header>
+ <h1 className="ns-hero-title">Connect MCPs to your agents.</h1>
+ <p className="ns-hero-sub">
+ Each MCP gives your <b>specialist agent</b> the data and APIs to
+ do real work.
</p>
</header>
- <div className="grid grid-cols-1 gap-3 sm:grid-cols-2">
+ <ol className="ns-list">
{RECOMMENDED_TILES.map((tile) => (
<RecommendedConnectorTile
key={tile.mcp_key}
@@ -522,50 +585,91 @@ function ConnectStep({ slug }: { slug: string }) {
onPickAccount={() => onPickAccount(tile)}
/>
))}
- <MoreConnectorsTile
- extraConnectedCount={state.extra_connected_count}
- onOpen={() => setMoreOpen(true)}
- />
- </div>
+ {/* Connected extras (Stripe, Supabase, …) added via the "More tools"
+ dialog land here, between the recommended trio and the More row,
+ so the list stays in the user's mental order: top tier first,
+ extras next, the door to add more last. */}
+ {state.extras.map((extra) => (
+ <ExtraConnectorTile key={extra.key} extra={extra} />
+ ))}
+ <li>
+ {/* Reuse the connections-page Add-MCP menu so onboarding gets the
+ same Browse + Custom paths. The trigger is a tile-shaped
+ button so it sits naturally as the last row of the grouped
+ list; the dropdown opens from there. */}
+ <AddMcpServerMenu
+ align="start"
+ // Hide the three recommended MCPs from Browse — they each have
+ // their own row above already, no point re-listing them.
+ hideKeys={RECOMMENDED_TILES.map((t) => t.mcp_key)}
+ // Filter already-connected entries from Browse. The dialog
+ // already filters via connectedKeys; the recommended trio is
+ // also in hideKeys above for belt-and-suspenders.
+ connectedKeys={[
+ ...(state.googleads.connected ? ["notfair-googleads"] : []),
+ ...(state.metaads.connected ? ["notfair-metaads"] : []),
+ ...(state.gsc.connected ? ["notfair-googlesearchconsole"] : []),
+ ...state.extras.map((e) => e.key),
+ ]}
+ trigger={
+ <button
+ type="button"
+ aria-label="More tools"
+ className="ns-tile w-full"
+ >
+ <span className="ns-tile-glyph" aria-hidden>
+ +
+ </span>
+ <span className="ns-tile-body">
+ <span className="ns-tile-name-row">
+ <span className="ns-tile-name">More tools</span>
+ </span>
+ <span className="ns-tile-desc block">
+ Browse Stripe, Supabase, PostHog, or paste a custom MCP URL.
+ </span>
+ </span>
+ <span className="ns-tile-status">
+ {state.extra_connected_count > 0 ? (
+ <span>{state.extra_connected_count} connected</span>
+ ) : (
+ <span className="arrow" aria-hidden>
+ ›
+ </span>
+ )}
+ </span>
+ </button>
+ }
+ />
+ </li>
+ </ol>
- <Card>
- <CardContent className="flex flex-wrap items-center justify-between gap-3 pt-6 pb-6">
- <p className="text-xs text-muted-foreground">
- You can connect, disconnect, or add custom MCPs anytime in{" "}
- <Link href={connectionsHref} className="underline underline-offset-2">
- Connections
- </Link>
- .
- </p>
- {anyConnected ? (
- <Button onClick={onDone} disabled={advancing} size="lg">
- {advancing && <Loader2 className="mr-1.5 size-4 animate-spin" />}
- Done adding MCPs &mdash; next step
- </Button>
- ) : (
- <Button
- onClick={onSkip}
- variant="ghost"
- disabled={advancing}
- >
- Skip for now
- </Button>
- )}
- </CardContent>
- </Card>
+ <div className="ns-foot">
+ <p className="ns-footnote">You can set up MCPs later in the app.</p>
+ {anyConnected ? (
+ <button
+ type="button"
+ onClick={onDone}
+ disabled={advancing}
+ className="ns-btn ns-btn-primary"
+ >
+ {advancing && <Loader2 className="size-4 animate-spin" />}
+ Next{" "}
+ <span aria-hidden style={{ fontWeight: 400 }}>
+ ›
+ </span>
+ </button>
+ ) : (
+ <button
+ type="button"
+ onClick={onSkip}
+ disabled={advancing}
+ className="ns-btn ns-btn-ghost"
+ >
+ Skip
+ </button>
+ )}
+ </div>
- <BrowseConnectorsDialog
- open={moreOpen}
- onOpenChange={setMoreOpen}
- // Hide the three recommended MCPs — they each have their own tile
- // above, so showing them in the More dialog would be a duplicate.
- hideKeys={RECOMMENDED_TILES.map((t) => t.mcp_key)}
- connectedKeys={[
- ...(state.googleads.connected ? ["notfair-googleads"] : []),
- ...(state.metaads.connected ? ["notfair-metaads"] : []),
- ...(state.gsc.connected ? ["notfair-googlesearchconsole"] : []),
- ]}
- />
</>
);
}
@@ -585,84 +689,100 @@ function RecommendedConnectorTile({
onConnect: () => void;
onPickAccount: () => void;
}) {
- if (state.connected) {
- return (
- <div className="flex flex-col gap-3 rounded-md border border-emerald-500/30 bg-emerald-500/5 p-4">
- <div className="flex items-start gap-2">
- <div className="size-2 mt-1.5 rounded-full bg-emerald-500" aria-hidden />
- <div className="min-w-0 flex-1">
- <p className="text-sm font-medium">{tile.display_name}</p>
- <p className="mt-0.5 text-xs text-emerald-700 dark:text-emerald-400">
- Connected
- {state.account_selected ? " · account selected" : null}
- </p>
- </div>
- </div>
- {state.account_selected ? null : (
- <Button
- type="button"
- size="sm"
- variant="outline"
- onClick={onPickAccount}
- disabled={disabled}
- className="self-start"
- >
- {tile.account_action_label}
- </Button>
- )}
- </div>
- );
- }
return (
- <button
- type="button"
- onClick={onConnect}
- disabled={busy || disabled}
- className="flex flex-col gap-2 rounded-md border border-border bg-card p-4 text-left transition-colors hover:bg-muted/40 disabled:cursor-not-allowed disabled:opacity-60"
- >
- <div className="flex items-center justify-between gap-2">
- <p className="text-sm font-medium">{tile.display_name}</p>
- {busy ? (
- <Loader2 className="size-3.5 animate-spin text-muted-foreground" />
- ) : (
- <Plug className="size-3.5 text-muted-foreground" />
- )}
- </div>
- <p className="text-xs text-muted-foreground line-clamp-2">
- {tile.description}
- </p>
- </button>
+ <li>
+ <button
+ type="button"
+ onClick={state.connected ? undefined : onConnect}
+ disabled={busy || disabled}
+ aria-label={`${tile.mcp_display_name} — required for ${tile.agent_badge}`}
+ className={`ns-tile w-full ${state.connected ? "is-connected" : ""}`}
+ // When already connected, the row itself is non-actionable; the
+ // sub-action below handles "pick account" and the row would
+ // navigate nowhere otherwise. Keep it as a button so semantic
+ // tests (`getByRole('button', { name: /Google Ads/ })`) still
+ // resolve it, but don't trigger OAuth on click.
+ style={state.connected ? { cursor: "default" } : undefined}
+ >
+ <McpIcon resourceUrl={tile.resource_url} alt={tile.mcp_display_name} size="lg" />
+ <span className="ns-tile-body">
+ <span className="ns-tile-name-row">
+ <span className="ns-tile-name">{tile.mcp_display_name}</span>
+ <span className="ns-tile-badge">
+ Required for {tile.agent_badge}
+ </span>
+ </span>
+ <span className="ns-tile-desc block">{tile.description}</span>
+ {state.connected && !state.account_selected && (
+ <button
+ type="button"
+ onClick={(e) => {
+ e.stopPropagation();
+ onPickAccount();
+ }}
+ disabled={disabled}
+ className="ns-subaction"
+ >
+ {tile.account_action_label}
+ </button>
+ )}
+ </span>
+ <span className="ns-tile-status">
+ {busy ? (
+ <Loader2 className="size-4 animate-spin" aria-hidden />
+ ) : state.connected ? (
+ <span className="ns-status-connected">Connected</span>
+ ) : (
+ // Visual pill — the surrounding row IS the actual click target,
+ // so this is intentionally a span (not nested <button>) to keep
+ // HTML valid. The pill is the affordance saying "click this row
+ // to connect this MCP."
+ <span className="ns-btn ns-btn-primary ns-btn-sm">
+ Connect{" "}
+ <span className="arrow" aria-hidden style={{ fontWeight: 400 }}>
+ ›
+ </span>
+ </span>
+ )}
+ </span>
+ </button>
+ </li>
);
}
-function MoreConnectorsTile({
- extraConnectedCount,
- onOpen,
+function ExtraConnectorTile({
+ extra,
}: {
- extraConnectedCount: number;
- onOpen: () => void;
+ extra: {
+ key: string;
+ display_name: string;
+ description?: string;
+ resource_url: string;
+ };
}) {
return (
- <button
- type="button"
- onClick={onOpen}
- className="flex flex-col gap-2 rounded-md border border-dashed border-border bg-card p-4 text-left transition-colors hover:bg-muted/40"
- >
- <div className="flex items-center justify-between gap-2">
- <p className="text-sm font-medium">More tools</p>
- {extraConnectedCount > 0 ? (
- <span className="font-mono text-[10px] uppercase tracking-[0.14em] text-emerald-700 dark:text-emerald-400">
- {extraConnectedCount} connected
- </span>
- ) : null}
+ <li>
+ <div
+ className="ns-tile is-connected"
+ style={{ cursor: "default", width: "100%" }}
+ aria-label={extra.display_name}
+ >
+ <McpIcon resourceUrl={extra.resource_url} alt={extra.display_name} size="lg" />
+ <span className="ns-tile-body">
+ <span className="ns-tile-name block">{extra.display_name}</span>
+ {extra.description && (
+ <span className="ns-tile-desc block">{extra.description}</span>
+ )}
+ </span>
+ <span className="ns-tile-status">
+ <span className="ns-status-connected">Connected</span>
+ </span>
</div>
- <p className="text-xs text-muted-foreground line-clamp-2">
- Stripe, Supabase, PostHog, and any custom MCP you want to wire up.
- </p>
- </button>
+ </li>
);
}
+
// ── Step 2.5: Setup (post-skip-or-connect provisioning watcher) ────
type ProgressStep = {
@@ -743,12 +863,10 @@ function SetupStep({ slug }: { slug: string }) {
return (
<>
- <header className="space-y-2">
- <h1 className="text-3xl font-semibold tracking-tight text-foreground">
- Setting up your agents.
- </h1>
- <p className="text-sm text-muted-foreground">
- One moment — provisioning your team in OpenClaw.
+ <header>
+ <h1 className="ns-hero-title">Setting up your agents.</h1>
+ <p className="ns-hero-sub">
+ One moment &mdash; bringing your team online.
</p>
</header>
@@ -1402,15 +1520,13 @@ function AccountPickerScaffold({
function MissingSlug() {
return (
- <Card>
- <CardContent className="space-y-3 pt-6 pb-6">
- <p className="text-sm text-muted-foreground">
- This step needs a workspace. Start from the beginning.
- </p>
- <Button asChild>
- <Link href="/onboarding">Start over</Link>
- </Button>
- </CardContent>
- </Card>
+ <div className="mt-10 space-y-4">
+ <p className="text-[15px] text-muted-foreground">
+ This step needs a workspace. Start from the beginning.
+ </p>
+ <Link href="/onboarding" className="ns-btn ns-btn-primary">
+ Start over
+ </Link>
+ </div>
);
}
diff --git a/notfair-cmo/src/server/agent-templates.test.ts b/notfair-cmo/src/server/agent-templates.test.ts
index 674144c2..5a626953 100644
--- a/notfair-cmo/src/server/agent-templates.test.ts
+++ b/notfair-cmo/src/server/agent-templates.test.ts
@@ -10,9 +10,9 @@ import {
} from "./agent-templates";
describe("AgentTemplate catalog", () => {
- it("ships exactly five templates: cmo + 3 recommended specialists + seo", () => {
+ it("ships four templates: cmo + google_ads + meta_ads + seo (which owns GSC)", () => {
const keys = TEMPLATES.map((t) => t.key).sort();
- expect(keys).toEqual(["cmo", "google_ads", "gsc", "meta_ads", "seo"]);
+ expect(keys).toEqual(["cmo", "google_ads", "meta_ads", "seo"]);
});
it("only CMO is included in the default onboarding bundle", () => {
@@ -22,14 +22,14 @@ describe("AgentTemplate catalog", () => {
);
});
- it("the three specialists declare their required MCP catalog key", () => {
+ it("the three specialists declare their required MCP catalog key — SEO owns GSC", () => {
expect(templateForKey("google_ads")?.requires_mcp_key).toBe(
"notfair-googleads",
);
expect(templateForKey("meta_ads")?.requires_mcp_key).toBe(
"notfair-metaads",
);
- expect(templateForKey("gsc")?.requires_mcp_key).toBe(
+ expect(templateForKey("seo")?.requires_mcp_key).toBe(
"notfair-googlesearchconsole",
);
});
@@ -38,25 +38,25 @@ describe("AgentTemplate catalog", () => {
expect(templateForKey("cmo")?.requires_mcp_key).toBeUndefined();
});
- it("SPECIALIST_TEMPLATE_BY_MCP_KEY inverts requires_mcp_key for connect-time provisioning", () => {
+ it("SPECIALIST_TEMPLATE_BY_MCP_KEY inverts requires_mcp_key — GSC maps to seo", () => {
expect(SPECIALIST_TEMPLATE_BY_MCP_KEY["notfair-googleads"]).toBe(
"google_ads",
);
expect(SPECIALIST_TEMPLATE_BY_MCP_KEY["notfair-metaads"]).toBe("meta_ads");
expect(SPECIALIST_TEMPLATE_BY_MCP_KEY["notfair-googlesearchconsole"]).toBe(
- "gsc",
+ "seo",
);
expect(SPECIALIST_TEMPLATE_BY_MCP_KEY["stripe"]).toBeUndefined();
});
- it("templateForUrlSlug resolves the hyphenated URL form (gsc has no underscore so it round-trips trivially)", () => {
+ it("templateForUrlSlug resolves the hyphenated URL form", () => {
expect(templateForUrlSlug("google-ads")?.key).toBe("google_ads");
expect(templateForUrlSlug("meta-ads")?.key).toBe("meta_ads");
- expect(templateForUrlSlug("gsc")?.key).toBe("gsc");
+ expect(templateForUrlSlug("seo")?.key).toBe("seo");
});
it("agentUrlSlug produces stable slugs for the new templates", () => {
expect(agentUrlSlug("meta_ads", "Mia")).toBe("meta-ads-mia");
- expect(agentUrlSlug("gsc", "Sasha")).toBe("gsc-sasha");
+ expect(agentUrlSlug("seo", "Sam")).toBe("seo-sam");
});
});
diff --git a/notfair-cmo/src/server/agent-templates.ts b/notfair-cmo/src/server/agent-templates.ts
index 0aa51ae9..44186db5 100644
--- a/notfair-cmo/src/server/agent-templates.ts
+++ b/notfair-cmo/src/server/agent-templates.ts
@@ -99,7 +99,7 @@ Style:
starting the next.`;
export type AgentTemplate = {
- key: "cmo" | "google_ads" | "meta_ads" | "gsc" | "seo";
+ key: "cmo" | "google_ads" | "meta_ads" | "seo";
/**
* Label for the ROLE this template represents (e.g. "CMO", "Google
* Ads"). Used in the sidebar role pill + anywhere the UI says
@@ -145,9 +145,11 @@ export type AgentTemplateKey = AgentTemplate["key"];
* source of truth for "which agents does a freshly-created project get?".
*
* Only CMO ships by default now. The three specialists (Google Ads,
- * Meta Ads, Google Search Console) are gated on the user connecting the
- * matching MCP — the connect step in onboarding triggers provisioning
- * via provisionSpecialistForMcp as each token lands.
+ * Meta Ads, SEO) are gated on the user connecting the matching MCP —
+ * the connect step in onboarding triggers provisioning via
+ * provisionSpecialistForMcp as each token lands. Google Search Console
+ * isn't its own specialist — connecting GSC provisions the SEO agent,
+ * which uses GSC alongside on-page / technical SEO work.
*/
export const DEFAULT_ONBOARDING_TEMPLATE_KEYS: AgentTemplateKey[] = ["cmo"];
@@ -156,11 +158,15 @@ export const DEFAULT_ONBOARDING_TEMPLATE_KEYS: AgentTemplateKey[] = ["cmo"];
* onboarding connect step gates provisioning on. Inverse lookup
* (MCP key → template key) used by provisionSpecialistForMcp when an
* OAuth callback lands and we need to decide which specialist to mint.
+ *
+ * Notice GSC maps to `seo` — there's no dedicated GSC agent. The SEO
+ * specialist owns search-console work as part of its broader remit
+ * (technical SEO, content, ranking analysis).
*/
export const SPECIALIST_TEMPLATE_BY_MCP_KEY: Record<string, AgentTemplateKey> = {
"notfair-googleads": "google_ads",
"notfair-metaads": "meta_ads",
- "notfair-googlesearchconsole": "gsc",
+ "notfair-googlesearchconsole": "seo",
};
export function templateForKey(key: string): AgentTemplate | undefined {
@@ -270,74 +276,59 @@ for files in your workspace, and the orchestration MCP for coordination.`,
requires_mcp_key: "notfair-metaads",
},
{
- key: "gsc",
- display_name: "Google Search Console",
- default_name: "Sasha",
- description: "Organic search performance — queries, pages, impressions, clicks, indexing.",
+ key: "seo",
+ display_name: "SEO",
+ default_name: "Sam",
+ description:
+ "Organic search — Search Console performance, technical SEO, content recommendations.",
capabilities: [
- "Pull search performance (queries, pages, devices, countries)",
- "Surface query/page movers week-over-week",
+ "Pull Search Console performance (queries, pages, devices, countries)",
+ "Surface query and page movers week-over-week",
"Identify pages losing impressions or rankings",
"Diagnose indexing issues + coverage gaps",
- "Schedule recurring ranking/click summaries",
+ "Audit on-page + technical SEO",
+ "Propose content ideas based on keyword movers",
+ "Schedule recurring ranking / click summaries",
"Uses notfair-googlesearchconsole MCP when property connected",
],
model: "openai-codex/gpt-5.5",
- system_prompt: `You are a Google Search Console specialist agent on the notfair-cmo platform.
+ system_prompt: `You are the SEO specialist agent on the notfair-cmo platform.
${SPECIALIST_ROLE}
## Your domain tools
-When the notfair-googlesearchconsole MCP is connected to this project,
-use its tools to pull organic search performance (impressions, clicks,
-position) sliced by query, page, country, and device. The selected GSC
-property (e.g. \`sc-domain:example.com\` or \`https://example.com/\`)
-is persisted on the project — every call you make should target that
+Your primary data source is the **notfair-googlesearchconsole** MCP
+(connected during onboarding). The selected GSC property
+(e.g. \`sc-domain:example.com\` or \`https://example.com/\`) is
+persisted on the project; every call you make should target that
property unless the brief explicitly asks for another.
+Use the MCP to pull organic search performance (impressions, clicks,
+average position) sliced by query, page, country, device, or date.
+Combine that with on-page audits, technical SEO checks, schema
+recommendations, and internal-link analysis when the brief asks for
+broader SEO work.
+
Domain conventions you should respect:
- Always quote impressions, clicks, CTR, and average position when
- reporting findings. The user trusts numbers more than adjectives.
+ reporting Search Console findings. The user trusts numbers more than
+ adjectives.
- Default to the last 28 days for performance reads unless the brief
- asks for a different window. That window aligns with Search Console's
- native default.
-- Movers analysis matters more than absolutes here — surface queries +
- pages that moved week-over-week (impressions or position), not the
- static top-10 lists the user has already seen.
+ asks otherwise. That window aligns with Search Console's native
+ default and survives one-off Sunday spikes.
+- Lead with **movers**, not absolutes — surface queries and pages that
+ moved week-over-week (impressions or position) rather than the static
+ top-10 lists the user has already seen.
+- Pages losing impressions + dropping in position are the high-signal
+ finding; pages with high impressions but low CTR are the high-leverage
+ one. Frame recommendations around which is which.
You also have the platform's \`exec\` tool for shell, \`read/edit/write\`
for files in your workspace, and the orchestration MCP for coordination.`,
default_onboarding: false,
requires_mcp_key: "notfair-googlesearchconsole",
},
- {
- key: "seo",
- display_name: "SEO",
- default_name: "Sam",
- description: "SEO audits, content recommendations, ranking + click tracking, technical SEO.",
- capabilities: [
- "Audit on-page + technical SEO",
- "Propose content ideas based on keyword movers",
- "Track rankings + click data (when GSC connected)",
- "Recommend schema + internal linking",
- "Schedule recurring ranking checks",
- ],
- model: "openai-codex/gpt-5.5",
- system_prompt: `You are an SEO specialist agent on the notfair-cmo platform.
-
-${SPECIALIST_ROLE}
-
-## Your domain tools
-
-You handle on-page + technical SEO, content recommendations, ranking
-checks, schema markup, and internal linking. When Google Search Console
-is connected, use it for ranking + click data.
-
-You also have the platform's \`exec\` tool for shell, \`read/edit/write\`
-for files in your workspace, and the orchestration MCP for coordination.`,
- default_onboarding: false,
- },
];
/**
diff --git a/notfair-cmo/src/server/onboarding/accounts.test.ts b/notfair-cmo/src/server/onboarding/accounts.test.ts
index d62ddbf2..b620556a 100644
--- a/notfair-cmo/src/server/onboarding/accounts.test.ts
+++ b/notfair-cmo/src/server/onboarding/accounts.test.ts
@@ -397,6 +397,26 @@ describe("listGscProperties", () => {
});
});
+ it("parses the bare-array shape the actual notfair MCP returns", async () => {
+ mcpRpcMock.mockResolvedValueOnce(
+ toolCallResult([
+ { siteUrl: "sc-domain:notfair.co", permissionLevel: "siteFullUser" },
+ { siteUrl: "https://example.com/", permissionLevel: "siteOwner" },
+ ]),
+ );
+ const r = await listGscProperties("acme");
+ expect(r.ok).toBe(true);
+ if (r.ok) {
+ expect(r.properties.map((p) => p.id)).toEqual([
+ "sc-domain:notfair.co",
+ "https://example.com/",
+ ]);
+ expect(r.properties[0]!.name).toBe("notfair.co");
+ expect(r.properties[1]!.name).toBe("example.com");
+ expect(r.properties[0]!.permission).toBe("siteFullUser");
+ }
+ });
+
it("parses the Search Console `siteEntry` shape", async () => {
mcpRpcMock.mockResolvedValueOnce(
toolCallResult({
diff --git a/notfair-cmo/src/server/onboarding/accounts.ts b/notfair-cmo/src/server/onboarding/accounts.ts
index da595d04..53fc4d45 100644
--- a/notfair-cmo/src/server/onboarding/accounts.ts
+++ b/notfair-cmo/src/server/onboarding/accounts.ts
@@ -542,15 +542,14 @@ export async function setOnboardingMetaAdsAccountAction(
// surface them as "properties" in the UI to match what users see in
// Search Console.
//
-// **Tool name is a best-guess.** The notfair-googlesearchconsole MCP
-// is freshly added; we expect a tool called `listSites` (mirroring the
-// Search Console API method). If the real tool name is different
-// (e.g. `listProperties`, `listConnectedSites`), change the constant
-// below — the failure mode is a clean RPC "method not found" error
-// surfaced through the existing rpcErrorMessage formatter.
+// The notfair-googlesearchconsole MCP exposes a `listProperties` tool
+// (verified against the live server) which returns a bare JSON array
+// of `{ siteUrl, permissionLevel }`. We also accept the spec-shaped
+// `{ siteEntry: [...] }` wrap and a defensive `{ sites: [...] }` so a
+// future server-side change doesn't break the picker.
const GSC_MCP_KEY = "notfair-googlesearchconsole";
-const GSC_LIST_TOOL = "listSites";
+const GSC_LIST_TOOL = "listProperties";
export type GscProperty = {
/** Site URL exactly as Search Console uses it. */
@@ -599,15 +598,19 @@ export async function listGscProperties(
return { ok: true, ...parsed };
}
-type GscPropertiesPayload = {
- // Search Console REST returns `siteEntry: [{ siteUrl, permissionLevel }]`.
- // The MCP may pass that through unchanged, or normalize to a flatter
- // shape. Accept both, plus a defensive `sites` array.
- siteEntry?: Array<{ siteUrl?: unknown; permissionLevel?: unknown }>;
- sites?: Array<{ id?: unknown; name?: unknown; siteUrl?: unknown }>;
- defaultPropertyId?: unknown;
+type GscSiteRow = {
+ siteUrl?: unknown;
+ permissionLevel?: unknown;
+ id?: unknown;
+ name?: unknown;
};
+type GscPropertiesPayload =
+ // The actual notfair-googlesearchconsole MCP returns a bare array.
+ | GscSiteRow[]
+ // Spec shape per the Search Console REST API.
+ | { siteEntry?: GscSiteRow[]; sites?: GscSiteRow[]; defaultPropertyId?: unknown };
+
function parseGscPropertiesPayload(
result: ListAccountsToolResult,
): { properties: GscProperty[]; default_property_id: string | null } | null {
@@ -621,30 +624,35 @@ function parseGscPropertiesPayload(
} catch {
return null;
}
- const properties: GscProperty[] = [];
- if (Array.isArray(body.siteEntry)) {
- for (const s of body.siteEntry) {
- const id = String(s?.siteUrl ?? "").trim();
- if (!id) continue;
- properties.push({
- id,
- name: prettyGscName(id),
- permission:
- typeof s?.permissionLevel === "string" ? s.permissionLevel : undefined,
- });
- }
- } else if (Array.isArray(body.sites)) {
- for (const s of body.sites) {
- const id = String(s?.id ?? s?.siteUrl ?? "").trim();
- if (!id) continue;
- const name = String(s?.name ?? "").trim() || prettyGscName(id);
- properties.push({ id, name });
- }
- } else {
+
+ // Normalize all three accepted shapes down to a single row list.
+ const rows: GscSiteRow[] = Array.isArray(body)
+ ? body
+ : Array.isArray(body?.siteEntry)
+ ? body.siteEntry
+ : Array.isArray(body?.sites)
+ ? body.sites
+ : [];
+ if (rows.length === 0 && !Array.isArray(body)) {
+ // Object with neither `siteEntry` nor `sites` — genuinely unexpected.
return null;
}
+
+ const properties: GscProperty[] = [];
+ for (const s of rows) {
+ if (!s || typeof s !== "object") continue;
+ const id = String(s.siteUrl ?? s.id ?? "").trim();
+ if (!id) continue;
+ const customName = typeof s.name === "string" ? s.name.trim() : "";
+ properties.push({
+ id,
+ name: customName || prettyGscName(id),
+ permission:
+ typeof s.permissionLevel === "string" ? s.permissionLevel : undefined,
+ });
+ }
const default_property_id =
- typeof body.defaultPropertyId === "string"
+ !Array.isArray(body) && typeof body.defaultPropertyId === "string"
? body.defaultPropertyId
: null;
return { properties, default_property_id };
@@ -718,13 +726,33 @@ export type ConnectedMcpState = {
account_selected: boolean;
};
+export type ConnectedExtraMcp = {
+ /** Catalog key (`stripe`, `supabase`, …) — what's stored on mcp_tokens. */
+ key: string;
+ /** Display label resolved from the catalog (`Stripe`, `Supabase`, …). */
+ display_name: string;
+ /** Short marketing line from the catalog. Optional. */
+ description?: string;
+ /** Resource URL — feeds the <McpIcon> favicon lookup so each extra row
+ * shows its brand mark the same way the Connections page does. */
+ resource_url: string;
+};
+
export type ConnectStepState = {
googleads: ConnectedMcpState;
metaads: ConnectedMcpState;
gsc: ConnectedMcpState;
/**
- * Count of connected MCPs that aren't in the recommended trio
- * (Stripe, Supabase, PostHog, …, plus any user-pasted custom servers).
+ * MCPs the user has connected via the "More tools" overflow dialog —
+ * anything outside the recommended trio (Stripe, Supabase, PostHog,
+ * plus any user-pasted custom servers). Rendered as additional rows in
+ * the connect-step list below the recommended tiles.
+ */
+ extras: ConnectedExtraMcp[];
+ /**
+ * Cached length of `extras`. Kept on the surface so existing test
+ * fixtures and any caller that only needs a badge count don't have
+ * to compute it themselves.
*/
extra_connected_count: number;
/**
@@ -749,6 +777,7 @@ export async function getConnectStepStateAction(
const { findMcpToken, listProjectMcpTokens } = await import(
"@/server/mcp/tokens"
);
+ const { getMcpCatalog } = await import("@/server/mcp-catalog");
const RECOMMENDED_KEYS = new Set([
"notfair-googleads",
@@ -756,9 +785,25 @@ export async function getConnectStepStateAction(
"notfair-googlesearchconsole",
]);
const allTokens = listProjectMcpTokens(project_slug);
- const extra_connected_count = allTokens.filter(
- (t) => !RECOMMENDED_KEYS.has(t.server_name),
- ).length;
+ const catalog = getMcpCatalog(project_slug);
+
+ // Build the extras list: for every connected non-recommended token,
+ // look up its display name + description in the catalog so the connect
+ // step can render real rows ("Stripe — Payments, …") instead of a bare
+ // catalog-key. Tokens whose catalog entry was removed (rare — manual
+ // db edit, or a preset we silently dropped) are skipped silently.
+ const extras: ConnectedExtraMcp[] = [];
+ for (const t of allTokens) {
+ if (RECOMMENDED_KEYS.has(t.server_name)) continue;
+ const entry = catalog.find((c) => c.key === t.server_name);
+ if (!entry) continue;
+ extras.push({
+ key: t.server_name,
+ display_name: entry.display_name,
+ description: entry.description,
+ resource_url: entry.resource_url,
+ });
+ }
return {
ok: true,
@@ -775,7 +820,8 @@ export async function getConnectStepStateAction(
connected: !!findMcpToken(project_slug, "notfair-googlesearchconsole"),
account_selected: !!project.gsc_property_id,
},
- extra_connected_count,
+ extras,
+ extra_connected_count: extras.length,
website_url: project.website_url,
},
};