import Link from "next/link"; import { listDocuments } from "@mcpedia/core"; import { cookies } from "next/headers"; import type { DocSection } from "@mcpedia/core"; export const dynamic = "force-dynamic"; const SECTIONS: { id: DocSection; label: string; icon: string; desc: string }[] = [ { id: "docs", label: "Documentation", icon: "📄", desc: "Setup guides, API references, and protocol specs.", }, { id: "writeups", label: "Writeups", icon: "📝", desc: "Post-mortems, debugging stories, and case studies." }, { id: "research", label: "Research", icon: "🔬", desc: "Deep-dive analysis, architecture notes, and experiments." }, { id: "notes", label: "Notes", icon: "📌", desc: "Quick references, patterns, and gotchas." }, ]; export default async function HomePage() { const all = await listDocuments(); const cookieStore = await cookies(); const canEdit = cookieStore.get("mcpedia_admin")?.value != null; const recent = [...all] .sort( (a, b) => new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime(), ) .slice(0, 6); const bySection = SECTIONS.map((s) => ({ ...s, docs: all.filter((d) => d.section === s.id).slice(0, 4), total: all.filter((d) => d.section === s.id).length, })); return ( <> {/* ── Hero ── */}

MCPedia

A content-first knowledge base for humans and AI agents. Read the web docs, call the MCP server, or browse the full document archive.

Browse Documents Search
{/* Search box */} Search documents, tags, authors...
{/* ── Section Overview ── */}

Browse by section

{bySection.map((s) => (
{s.icon}

{s.label}

{s.desc}

{s.total} document{s.total !== 1 ? "s" : ""} ))}
{/* ── Recent Documents ── */} {recent.length > 0 && (

Recently updated

View all →
{recent.map((d) => (
{SECTIONS.find((s) => s.id === d.section)?.icon || "📄"}

{d.title}

{d.tags.slice(0, 3).map((t) => ( #{t} ))}
))}
)} {/* ── MCP info ── */}

AI agents

MCP server at{" "} mcp.asepharyana.my.id/mcp . All tools available via Streamable HTTP transport.

MCP spec →
); }