Skip to content

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.

ReaderEntryTransport
Browser users/zh/..., /en/...HTML + Pagefind search
Plain-text scrapers/llms.txt, /llms-full.txttext/plain
MCP clients (Claude Desktop, …)/mcpJSON-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.

  • src/content/docs/{zh,en}/ — all Markdown content; Starlight consumes it at build time, src/lib/docs.ts consumes it at runtime
  • src/lib/docs.ts — the single source of truth that feeds both AI-index generation and MCP search
  • src/lib/mcp.ts — registers the output of docs.ts as MCP resources, tools, and prompts
  • src/pages/mcp.ts — the POST /mcp JSON-RPC endpoint; builds a fresh stateless server per request

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/.