From db93e688e1dc0cd3ac50ab86177e92c5c18cb50d Mon Sep 17 00:00:00 2001 From: heartsiddharth1 Date: Fri, 7 Aug 2026 00:05:38 +0530 Subject: [PATCH] fix: include compatible clients in machine-readable docs --- lib/compatible-clients.ts | 32 ++++++++++++++++++++++++++++++++ lib/geistdocs/source.ts | 7 +++++-- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/lib/compatible-clients.ts b/lib/compatible-clients.ts index 1c9fc87..dab390a 100644 --- a/lib/compatible-clients.ts +++ b/lib/compatible-clients.ts @@ -120,3 +120,35 @@ export const compatibleClients: readonly CompatibleClient[] = [ }, }, ]; + +const markdownMcpTransportLabels: Record = { + stdio: "stdio", + "streamable-http": "Streamable HTTP", + sse: "legacy SSE", +}; + +export const renderCompatibleClientsMarkdown = (): string => + compatibleClients + .map((client) => { + const lines = [ + `## [${client.name}](${client.homepageUrl})`, + "", + client.description, + "", + client.supports.skills ? "- Agent Skills" : null, + client.supports.mcp + ? `- MCP: ${client.supports.mcp.transports + .map((transport) => markdownMcpTransportLabels[transport]) + .join(", ")}` + : null, + client.instructionsUrl + ? `- [Setup instructions](${client.instructionsUrl})` + : null, + client.sourceUrl ? `- [Source code](${client.sourceUrl})` : null, + ]; + + return lines + .filter((line): line is string => line !== null) + .join("\n"); + }) + .join("\n\n"); \ No newline at end of file diff --git a/lib/geistdocs/source.ts b/lib/geistdocs/source.ts index 4b251f6..4bf477c 100644 --- a/lib/geistdocs/source.ts +++ b/lib/geistdocs/source.ts @@ -2,7 +2,7 @@ import { type InferPageType, loader } from "fumadocs-core/source"; import { lucideIconsPlugin } from "fumadocs-core/source/lucide-icons"; import { docs } from "@/.source/server"; import { basePath } from "@/geistdocs"; - +import { renderCompatibleClientsMarkdown } from "@/lib/compatible-clients"; // See https://fumadocs.dev/docs/headless/source-api for more info export const source = loader({ baseUrl: "/", @@ -31,7 +31,10 @@ export const getLLMText = async ( page: InferPageType, { includeNavigationFooter = true } = {} ) => { - const processed = await page.data.getText("processed"); + const processed = (await page.data.getText("processed")).replace( + "", + renderCompatibleClientsMarkdown() +); const { title, description, product, type, summary, prerequisites, related } = page.data;