Skip to content

Open source alternative to Semrush and Ahrefs

Add ChatGPT and Claude install buttons to the dashboard (#1012)

Carter Smith2db811498730
diff --git a/src/client/features/ai-mcp/AgentSetup.tsx b/src/client/features/ai-mcp/AgentSetup.tsx
index cc2331ec..d3fd7fbe 100644
--- a/src/client/features/ai-mcp/AgentSetup.tsx
+++ b/src/client/features/ai-mcp/AgentSetup.tsx
@@ -2,7 +2,7 @@ import { useEffect, useEffectEvent, useState } from "react";
import { useQuery } from "@tanstack/react-query";
import { ArrowRight, Check } from "lucide-react";
import { AgentList } from "./AgentList";
-import { ClaudeIcon, OpenAIIcon } from "./AgentIcons";
+import { ONE_CLICK_INSTALLS } from "./agentInstalls";
import { AgentSetupPanel, AGENT_SETUP_DESCRIPTION } from "./AgentSetupPanel";
import { getAgentSetupPrompt } from "./agentSetupPrompt";
import { captureClientEvent } from "@/client/lib/posthog";
@@ -10,21 +10,6 @@ import { WizardFooter } from "@/client/features/onboarding/WizardFooter";
import { Button } from "@/client/components/ui/button";
import { getMcpAuthorizedAt } from "@/serverFunctions/onboarding";
-const ONE_CLICK_INSTALLS = [
- {
- agent: "chatgpt",
- name: "ChatGPT",
- href: "https://chatgpt.com/plugins/plugin_asdk_app_6abddd2c7e4c819191f1398c4bd8e9b3",
- Icon: OpenAIIcon,
- },
- {
- agent: "claude",
- name: "Claude",
- href: "https://claude.com/marketplace/connectors/openseo",
- Icon: ClaudeIcon,
- },
-];
-
/** Last onboarding step. Onboarding finishes when the user clicks Go to
* dashboard, or when their agent connects over MCP (the server marks it). */
export function AgentSetup({
diff --git a/src/client/features/ai-mcp/agentInstalls.ts b/src/client/features/ai-mcp/agentInstalls.ts
new file mode 100644
index 00000000..5aa849d7
--- /dev/null
+++ b/src/client/features/ai-mcp/agentInstalls.ts
@@ -0,0 +1,16 @@
+import { ClaudeIcon, OpenAIIcon } from "./AgentIcons";
+
+export const ONE_CLICK_INSTALLS = [
+ {
+ agent: "chatgpt",
+ name: "ChatGPT",
+ href: "https://chatgpt.com/plugins/plugin_asdk_app_6abddd2c7e4c819191f1398c4bd8e9b3",
+ Icon: OpenAIIcon,
+ },
+ {
+ agent: "claude",
+ name: "Claude",
+ href: "https://claude.com/marketplace/connectors/openseo",
+ Icon: ClaudeIcon,
+ },
+];
diff --git a/src/client/features/dashboard/DashboardAgentCard.tsx b/src/client/features/dashboard/DashboardAgentCard.tsx
new file mode 100644
index 00000000..dae84a3f
--- /dev/null
+++ b/src/client/features/dashboard/DashboardAgentCard.tsx
@@ -0,0 +1,85 @@
+import { useMutation, useQueryClient } from "@tanstack/react-query";
+import { X } from "lucide-react";
+import { Button } from "@/client/components/ui/button";
+import { Card } from "@/client/components/ui/card";
+import { ClaudeIcon, OpenAIIcon } from "@/client/features/ai-mcp/AgentIcons";
+import { ONE_CLICK_INSTALLS } from "@/client/features/ai-mcp/agentInstalls";
+import { captureClientEvent } from "@/client/lib/posthog";
+import { setDashboardStepDismissed } from "@/serverFunctions/dashboard";
+
+export function DashboardAgentCard({ projectId }: { projectId: string }) {
+ const queryClient = useQueryClient();
+ const dismiss = useMutation({
+ mutationFn: () =>
+ setDashboardStepDismissed({
+ data: { projectId, step: "mcp", dismissed: true },
+ }),
+ onSuccess: async () => {
+ await queryClient.invalidateQueries({
+ queryKey: ["dashboardActivation", projectId],
+ });
+ captureClientEvent("dashboard:setup_step_defer", {
+ step: "mcp",
+ dismissed: true,
+ });
+ },
+ });
+
+ return (
+ <Card
+ role="region"
+ aria-label="Use OpenSEO in your chatbot"
+ className="relative flex-row flex-wrap items-center gap-x-6 gap-y-4 p-5 pr-9 shadow-none"
+ >
+ <div className="flex min-w-0 flex-1 basis-[32rem] items-center gap-4">
+ <div className="flex shrink-0 items-center" aria-hidden>
+ <span className="flex size-10 items-center justify-center rounded-lg border border-border bg-card">
+ <OpenAIIcon className="size-5" />
+ </span>
+ <span className="-ml-2 mt-3 flex size-10 items-center justify-center rounded-lg border border-border bg-muted">
+ <ClaudeIcon className="size-5" />
+ </span>
+ </div>
+ <div className="min-w-0 space-y-1">
+ <h2 className="text-sm font-semibold">
+ Use OpenSEO in ChatGPT or Claude
+ </h2>
+ <p className="truncate text-sm text-muted-foreground">
+ Research keywords and audit your site from the chatbot you already
+ use.
+ </p>
+ </div>
+ </div>
+ <div className="flex flex-wrap items-center gap-2">
+ {ONE_CLICK_INSTALLS.map(({ agent, name, href, Icon }) => (
+ <Button
+ key={agent}
+ variant="outline"
+ className="h-9 px-3 text-xs sm:text-sm"
+ nativeButton={false}
+ render={<a href={href} target="_blank" rel="noreferrer" />}
+ onClick={() =>
+ captureClientEvent("onboarding:add_to_agent_click", {
+ agent,
+ source: "dashboard",
+ })
+ }
+ >
+ <Icon data-icon="inline-start" />
+ Add to {name}
+ </Button>
+ ))}
+ </div>
+ <Button
+ variant="ghost"
+ size="icon-xs"
+ className="absolute right-1 top-1 text-muted-foreground"
+ aria-label="Dismiss chatbot card"
+ disabled={dismiss.isPending}
+ onClick={() => dismiss.mutate()}
+ >
+ <X />
+ </Button>
+ </Card>
+ );
+}
diff --git a/src/client/features/dashboard/DashboardPage.tsx b/src/client/features/dashboard/DashboardPage.tsx
index a34c230d..d35b3569 100644
--- a/src/client/features/dashboard/DashboardPage.tsx
+++ b/src/client/features/dashboard/DashboardPage.tsx
@@ -18,6 +18,8 @@ import { Fragment } from "react";
import { useQuery } from "@tanstack/react-query";
import { sort } from "remeda";
import { DashboardOnboarding } from "./DashboardOnboarding";
+import { DashboardAgentCard } from "./DashboardAgentCard";
+import { getStepStatus } from "./dashboardSteps";
import {
AuditHealthCard,
GscCard,
@@ -30,6 +32,7 @@ import {
getDashboardOverview,
} from "@/serverFunctions/dashboard";
import { Skeleton } from "@/client/components/ui/skeleton";
+import { isHostedClientAuthMode } from "@/lib/auth-mode";
export function DashboardPage({
projectId,
@@ -43,6 +46,7 @@ export function DashboardPage({
const activationQuery = useQuery({
queryKey: ["dashboardActivation", projectId],
queryFn: () => getDashboardActivation({ data: { projectId } }),
+ refetchOnWindowFocus: "always",
});
const overviewQuery = useQuery({
queryKey: ["dashboardOverview", projectId],
@@ -180,6 +184,11 @@ export function DashboardPage({
</Button>
</div>
+ {isHostedClientAuthMode() &&
+ getStepStatus(activation, "mcp") === "todo" ? (
+ <DashboardAgentCard projectId={projectId} />
+ ) : null}
+
<WorkspaceMergeBanner />
{activationQuery.isError ? (