Skip to content
Thally
Log inGet started
Guide

Published · 13 min read

Compare llms.txt and MCP for documentation discovery, retrieval, freshness, and access. Choose one or both, then test the published content clients receive.

By Published Updated

A developer asks an assistant how to call your API. The assistant finds a page, copies an example, and uses a parameter you removed last month. A discovery file alone cannot repair an outdated example. First check which version the assistant read and whether the example still works.

Agent-readable documentation gives a client a way to find the right pages, read their content, and check the source behind an answer. When choosing llms.txt vs MCP, start with the client your readers actually use. A file offers a curated path into the docs. Model Context Protocol (MCP) offers a negotiated interface through which a compatible client can request information. You can provide both from the same published source.

If your immediate problem is stale examples, start with our guide to outdated API answers from coding assistants.

llms.txt vs MCP: which does your reader need?

Use llms.txt when a client can fetch web content and benefits from a small, curated index. Add a documentation MCP server when your readers use compatible clients and need tools such as search and page reading. Neither option guarantees that a client will use it, retrieve the right version, cite your page, or answer correctly.

Questionllms.txtDocumentation MCP server
What do you publish?A Markdown overview with guidance and linksA server interface with advertised capabilities, such as search and read tools
What does the reader's client need?A way to fetch and interpret the file and linked pagesMCP support, a server connection, and permission to use its tools
How does it find an answer?The client selects and follows relevant linksThe client discovers tool schemas, then makes supported calls
What stays current?The served file and its linked content need updatingThe server's backing pages, search index, and any caches need updating
What controls private content?Access checks on the file and every linked formatAuthorization enforced by the server and its backing sources
What must your team operate?Generation or editorial upkeep, hosting, and link checksA service, tool contracts, compatibility, access controls, and retrieval checks
What does success prove?The client can find and read the intended pagesThe client can obtain the intended content through the advertised operations

The file side follows the llms.txt proposal. The tool side follows MCP's tool discovery and invocation contract. Search and page reading are examples of a documentation server's design, rather than tool names required by MCP.

Two engineers compare an llms.txt guidebook with an MCP lookup on a laptop, beneath the handwritten words Find, Read, and Verify.
A useful map and a working lookup serve the same reader. Test the route their client supports.

Choose one, both, or fix the source first

  • Start with the file if the docs are public, your target client reads it, and a short index gets readers to the right version. You can serve it alongside a static site without running an MCP service.
  • Add MCP if readers already connect their assistants to documentation tools and need query-based retrieval. Budget for operating the endpoint and testing its results. A platform may provide that service, but you still need to check what it exposes.
  • Offer both when some readers follow links and others use connected tools. Generate them from the same reviewed source and check that they agree on product versions and permissions.
  • Repair the source first if both routes return an obsolete example. Changing the retrieval interface cannot correct the parameter or behavior described on that page.

Imagine a reader upgrading from API v1 to v2. The index can point them to the migration guide. A search tool can locate the section about a removed parameter. Either can still select a v1 example unless the version and applicability are clear. This is a suggested evaluation task, not a measured product result.

Retrieval at request time does not guarantee fresh content

An MCP call happens when the client requests it, but the server may search an index built earlier. Likewise, fetching llms.txt now can return a cached file or a link to an old release. Check the source version and the returned passage through both routes. Treat missing source or revision information as unknown rather than assuming it is current.

The architecture below illustrates one possible implementation. The published source feeds both page output and a search index. Those generation steps can finish at different times. Other servers may read pages directly or use a different backend.

Hand-drawn architecture with a client following llms.txt to docs pages or calling MCP backed by a search index. A published source feeds both the pages and the index.
Arrows show discovery, request, and generation paths. The two routes still depend on the source and the outputs built from it.

Give clients a useful map with llms.txt

The llms.txt proposal describes a curated Markdown overview with links to useful resources. It helps clients that choose to read it understand your documentation. It is discovery and context guidance. It does not grant access, express crawler permissions, or replace authentication.

Put the file at /llms.txt, or use a scoped location such as /docs/llms.txt when appropriate. Link to real pages and explain which version they cover. This fictional example uses absolute URLs so the destinations remain clear when a client copies the text elsewhere.

# Acme API documentation

> Documentation for Acme API v2. Start with the quickstart.
> Use the migration guide when upgrading from v1.

## Guides

- [Quickstart](https://docs.example.com/v2/quickstart): A first request.
- [API reference](https://docs.example.com/v2/api): Parameters and responses.
- [Migration guide](https://docs.example.com/migrate-v1-v2): Breaking changes.

Keep the map short enough to review. Check that its links resolve and that the descriptions match the destination pages. Generate it from maintained sources when possible. Publishing it does not establish that a particular crawler uses it.

The proposal's August 2026 revision adds explicit discovery guidance: a page can advertise its Markdown alternative with rel="alternate" and its covering llms.txt with rel="describedby", through HTML links or HTTP headers. A file under a subpath covers that path, and the most specific file applies. Check your publishing system's actual output before assuming it provides these relations.

For Google Search, Google says it ignores llms.txt. Special AI files and Markdown are not required for its generative Search features. A page still needs to be indexed and eligible for a snippet. Meeting those requirements does not guarantee indexing or inclusion.

Set crawler preferences separately

Use robots.txt for the preferences each provider documents. Training crawlers, search crawlers, and user-requested retrieval have different purposes.

ProviderTrainingSearchUser-requested retrieval
OpenAIGPTBot collects material that may be used for trainingOAI-SearchBot supports ChatGPT searchChatGPT-User handles certain user requests
AnthropicClaudeBot collects material that may contribute to trainingClaude-SearchBot indexes content for searchClaude-User retrieves content for users
PerplexityPerplexityBot is not a training crawlerPerplexityBot finds pages for searchPerplexity-User retrieves pages at a user's request

These distinctions come from OpenAI, Anthropic, and Perplexity. Check their current documentation before changing policy.

For public documentation, this example allows the named search crawlers and declines the named training crawlers. Merge it with your existing rules and review the paths you intend to expose.

User-agent: OAI-SearchBot
Allow: /

User-agent: Claude-SearchBot
Allow: /

User-agent: PerplexityBot
Allow: /

User-agent: GPTBot
Disallow: /

User-agent: ClaudeBot
Disallow: /

Allowing search crawling does not promise inclusion in an answer. OpenAI treats search and training settings independently. Anthropic says its three named bots honor robots.txt. OpenAI says robots.txt may not apply to ChatGPT-User requests, and Perplexity says Perplexity-User generally ignores it for user-requested fetches. Do not assume one rule controls every retrieval path.

Crawler preferences are not a security boundary. Protect private pages with authentication and enforce the same permissions on alternate formats and MCP tools. Check your CDN and firewall too. A robots rule cannot make a blocked request succeed, and a user agent string alone does not verify a crawler's identity. Use each provider's published verification guidance.

Test the response a client actually receives

Start with HTML that contains the documentation people need. Add Markdown or JSON where your readers' tools support those formats. An Accept header only works when the server implements content negotiation. A ?format=md parameter is an application convention, not a universal capability.

Use this read-only check against the public Thally website, or replace the URLs with your own.

curl --fail --silent --show-error --location \
  https://thally.io/llms.txt -o llms.txt
head -n 8 llms.txt

curl --fail --silent --show-error --location \
  https://thally.io/blog/agent-ready-docs-llms-txt-mcp \
  -o guide.html

The first response should be a readable index with a heading and links. The second should contain the guide's text. A successful status code alone is insufficient. A login page, error document, or empty application shell can also arrive with status 200. These two requests were rechecked on October 25, 2026.

If your server advertises Markdown, request the documented route or media type and inspect both the content type and body. Compare the API version, parameter names, response examples, warnings, and source links against the HTML page. Navigation and formatting can differ while the technical meaning stays the same.

Generate formats from one source where possible. Shared generation reduces opportunities for drift, but the source itself can still be wrong. Structured data should describe visible content accurately. JSON-LD does not establish that an assistant will retrieve or cite a page.

Inspect MCP tools before calling them

MCP lets compatible clients call a server's advertised tools. Tool names and argument shapes depend on the server. Discover them instead of assuming every docs endpoint implements the same contract.

The public Thally website exposes /api/mcp. The following read-only probe is specific to that endpoint: it returns JSON and does not require authentication or a session ID. Other servers can require authentication, sessions, or streaming response handling. Use a compatible client for those servers.

The MCP lifecycle starts with initialization, followed by an initialized notification. HTTP requests then carry the negotiated protocol version. The transport specification explains the response formats and session behavior a general client must support.

Save this as check_docs.py in a scratch directory and run python3 check_docs.py. It requires Python 3 and internet access, uses only the standard library, and writes its result to the terminal. It checks this website's tool list, searches for the article, and reads every returned chunk. It does not install an MCP server or connect an assistant.

import json
import urllib.request

endpoint = "https://thally.io/api/mcp"
version = None
request_id = 0


def rpc(method, params=None, notify=False):
    global request_id
    request_id += 1
    payload = {"jsonrpc": "2.0", "method": method}
    if not notify:
        payload["id"] = request_id
    if params is not None:
        payload["params"] = params
    headers = {"Content-Type": "application/json",
               "Accept": "application/json, text/event-stream"}
    if version:
        headers["MCP-Protocol-Version"] = version
    request = urllib.request.Request(
        endpoint, json.dumps(payload).encode(), headers
    )
    with urllib.request.urlopen(request, timeout=30) as response:
        if notify:
            assert response.status == 202
            return None
        assert response.headers.get_content_type() == "application/json"
        body = json.load(response)
    if "error" in body:
        raise RuntimeError(body["error"])
    result = body["result"]
    if result.get("isError"):
        raise RuntimeError(result)
    return result


init = rpc("initialize", {
    "protocolVersion": "2025-11-25", "capabilities": {},
    "clientInfo": {"name": "thally-docs-check", "version": "1.0.0"}
})
version = init["protocolVersion"]
assert version == "2025-11-25"
assert "tools" in init["capabilities"]
rpc("notifications/initialized", notify=True)
tools = rpc("tools/list", {})
required = {"search_pages", "read_page", "get_page_guide"}
assert required <= {tool["name"] for tool in tools["tools"]}
print("Tools:", ", ".join(tool["name"] for tool in tools["tools"]))


def call(name, arguments):
    result = rpc("tools/call", {"name": name, "arguments": arguments})
    return result["structuredContent"]


path = "/blog/agent-ready-docs-llms-txt-mcp"
search = call("search_pages", {"query": "agent-readable", "limit": 20})
assert any(page["path"] == path for page in search["results"])
call("get_page_guide", {"path": path})
offset = 0
chunks = []
while True:
    page = call("read_page", {"path": path, "offset": offset, "limit": 4000})
    chunks.append(page["content"])
    next_offset = page["nextOffset"]
    if next_offset is None:
        break
    assert next_offset > offset
    offset = next_offset
print("Read", len(chunks), "chunks and", len("".join(chunks)), "characters")
print("Source:", page["url"])

On October 25, 2026, this probe negotiated 2025-11-25, listed list_pages, search_pages, read_page, and get_page_guide, found this article, and read it through nextOffset: null. The character count can change when the site changes. This checks retrieval of a published page, not the accuracy of an assistant's answer or a private documentation deployment.

If the request times out or returns an HTTP error, check connectivity and the endpoint before retrying. A protocol error, missing tool, different schema, or non-JSON response means this endpoint-specific probe no longer fits. Inspect discovery and the server's current documentation rather than treating the run as a pass. For your own Thally documentation site, follow the separate remote MCP setup guide. The marketing website and documentation sites expose different tool contracts.

Compare the retrieved passage with the HTML page and the version your reader needs. Our WebMCP guide explains the separate browser tool interface available on Thally documentation sites.

Record a result you can repeat

Choose a real reader task, such as upgrading a request after an API change. Save the prompt, product version, documentation revision, client, and date. Then check each layer independently.

CheckExpected evidenceIf it fails
DiscoveryIndex links point to the intended versionRepair missing or misleading links
Crawler policyNamed agents receive the intended rulesReview robots, CDN, and firewall behavior
Page contentHTML and advertised formats agree on API behaviorFix the source or generation step
RetrievalThe client receives the relevant passage in fullCheck search, pagination, and version selection
ExampleThe documented request and response assertions passUpdate the example and rerun it
PermissionsRestricted content remains restricted through every interfaceFix authorization before release

A local contract test can catch a renamed parameter or changed response field. It does not prove that an AI assistant will answer correctly. To test an assistant, run the task in that client and save its answer, source passages, and executable result separately. Report failures as well as successes.

If both routes return the wrong behavior, use our documentation automation guide to evaluate maintenance separately from retrieval.

Start with one page your readers already use. Correct its example, make its version explicit, and test the retrieval path they use. If you are moving documentation between systems, use our migration checklist to check links, versions, and access before launch.

Primary references

This guide follows the Thally editorial policy. The comparison, llms.txt revision, MCP contracts, and public endpoint examples were checked October 25, 2026. The crawler-policy section retains its October 18 verification boundary.

On October 26, 2026, we rechecked the public MCP example and clarified that WebMCP browser tools apply to Thally documentation sites.

Published under the Thally editorial policy. Technical conformance is defined in the agent-readiness methodology.

Frequently asked questions

What is the difference between llms.txt and MCP?
llms.txt is a Markdown overview with guidance and links a client can follow. MCP is a protocol through which compatible clients discover and call server capabilities, such as documentation search and page reading. They can serve the same reviewed content through different retrieval paths.
Should I use llms.txt, MCP, or both?
Start with the clients your readers use. A curated llms.txt can help clients that fetch it find public pages. Add MCP when compatible clients need connected search or read tools. Offer both when both workflows matter, and check versions and access through each route.
Does MCP guarantee fresher documentation than llms.txt?
No. A request-time MCP call can return an older search index or cached content. A newly fetched llms.txt can also link to an old release. Verify the backing source, product version, and returned passage through either route.
Does llms.txt improve Google Search rankings?
Google Search says it ignores llms.txt and that maintaining one neither helps nor harms visibility or rankings in Google Search. You can still provide the file for clients that use it. Neither llms.txt nor an MCP connection guarantees citations or correct answers.
Can llms.txt or MCP protect private documentation?
A discovery file does not grant or restrict access. Enforce authentication and authorization on private pages, alternate formats, indexes, and MCP operations. Check each interface with the intended reader's permissions rather than relying on crawler preferences.

Build docs that stay close to your product.

Create a managed site, or use the open-source engine to run Thally yourself.