Site Architecture Overview
Read.Wiki is not a plain Starlight documentation site: it is also a source that AI tools can read directly. To understand it, recognize the three parallel access paths.
Three audiences, three paths
Section titled “Three audiences, three paths”| Reader | Entry | Transport |
|---|---|---|
| Browser users | /zh/..., /en/... | HTML + Pagefind search |
| Plain-text scrapers | /llms.txt, /llms-full.txt | text/plain |
| MCP clients (Claude Desktop, …) | /mcp | JSON-RPC over Streamable HTTP |
The first two are statically prerenderable; the third is on-demand SSR, which is why the project runs Astro SSR with @astrojs/node.
Key directories
Section titled “Key directories”src/content/docs/{zh,en}/— all Markdown content; Starlight consumes it at build time,src/lib/docs.tsconsumes it at runtimesrc/lib/docs.ts— the single source of truth that feeds both AI-index generation and MCP searchsrc/lib/mcp.ts— registers the output ofdocs.tsas MCP resources, tools, and promptssrc/pages/mcp.ts— thePOST /mcpJSON-RPC endpoint; builds a fresh stateless server per request
Multi-version strategy
Section titled “Multi-version strategy”astro.config.mjs switches base via the VERSION env var: main → /, v2.0 → /v2.0/. One source tree can be built three times and deployed side-by-side under /, /v1.0/, /v2.0/.