Open-source SEO, GEO, and marketing skills for AI agents.
feat(notfair-cmo): plain-language onboarding tiles, GA under More tools
Yuting Zhongb8460f311700
diff --git a/notfair-cmo/src/components/onboarding-flow.test.tsx b/notfair-cmo/src/components/onboarding-flow.test.tsxindex 0440081e..d32e16d3 100644--- a/notfair-cmo/src/components/onboarding-flow.test.tsx+++ b/notfair-cmo/src/components/onboarding-flow.test.tsx@@ -129,7 +129,6 @@ beforeEach(() => {googleads: { connected: false, account_selected: false },metaads: { connected: false, account_selected: false },gsc: { connected: false, account_selected: false },- googleanalytics: { connected: false, account_selected: false },xads: { connected: false, account_selected: false },extras: [],extra_connected_count: 0,@@ -233,7 +232,7 @@ describe("OnboardingFlow — MissingSlug", () => {});describe("OnboardingFlow — ConnectStep", () => {- it("renders the five recommended-MCP tiles + Skip when nothing is connected", async () => {+ it("renders the four recommended-MCP tiles + Skip when nothing is connected", async () => {setStep("connect", "acme");render(<OnboardingFlow />);expect(@@ -249,15 +248,13 @@ describe("OnboardingFlow — ConnectStep", () => {screen.getByRole("button", { name: /Google Search Console/i }),).toBeInTheDocument();expect(- screen.getByRole("button", { name: /^Google Analytics/i }),+ screen.getByRole("button", { name: /^X Ads/i }),).toBeInTheDocument();- // X Ads provisions a specialist like the trio — its tile must carry- // the agent badge in the accessible name.+ // Google Analytics powers no specialist — it lives under "More+ // tools" now, not as a first-class tile.expect(- screen.getByRole("button", {- name: /^X Ads MCP — required for X Ads agent/i,- }),- ).toBeInTheDocument();+ screen.queryByRole("button", { name: /^Google Analytics/i }),+ ).not.toBeInTheDocument();expect(screen.getByRole("button", { name: /More tools/i }),).toBeInTheDocument();@@ -266,7 +263,7 @@ describe("OnboardingFlow — ConnectStep", () => {).toBeInTheDocument();});- it("starts OAuth for a no-picker MCP (Google Analytics) with a connect-step return_to", async () => {+ it("starts OAuth for a no-picker MCP (X Ads) with a connect-step return_to", async () => {const loc = setLocationHref();startMcpConnect.mockResolvedValue({ok: true,@@ -275,11 +272,11 @@ describe("OnboardingFlow — ConnectStep", () => {setStep("connect", "acme");render(<OnboardingFlow />);fireEvent.click(- await screen.findByRole("button", { name: /^Google Analytics/i }),+ await screen.findByRole("button", { name: /^X Ads/i }),);await waitFor(() =>expect(startMcpConnect).toHaveBeenCalledWith({- mcp_key: "notfair-googleanalytics",+ mcp_key: "notfair-xads",return_to: "/onboarding?step=connect&slug=acme",}),);@@ -344,8 +341,7 @@ describe("OnboardingFlow — ConnectStep", () => {googleads: { connected: true, account_selected: true },metaads: { connected: false, account_selected: false },gsc: { connected: false, account_selected: false },- googleanalytics: { connected: false, account_selected: false },- xads: { connected: false, account_selected: false },+ xads: { connected: false, account_selected: false },extras: [],extra_connected_count: 0,website_url: null,@@ -371,8 +367,7 @@ describe("OnboardingFlow — ConnectStep", () => {googleads: { connected: false, account_selected: false },metaads: { connected: false, account_selected: false },gsc: { connected: false, account_selected: false },- googleanalytics: { connected: false, account_selected: false },- xads: { connected: false, account_selected: false },+ xads: { connected: false, account_selected: false },extras: [{key: "stripe",@@ -409,8 +404,7 @@ describe("OnboardingFlow — ConnectStep", () => {googleads: { connected: true, account_selected: false },metaads: { connected: false, account_selected: false },gsc: { connected: false, account_selected: false },- googleanalytics: { connected: false, account_selected: false },- xads: { connected: false, account_selected: false },+ xads: { 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.tsxindex e8fe6d51..5d65ab78 100644--- a/notfair-cmo/src/components/onboarding-flow.tsx+++ b/notfair-cmo/src/components/onboarding-flow.tsx@@ -390,8 +390,8 @@ function HarnessPicker({ disabled }: { disabled: boolean }) {* Spec for one of the recommended-MCP tiles in the connect step. The core* MCPs (Google Ads, Meta Ads, Google Search Console, X Ads) each get their* own first-class tile because connecting them triggers the provisioning of- * a matching specialist agent; Google Analytics gets a tile too but- * provisions no specialist (its data flows to the CMO + existing agents).+ * a matching specialist agent. MCPs that power no specialist (Google+ * Analytics) live in the "More tools" browse dialog instead.*/type RecommendedTile = {mcp_key: string;@@ -399,14 +399,9 @@ type RecommendedTile = {* 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.- * Absent for MCPs that don't provision a specialist. */- 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. */+ /** What the user gets — phrased as "Gives the <X> agent the ability+ * to …" so the MCP↔agent dependency reads in plain language instead+ * of a badge. */description: string;/** Resource URL the OAuth flow targets — also feeds <McpIcon>'s icon* lookup so each tile shows the brand mark the connections page uses. */@@ -423,9 +418,8 @@ const RECOMMENDED_TILES: RecommendedTile[] = [{mcp_key: "notfair-googleads",mcp_display_name: "Google Ads MCP",- agent_badge: "Google Ads agent",description:- "Audits campaigns, finds wasted spend, proposes bid changes.",+ "Gives the Google Ads agent the ability to audit campaigns, find wasted spend, and propose bid changes.",resource_url: "https://notfair.co/api/mcp/google_ads",account_step: "account",account_action_label: "Select Google Ads account",@@ -433,9 +427,8 @@ const RECOMMENDED_TILES: RecommendedTile[] = [{mcp_key: "notfair-metaads",mcp_display_name: "Meta Ads MCP",- agent_badge: "Meta Ads agent",description:- "Audits ad sets, diagnoses creative fatigue, surfaces ROAS winners.",+ "Gives the Meta Ads agent the ability to audit ad sets, diagnose creative fatigue, and surface ROAS winners.",resource_url: "https://notfair.co/api/mcp/meta_ads",account_step: "meta-account",account_action_label: "Select Meta ad account",@@ -445,26 +438,19 @@ const RECOMMENDED_TILES: RecommendedTile[] = [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.",+ "Gives the SEO agent the ability to pull organic performance, surface query and page movers, and diagnose indexing.",resource_url: "https://notfair.co/api/mcp/google_search_console",account_step: "gsc-property",account_action_label: "Select GSC property",},- {- mcp_key: "notfair-googleanalytics",- mcp_display_name: "Google Analytics MCP",- description:- "Analyzes GA4 traffic, channels, and conversions; explains what moved and why.",- resource_url: "https://notfair.co/api/mcp/google_analytics",- },+ // Google Analytics deliberately lives under "More tools" — it powers+ // no specialist agent, so it doesn't earn a first-class tile here.{mcp_key: "notfair-xads",mcp_display_name: "X Ads MCP",- agent_badge: "X Ads agent",description:- "Audits X (Twitter) campaigns and line items, tracks spend and engagement.",+ "Gives the X Ads agent the ability to audit campaigns and line items, and track spend and engagement.",resource_url: "https://notfair.co/api/mcp/x_ads",},];@@ -578,14 +564,12 @@ function ConnectStep({ slug }: { slug: string }) {"notfair-googleads": state.googleads,"notfair-metaads": state.metaads,"notfair-googlesearchconsole": state.gsc,- "notfair-googleanalytics": state.googleanalytics,"notfair-xads": state.xads,} as const;const anyConnected =state.googleads.connected ||state.metaads.connected ||state.gsc.connected ||- state.googleanalytics.connected ||state.xads.connected ||state.extra_connected_count > 0;@@ -635,10 +619,9 @@ function ConnectStep({ slug }: { slug: string }) {...(state.googleads.connected ? ["notfair-googleads"] : []),...(state.metaads.connected ? ["notfair-metaads"] : []),...(state.gsc.connected ? ["notfair-googlesearchconsole"] : []),- ...(state.googleanalytics.connected- ? ["notfair-googleanalytics"]- : []),...(state.xads.connected ? ["notfair-xads"] : []),+ // Google Analytics + Stripe/Supabase/etc. arrive here — a+ // connected GA is an extras row, which also hides it in Browse....state.extras.map((e) => e.key),]}trigger={@@ -655,7 +638,8 @@ function ConnectStep({ slug }: { slug: string }) {<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.+ Browse Google Analytics, Stripe, Supabase, PostHog, or+ paste a custom MCP URL.</span></span><span className="ns-tile-status">@@ -725,11 +709,7 @@ function RecommendedConnectorTile({type="button"onClick={state.connected ? undefined : onConnect}disabled={busy || disabled}- aria-label={- tile.agent_badge- ? `${tile.mcp_display_name} — required for ${tile.agent_badge}`- : tile.mcp_display_name- }+ aria-label={tile.mcp_display_name}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@@ -742,11 +722,6 @@ function RecommendedConnectorTile({<span className="ns-tile-body"><span className="ns-tile-name-row"><span className="ns-tile-name">{tile.mcp_display_name}</span>- {tile.agent_badge && (- <span className="ns-tile-badge">- Required for {tile.agent_badge}- </span>- )}</span><span className="ns-tile-desc block">{tile.description}</span>{tile.account_step && state.connected && !state.account_selected && (diff --git a/notfair-cmo/src/server/onboarding/accounts.ts b/notfair-cmo/src/server/onboarding/accounts.tsindex ae78d40e..b335d9fd 100644--- a/notfair-cmo/src/server/onboarding/accounts.ts+++ b/notfair-cmo/src/server/onboarding/accounts.ts@@ -706,8 +706,10 @@ export async function setOnboardingGscPropertyAction(// ── Onboarding connect-step state ──────────────────────────────────//// The multi-MCP onboarding step renders one tile per recommended MCP-// (Google Ads, Meta Ads, GSC, Google Analytics, X Ads) plus a "More"-// tile. Each tile needs:+// (Google Ads, Meta Ads, GSC, X Ads — the ones that power a specialist+// agent) plus a "More" tile. Google Analytics lives under "More": it+// provisions no specialist, so a connected GA surfaces as an extras+// row instead of a first-class tile. Each tile needs://// - is the MCP connected? (token row exists)// - is an account/property selected on the project row?@@ -744,11 +746,10 @@ export type ConnectStepState = {metaads: ConnectedMcpState;gsc: ConnectedMcpState;/**- * Google Analytics + X Ads have first-class connect tiles like the trio- * above, but no account/property picker sub-flow — `account_selected`- * simply mirrors `connected` so the tile shape stays uniform.+ * X Ads has a first-class connect tile like the trio above, but no+ * account/property picker sub-flow — `account_selected` simply+ * mirrors `connected` so the tile shape stays uniform.*/- googleanalytics: ConnectedMcpState;xads: ConnectedMcpState;/*** MCPs the user has connected via the "More tools" overflow dialog —@@ -791,7 +792,6 @@ export async function getConnectStepStateAction("notfair-googleads","notfair-metaads","notfair-googlesearchconsole",- "notfair-googleanalytics","notfair-xads",]);const allTokens = listProjectMcpTokens(project_slug);@@ -830,10 +830,6 @@ export async function getConnectStepStateAction(connected: !!findMcpToken(project_slug, "notfair-googlesearchconsole"),account_selected: !!project.gsc_property_id,},- googleanalytics: (() => {- const connected = !!findMcpToken(project_slug, "notfair-googleanalytics");- return { connected, account_selected: connected };- })(),xads: (() => {const connected = !!findMcpToken(project_slug, "notfair-xads");return { connected, account_selected: connected };diff --git a/notfair-cmo/src/server/trusted-connectors.ts b/notfair-cmo/src/server/trusted-connectors.tsindex 94fead8c..922b7d72 100644--- a/notfair-cmo/src/server/trusted-connectors.ts+++ b/notfair-cmo/src/server/trusted-connectors.ts@@ -53,6 +53,12 @@ export const TRUSTED_CONNECTORS: TrustedConnector[] = [description: "Organic search performance, queries, pages, indexing.",resource_url: "https://notfair.co/api/mcp/google_search_console",},+ {+ id: "notfair-googleanalytics",+ display_name: "NotFair Google Analytics",+ description: "GA4 traffic, channels, conversions, audiences.",+ resource_url: "https://notfair.co/api/mcp/google_analytics",+ },{id: "stripe",display_name: "Stripe",