"use client"; import { useState } from "react"; import Markdown from "@/components/Markdown"; const CONFIGS = [ { id: "claude", label: "Claude Desktop", 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://...", "OPENROUTER_API_KEY": "sk-or-v1-..." } } } }`, }, { id: "http", label: "Remote HTTP (SSE)", lang: "json", filename: "Streamable HTTP Endpoint", content: `{ "mcpServers": { "mcpedia-remote": { "url": "https://mcp.asepharyana.my.id/mcp", "headers": { "x-webhook-secret": "your-secret-here" } } } }`, }, { id: "cli", label: "CLI Client", lang: "bash", filename: "Terminal One-Shot / REPL", content: `# One-shot question bun run apps/mcp-client/src/ask.ts "How does ret2win stack alignment work?" # Interactive REPL bun run apps/mcp-client/src/index.ts`, }, ]; export default function McpConfigSnippet() { const [activeTab, setActiveTab] = useState("claude"); const current = CONFIGS.find((c) => c.id === activeTab) || CONFIGS[0]; const markdownSnippet = `\`\`\`${current.lang} ${current.content} \`\`\``; return (
{/* Header bar with tabs */}
{CONFIGS.map((c) => ( ))}
{current.filename}
{/* Code preview via Markdown syntax highlighter */}
Config target: {current.filename} Format: {current.lang}
); }