"use client"; import { useState } from "react"; import Markdown from "@/components/Markdown"; import { Sparkles, Terminal, Server, Copy, Check, Laptop, } from "lucide-react"; const CONFIGS = [ { id: "claude", label: "Claude Desktop", icon: Sparkles, lang: "json", filename: "~/Library/Application Support/Claude/claude_desktop_config.json", content: `{ "mcpServers": { "mcpedia": { "command": "bun", "args": ["run", "/path/to/mcpedia/apps/mcp/src/index.ts"], "env": { "DATABASE_URL": "postgresql://postgres:password@localhost:5432/mcpedia", "OPENROUTER_API_KEY": "sk-or-v1-..." } } } }`, }, { id: "cursor", label: "Cursor AI", icon: Laptop, lang: "json", filename: ".cursor/mcp.json", content: `{ "mcpServers": { "mcpedia": { "command": "bun", "args": ["run", "/path/to/mcpedia/apps/mcp/src/index.ts"], "env": { "DATABASE_URL": "postgresql://postgres:password@localhost:5432/mcpedia" } } } }`, }, { id: "http", label: "Streamable HTTP (SSE)", icon: Server, lang: "json", filename: "Streamable HTTP Client Config", content: `{ "mcpServers": { "mcpedia-remote": { "url": "https://mcp.asepharyana.my.id/mcp", "headers": { "x-webhook-secret": "your-secret-here" } } } }`, }, { id: "cli", label: "CLI & Scripts", icon: Terminal, lang: "bash", filename: "Terminal Subprocess / REPL", content: `# Semantic question answering via MCP client bun run apps/mcp-client/src/ask.ts "How does ret2win stack alignment work in x86_64?" # Interactive REPL with tool discovery bun run apps/mcp-client/src/index.ts`, }, ]; export default function McpConfigSnippet() { const [activeTab, setActiveTab] = useState("claude"); const [copied, setCopied] = useState(false); const current = CONFIGS.find((c) => c.id === activeTab) || CONFIGS[0]; const markdownSnippet = `\`\`\`${current.lang} ${current.content} \`\`\``; function handleCopyAll() { navigator.clipboard.writeText(current.content); setCopied(true); setTimeout(() => setCopied(false), 2000); } return (