Make your docs answerable by people and by agents, from one static index: a cited Ask box, an MCP server and llms.txt, on your own function and key, with no vector database and no vendor. Docusaurus and Starlight plugins, Next.js, or one script tag.
FAQ (answers come from our records)
How do I install it?
The repository provides this install command: npx ondocs. It comes from the repository itself; we cannot guarantee it runs as-is in your client.
Who is it for?
We filed it under these tags: 开源项目. The tags come from the entry itself, not a taxonomy we imposed.
Who maintains it?
repository dgesteves/ondocs;first catalogued 2026-10-10;last seen 2026-10-10。There is no official certification or quality rating here — we record sources and dates only.
ondocs
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
**Open-source Ask AI for your docs.** Cited answers on your own model key, and an MCP server for coding agents, from one index built with your Starlight, Docusaurus or VitePress site. No vendor, no vector database.
For teams that run their own developer docs, at product, API and platform companies, who want Ask AI without a hosted assistant.
**Answers with**
**Ask these docs from your editor**, over this site's MCP server:
**Website: ondocs.vercel.app**, whose docs answer with OpenAI and serve agents at /api/mcp. Formerly ask-my-site (what changed).
https://github.com/user-attachments/assets/2491c5ea-de70-471c-b11e-30591c074e6f
The live demo : a streamed answer with citations, one opening the section it came from, then the one-line setups.
The live demo : a streamed answer with citations, one opening the section it came from, then the one-line setups.
-->
What you get
One index, ask-index.json, built with your site, feeds three things:
- **An Ask box for people.** A ⌘I dialog that streams a short answer from your model, with numbered citations to the exact section. Most off-topic questions get "I don't know" before the model is called. A page loads only the button; the dialog loads on first use.
- **An MCP server for agents.** search, fetch and list_pages over the same index, for coding agents and ChatGPT. Agents bring their own model, and keyword search, the default, calls no model at all.
- **llms.txt, llms-full.txt and a .md copy of every page**, written with the build.
Search runs in memory inside one function you deploy: BM25 and vectors, merged with reciprocal rank fusion.
Pick your setup
| Your site | What you add | Guide |
| ---------------------------------- | -------------------------------------------------- | ----------------------------------------------------------- |
| Starlight, or any Astro site | A plugin, or an integration | Astro and Starlight |
| Docusaurus 3 | A plugin | Docusaurus |
| VitePress | One wrapper in its config | VitePress |
| Next.js or another React app | A route and a component | Next.js and React |
| Fumadocs | A route and a component | Fumadocs |
| Nextra | A route and a component | Nextra |
| Hugo, Jekyll, MkDocs or plain HTML | One script tag; for plain HTML, init --out | Script tag |
Each answers from an endpoint you deploy as one function next to the site, rate-limited by default. npx ondocs init writes it for Vercel, Netlify, Cloudflare or GitHub Pages (as a Worker answering with Workers AI, no API key): see Deploying.
**Live demos:** Starlight, Docusaurus, VitePress.
**Starlight.** npm i ondocs ai @ai-sdk/openai react react-dom @radix-ui/react-dialog cmdk, then:
After astro build, it indexes the pages into dist/ask-index.json, writes llms.txt and the .md pages, and adds an "Ask AI" button with ⌘I. Static site? npx ondocs init. SSR adapter? Nothing to do.
**Docusaurus.** npm i ondocs ai @ai-sdk/openai @radix-ui/react-dialog cmdk, then:
It does the same after docusaurus build, into build/.
**Next.js.** With OPENAI_API_KEY set, index your content with npx ondocs index ./content --base-url /docs --llms-txt public, then:
and render the dialog in your layout, with its two stylesheets:
**Any other site.** Index the HTML it builds, write the endpoint with npx ondocs init, and add the script tag:
On a GitHub Pages project site, at https://user.github.io/repo, add --base-url /repo to the index command.