import Link from "next/link"; import { listDocuments, listSections } from "@mcpedia/core"; import { getSectionMeta, type SectionConfig } from "@mcpedia/config"; import McpConfigSnippet from "@/components/McpConfigSnippet"; import InteractiveTopology from "@/components/InteractiveTopology"; import { Search, Plus, BookOpen, ArrowRight, Database, Layers, Folder, FileText, Clock, Terminal, } from "lucide-react"; export const dynamic = "force-dynamic"; interface TreeNode { name: string; slug: string; title: string; children: TreeNode[]; isLeaf: boolean; } function slugToTitle(segment: string): string { return segment .split(/[-_]/) .map((w) => (w ? w.charAt(0).toUpperCase() + w.slice(1) : "")) .join(" "); } function buildFolderTree(docs: { slug: string; title: string }[], section: string): TreeNode[] { const tree: TreeNode[] = []; for (const doc of docs) { const parts = doc.slug.split("/"); let current = tree; let currentPath = section; for (let i = 1; i < parts.length; i++) { const part = parts[i]; const isLeaf = i === parts.length - 1; currentPath = `${currentPath}/${part}`; let node = current.find((n) => n.name === part); if (!node) { node = { name: part, slug: currentPath, title: isLeaf ? doc.title : slugToTitle(part), children: [], isLeaf: false, }; current.push(node); } if (isLeaf) { node.isLeaf = true; node.title = doc.title; } else if (!node.title) { node.title = slugToTitle(part); } current = node.children; } } function sortNodes(nodes: TreeNode[]): TreeNode[] { return nodes.sort((a, b) => { const aFolder = a.children.length > 0 ? 0 : 1; const bFolder = b.children.length > 0 ? 0 : 1; if (aFolder !== bFolder) return aFolder - bFolder; return (a.title || a.name).localeCompare(b.title || b.name); }); } function sortAll(nodes: TreeNode[]): TreeNode[] { const sorted = sortNodes(nodes); for (const node of sorted) { if (node.children.length > 0) sortAll(node.children); } return sorted; } return sortAll(tree); } function renderTree(nodes: TreeNode[]) { return (
No documents
)}A high-performance technical knowledge repository. Humans read the web interface; AI assistants connect directly via native MCP tools. Both share one unified database source of truth.
{/* Quick Action Buttons */}{s.desc}
Equip Claude Desktop, Cursor, Antigravity, or custom agents with direct access to your knowledge base via semantic search, read resources, and document tools.