"use client"; import { useState } from "react"; const CONFIGS = [ { id: "claude", label: "Claude Desktop", 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)", 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", 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 [copied, setCopied] = useState(false); const current = CONFIGS.find((c) => c.id === activeTab) || CONFIGS[0]; function handleCopy() { navigator.clipboard.writeText(current.content); setCopied(true); setTimeout(() => setCopied(false), 2000); } return (
{current.content}