llms.txt in MkDocs
MkDocs copies every file in docs/ to the site root, so llms.txt just needs to live there and stay out of the nav.
Last updated:
Where the file goes
MkDocs builds your docs_dir (by default docs/) into a site/
folder. Markdown files become HTML pages; every other file, including .txt, is
copied to the matching path in site/. So docs/llms.txt is served at /llms.txt.
Treat the file as a curated map of the documentation set. Include install guides, configuration reference, API pages, upgrade notes and the changelog, but avoid dumping every generated page into the file. A smaller, maintained list is easier for assistants and humans to audit.
Method: the docs/ directory
- Add the file:
touch docs/llms.txt - Map your key documentation pages (docs are exactly what assistants want here):
# Your Project Docs
> Documentation for Your Project: installation, usage, and API reference.
## Guides
- [Installation](https://yourdomain.com/install/): setup and requirements.
- [User guide](https://yourdomain.com/guide/): day-to-day usage.
## Reference
- [API](https://yourdomain.com/api/): full reference.
-
Build and deploy:
mkdocs build(ormkdocs gh-deployfor GitHub Pages).
Keep it out of the navigation
Verifying the setup
curl -sI https://yourdomain.com/llms.txt | grep -i content-type
# expect: content-type: text/plain Publishing docs to GitHub Pages? Watch the base-path caveat in the GitHub Pages guide. Building the file content is covered in the how-to guide; validate it with the validator.