From a4733c0617433204d6570f5f2a5008b5f9409c7e Mon Sep 17 00:00:00 2001 From: Aman Varshney Date: Thu, 2 Apr 2026 20:56:07 +0530 Subject: [PATCH 1/4] fix(site): fix MCP page agent cards, prompt bubbles, and CTAs - Agent cards: add tooltips, copy-to-clipboard, correct deep links for Cursor/VS Code, and proper external links - Prompt bubbles: make copyable with tooltip feedback - CTA section: differentiate "Add MCP Server" and "Read Docs" hrefs - "Want to see your tool listed?": open Tally form modal instead of broken link --- .../src/app/mcp/_components/agent-card.tsx | 88 +++++++++++++------ .../mcp/_components/mcp-agents-section.tsx | 73 ++++++++++----- .../src/app/mcp/_components/mcp-bubble.tsx | 48 ++++++---- .../app/mcp/_components/mcp-cta-section.tsx | 31 +++---- apps/site/src/app/mcp/page.tsx | 55 ++++++------ 5 files changed, 184 insertions(+), 111 deletions(-) diff --git a/apps/site/src/app/mcp/_components/agent-card.tsx b/apps/site/src/app/mcp/_components/agent-card.tsx index 376a228fed..d334781f7a 100644 --- a/apps/site/src/app/mcp/_components/agent-card.tsx +++ b/apps/site/src/app/mcp/_components/agent-card.tsx @@ -1,45 +1,75 @@ +"use client"; + import Image from "next/image"; +import { useState } from "react"; + +import { Tooltip, TooltipContent, TooltipTrigger } from "@prisma/eclipse"; export function AgentCard({ logo, alt, icon, href, + copyText, }: { logo: string | null; alt: string; icon: string | null; - href: string; + href?: string; + copyText?: string; }) { + const [copied, setCopied] = useState(false); + + const isCopyAction = !!copyText; + const isExternalLink = !isCopyAction && href?.startsWith("http"); + + const handleClick = (e: React.MouseEvent) => { + if (!isCopyAction) return; + e.preventDefault(); + navigator.clipboard.writeText(copyText); + setCopied(true); + setTimeout(() => setCopied(false), 1500); + }; + + const Tag = isCopyAction ? "button" : "a"; + const linkProps = isCopyAction + ? { type: "button" as const, onClick: handleClick } + : { + href, + ...(isExternalLink ? { target: "_blank", rel: "noopener noreferrer" } : {}), + }; + return ( - - {logo ? ( - - ) : ( - - Any AI agent - - )} - {icon ? ( - + + - - - ) : null} - + {logo ? ( + + ) : ( + Any AI agent + )} + {icon ? ( + + + + ) : null} + + + {copied ? "Copied!" : alt} + ); } diff --git a/apps/site/src/app/mcp/_components/mcp-agents-section.tsx b/apps/site/src/app/mcp/_components/mcp-agents-section.tsx index 9cff01c390..6c839a6992 100644 --- a/apps/site/src/app/mcp/_components/mcp-agents-section.tsx +++ b/apps/site/src/app/mcp/_components/mcp-agents-section.tsx @@ -1,4 +1,15 @@ -import { Button } from "@prisma/eclipse"; +"use client"; + +import Script from "next/script"; + +import { + Dialog, + DialogContent, + DialogHeader, + DialogTitle, + DialogTrigger, + TooltipProvider, +} from "@prisma/eclipse"; import { AgentCard } from "./agent-card"; @@ -6,16 +17,11 @@ export type McpAgent = { logo: string | null; alt: string; icon: string | null; - href: string; + href?: string; + copyText?: string; }; -export function McpAgentsSection({ - docsHref, - agents, -}: { - docsHref: string; - agents: readonly McpAgent[]; -}) { +export function McpAgentsSection({ agents }: { docsHref: string; agents: readonly McpAgent[] }) { return (
@@ -29,19 +35,44 @@ export function McpAgentsSection({

-
- {agents.map(({ logo, alt, icon, href }) => ( - - ))} -
+ +
+ {agents.map((agent) => ( + + ))} +
+
- + + + + + + + Want to see your favorite AI tool listed on prisma.io/mcp? + +