mkdocs-llms-source
MkDocs plugin to generate /llms.txt files for LLM-friendly documentation.
What It Does
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
Install
uv add mkdocs-llms-source
Usage
Add to your mkdocs.yml:
site_name: My Project
site_url: https://docs.example.com
site_description: Documentation for My Project
plugins:
- search
- llms-source
Build your site:
mkdocs build
The plugin auto-derives the llms.txt section structure from your MkDocs nav — zero extra configuration needed.
Configuration
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_revision: false # Stamp outputs with the docs git revision (default: false)
Source revision stamping
Set source_revision: true to stamp every exported per-page .md file — and llms-full.txt — with a first-line HTML comment recording the docs repo's current git commit:
<!-- rev: a1b2c3d -->
# Your Page Title
...
The short SHA comes from git rev-parse --short HEAD, run in your MkDocs project directory at build time. This lets AI agents and telemetry record exactly which docs revision they fetched, so "it worked yesterday" becomes answerable by diffing two known revisions. llms.txt (the index) is left unstamped.
If the project isn't a git repository — or git isn't available — the stamp is silently omitted and the build still succeeds.
How It Works
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.
Example Output
Given this nav:
nav:
- Home: index.md
- Guides:
- Getting Started: guides/setup.md
The 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)
License
MIT
Metadata
Release files for mkdocs-llms-source 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mkdocs_llms_source-1.2.0.tar.gz | 72.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mkdocs_llms_source-1.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 80.5 kB
Release files / mkdocs_llms_source-1.2.0.tar.gz
| Download URL | mkdocs_llms_source-1.2.0.tar.gz |
|---|---|
| Size | 72.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
177efd34aca375a0ea747b6cf22596be22ba4c32a7a072bf97405250e4078566
|
|
BLAKE2b-256 checksum How to use checksums |
440280b5d343e5efe53ff9b1c34797215fe0551d6d01f831451b48ac8f74699a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 18, 2026.
Transparency logRelease files / mkdocs_llms_source-1.2.0-py3-none-any.whl
| Download URL | mkdocs_llms_source-1.2.0-py3-none-any.whl |
|---|---|
| Size | 7.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6fda5242cb8c9f50a792fcaa880f185ae67ebef4490143406e5a432eaffd8ac2
|
|
BLAKE2b-256 checksum How to use checksums |
6bb7b6d49bb519cd6b37a151404133a1dc140a96125a780344cf21e2c24c3b80
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 18, 2026.
Transparency log