MkDocs plugin to generate /llms.txt files for LLM-friendly documentation.
Generates three outputs from your MkDocs site:
/llms.txt— A curated index following the llmstxt.org spec with links to per-page markdown files/llms-full.txt— All documentation concatenated into a single file (for stuffing into LLM context windows)- Per-page
.mdfiles — Raw markdown accessible at the same URL path as HTML pages
uv add mkdocs-llms-sourceAdd to your mkdocs.yml:
site_name: My Project
site_url: https://docs.example.com
site_description: Documentation for My Project
plugins:
- search
- llms-sourceBuild your site:
mkdocs buildThe plugin auto-derives the llms.txt section structure from your MkDocs nav — zero extra configuration needed.
plugins:
- llms-source:
full_output: true # Generate llms-full.txt (default: true)
markdown_urls: true # Copy .md source files to output (default: true)
description: "Override description for llms.txt header"Source-first approach: The plugin uses your original markdown source files directly — no HTML-to-Markdown conversion. This is simpler, more reliable, and preserves your intended formatting.
The llms.txt sections are automatically derived from your MkDocs nav configuration, so top-level nav items become H2 sections in the output.
Given this nav:
nav:
- Home: index.md
- Guides:
- Getting Started: guides/setup.mdThe generated /llms.txt:
# My Project
> Documentation for My Project
## Home
- [My Project](https://docs.example.com/index.md)
## Guides
- [Getting Started](https://docs.example.com/guides/setup.md)MIT