Published · 8 min read
MCP server for documentation
Learn what an MCP server for documentation does, what to expose to AI tools like Claude and Cursor, and how to keep answers accurate after every merge.
Published · 8 min read
Learn how to create llms.txt for your documentation: what goes in it, how to write or generate one, and how to keep it accurate after each release.
Your docs site has hundreds of pages. When an AI agent or coding assistant lands on it, how does it know which ten matter? And when it pulls an answer about your API, is it reading the current reference or a stale tutorial from two versions ago? An llms.txt file is one small way to answer the first question. This guide covers how to create llms.txt for a documentation site: what goes in it, how to write one by hand, how to generate it from source, and how to keep it accurate after every release.
The idea comes from a proposal by Jeremy Howard: "We propose adding a /llms.txt markdown file to websites to provide LLM-friendly content". In practice, it is a curated Markdown overview of your site. It has a title, a short summary, and grouped lists of links to the pages a language model or agent should read first, each with a one-line note.
It is not a sitemap. A sitemap lists everything so crawlers can find it. An llms.txt file is a map with opinions. It tells a client where the quickstart lives, where the API reference lives, and what each page is for.
Adoption has grown quickly. An Originality.ai tracking study of more than 3 million websites, reported by PPC Land, counted 4,088 llms.txt instances in June 2025 and 36,120 in May 2026, an 8.8x increase. Chrome has also started paying attention. Lighthouse's agentic browsing checks now look for "the presence of a machine-readable summary at the domain root". Search Engine Land reports that Google says you don't need llms.txt for Search, and that the audit doesn't produce a traditional 0–100 Lighthouse score. Chrome's audit page puts the reasoning plainly: "Without llms.txt, agents may spend more time crawling the site to understand its high-level structure and primary content".
Keep your expectations honest. Ahrefs analyzed logs from 137,000 domains and found that 97% of llms.txt files got zero requests. AI retrieval bots accounted for just 1.1% of llms.txt requests, while 12% came from tools auditing or scanning the files. A separate dataset found SEO audit tools led with 21.7% of requests. So llms.txt is cheap to publish and increasingly checked, but it is not a traffic lever. Treat it as one part of making docs readable by agents, alongside clean Markdown versions of pages and accurate examples. A discovery file alone cannot repair an outdated example.
The most common mistake is dumping every URL into the file. If the list is as long as your sitemap, you have thrown away the one thing that makes llms.txt useful: curation.
Start from the questions developers actually ask about your product, then pick the pages that answer them. For most developer-tool companies, that means:
Leave out marketing pages, blog posts, and anything that describes behavior you no longer support. If you publish multiple API versions, list the current one prominently and decide deliberately whether older versions belong in the file at all. An agent that follows a link to v1 docs will happily generate v1 code.
Put the file at /llms.txt on your domain root. If your docs live under a path or a separate product area, you can use a scoped location such as /docs/llms.txt when it makes sense. Just remember that the Lighthouse check looks at the domain root.

For a small docs site, writing the file by hand is fine and takes less than an hour. The format is plain Markdown with a predictable structure.
A minimal file for a fictional API might read like this, line by line:
# Example API
> Example API lets developers send and track transactional messages over REST.
## Guides
- [Quickstart](https://docs.example.com/v2/quickstart): A first request.
## API reference
- [API reference](https://docs.example.com/v2/api): Parameters and responses.
Write the descriptions for a reader who has never seen your product. "Parameters and responses" is better than "Reference." "How to rotate keys without downtime" is better than "Auth." The note is what lets an agent decide whether to follow the link, so make it specific.
Then make the file discoverable. The v2 changelog notes that the most common request after adoption was discoverability. Version 2 uses standard link relations: rel="alternate" type="text/markdown" points to a page's Markdown version, and rel="describedby" points to the llms.txt file that covers it. You can provide both as HTML elements or as an HTTP Link header. If you already serve Markdown versions of your pages, add both relations to each page's head.
The downside of a hand-written file is obvious. It is a second copy of your navigation that nobody remembers to update.
If your docs are authored in MDX or Markdown, the information an llms.txt file needs already exists. Page titles, descriptions, section groupings, and URLs live in frontmatter and navigation config. Generating the file at build time removes the second copy.
A basic generator does four things:
Two habits make generated files good instead of merely complete. First, require a real description in frontmatter and fail the build if it is missing, because an empty note is useless to an agent. Second, keep the inclusion flag explicit. Default to excluded, and opt pages in. That preserves curation even when the file is automated.
While you are in the build pipeline, emit a Markdown version of each page and the rel="alternate" and rel="describedby" links from the same source. Then every format comes from one MDX file, and they cannot disagree with each other.
This is the approach Thally's Content Graph takes: you author in MDX once and publish HTML, Markdown, JSON, and llms.txt from the same source, so the discovery file is a build artifact rather than a document someone maintains.

A generated llms.txt file stays structurally current: new pages appear, deleted pages disappear. But it is only as accurate as the pages it points to. If a merged pull request renames a parameter and the reference page still shows the old name, your llms.txt file now sends agents straight to wrong information, faster than before.
That is the real maintenance problem, and it is a docs drift problem, not an llms.txt problem. Docs rarely go out of date because nobody cares. They go out of date because the change happens in one place and the affected pages live somewhere else, including guides, tutorials, and support articles that mention a behavior without being "the docs for" that feature.
A few practices keep both the file and the pages behind it trustworthy:
The hard part is knowing which pages a given merge affected. Thally Automation handles that step: when a pull request merges, it analyzes the change, drafts the documentation updates it implies, and opens them as a pull request on your docs repo for your review. Nothing publishes without a human approving it, and once the fix merges, your llms.txt points to pages that match the product again.
Start small. Hand-write a file this week if you need one now, then move it into your build so it stops being one more thing to remember.
Published under the Thally editorial policy. Technical conformance is defined in the agent-readiness methodology.
Create a managed site, or use the open-source engine to run Thally yourself.