What Is llms.txt? Format, Examples, and How It Works
Learn what llms.txt does, how its format works, and how it differs from robots.txt and MCP, with a real domain API example.
- ai-agents
- domains
- explainer
llms.txt is a proposed Markdown format that gives AI agents a concise guide to a website and links to useful source material. It helps a reader find documentation; it does not execute API calls or grant access. The current proposal supports both /llms.txt and files within a subpath, such as /docs/llms.txt.
This article explains the format, shows how to create a small example, and walks through Namefi's public API guide. The domain example shows how documentation can point an AI agent toward a registrar's API or Model Context Protocol tools.
Why provide a guide for agents?
A documentation page often mixes its useful instructions with menus, advertising, and scripts. A short index helps an agent choose which page to read next. It still needs accurate linked material and a client capable of retrieving it.
The August 2026 revision clarifies discovery: HTML links or HTTP Link headers can identify a page's Markdown alternative and its applicable llms.txt. A file covers pages below its path; the most specific applicable file takes precedence. Agents are expected to follow relevant links, rather than expand every linked page into one prompt.
llms.txt vs robots.txt
robots.txt tells cooperating crawlers which URLs they may crawl. llms.txt supplies a reading guide. Neither is an access-control mechanism: keep private content behind authentication.
Crawling also differs from indexing. Google explains that a blocked URL can still appear in search results if other pages link to it. A robots.txt restriction does not mean “never index this page.” Publishing an llms.txt file, meanwhile, is not evidence that a search engine will read it or improve a page's ranking.
Format and a minimal llms.txt example
The format uses an H1 project name, an optional summary and notes, then H2 sections containing links. The H1 is the only required section. Here is an illustrative file, using placeholder URLs:
# Example Documentation
> Documentation for the Example project.
## Guides
- [Getting started](https://example.com/docs/start.md): Setup instructions.
## Optional
- [Release notes](https://example.com/docs/releases.md): Older changes.
In v2, Optional is a convention for secondary links, not a directive that requires software to exclude them. The change notes explicitly remove its earlier mechanical meaning.
To create your own file, replace the placeholders with public documentation you maintain, publish it at the appropriate path, and check that every link opens. Give an agent the file and a real question, then check whether it finds the right source. Update the guide when your documentation changes.
Walking through namefi.io/llms.txt
The file changes as Namefi's API and authentication options evolve. The table below is an abridged snapshot checked on 2026-07-14; agents should fetch the current live file before acting.
| Section (as it appears in the file) | What it says | Why it's shaped that way |
|---|---|---|
| H1 + blockquote | # Namefi API / > Namefi lets you register traditional domains as NFTs and manage their DNS records via API. | An H1 title followed by an optional summary, giving the reader an immediate orientation. |
| MCP pointer, inline in the summary | MCP server (every operation below as MCP tools): https://api.namefi.io/mcp — discovery descriptor at https://namefi.io/.well-known/mcp/servers.json | Puts the fastest path — a live protocol connection — ahead of the plain-text one, in the first three lines. |
## Base URLs | https://api.namefi.io/v-next/ | One line, no prose — an agent constructing raw HTTP calls needs exactly this. |
## Agent policy (mandatory) | Prefer MCP when the client can connect it; use REST or curl only when MCP is unavailable, installation fails, or the user explicitly requests raw HTTP | Keeps capable agents on the typed MCP path while preserving an explicit REST fallback. |
## MCP Server (for AI agents) | Connect to https://api.namefi.io/mcp; read-only tools need no authentication; use OAuth 2.1 + PKCE when no API key is available, or send an existing key in x-api-key | Documents both the browser-authorized OAuth path and the API-key path instead of assuming every agent already has a stored secret. |
## Authentication | API keys work through x-api-key; every /v-next endpoint also accepts an OAuth bearer token. The file documents device authorization for headless clients, authorization code + PKCE for redirect-capable apps, dynamic client registration, access-token lifetime, and rotating refresh tokens | Authentication is no longer API-key-only, and direct REST callers can use OAuth without MCP. |
## Buy a domain (MCP-first happy path) and REST fallback | Connect MCP, search, register, and poll with typed tools; if MCP is unavailable, use the documented three-step curl sequence | Separates the preferred tool path from the raw-HTTP fallback without removing either. |
## DNS Record Management | A table of eleven endpoints (GET/POST/PUT/DELETE on /v-next/dns/records, /v-next/dns/park, /v-next/dns/forwarding, etc.) with method, path, auth, and one-line description | Reference data — many similar endpoints — goes in a table rather than eleven paragraphs. |
| Troubleshooting note | "UNAUTHORIZED (401): Your API key is invalid, expired, or not associated with the domain owner's wallet… Record validation errors: Check that zoneName has no trailing dot, rdata for CNAME/MX/NS types has a trailing dot…" | Anticipates the failure modes an agent is most likely to hit first, as cause-and-fix rather than a generic status table. |
## Optional | Links to the TypeScript SDK docs, the @namefi/api-client npm package, a machine-readable OpenAPI 3 spec, the outbound-agent guide, and a GitHub repo of signer-neutral helper scripts | Secondary links by convention; v2 no longer assigns the heading mechanical exclusion behavior. |
The file closes by pointing to namefi.io/llms-full.txt, the same content inlined into one document, including the Web3 payment flows and outbound guide the root file only links to. That expansion is a Namefi publishing choice. The v2 proposal expects agents to follow relevant links and no longer specifies context-expansion tooling.
The companion files: web3 and MCP discovery
The root file links out to siblings for parts of the API that don't belong in a general-purpose entry point. namefi.io/web3/llms.txt documents payment paths a wallet-holding agent needs instead of an API key: an x402 flow where GET /x402/domain/{domainName} returns 402 Payment Required with pricing until a signed X-PAYMENT header is attached, an MPP (Machine Payable Protocol) challenge-response variant signed via the mppx CLI, and a manual EIP-712 signing path covering smart-contract wallets. The file states plainly that x402 registration needs "No Namefi account or EIP-712 signing required — the buyer's wallet signs an EIP-3009 transferWithAuthorization." An agent using the ordinary MCP, OAuth, or API-key path does not need to load that wallet-payment guide.
The MCP side has its own discovery file, separate from llms.txt entirely: namefi.io/.well-known/mcp/servers.json, a JSON descriptor rather than Markdown. This abridged snapshot was checked on 2026-07-14:
{
"servers": [
{
"name": "namefi-api",
"description": "Preferred interface for Namefi...",
"version": "next",
"transport": "streamable-http",
"url": "https://api.namefi.io/mcp",
"websiteUrl": "https://namefi.io",
"authentication": {
"type": "apiKey",
"in": "header",
"name": "x-api-key",
"description": "Read-only tools need no auth; prefer OAuth when no API key is available."
},
"oauth": {
"type": "oauth2",
"protectedResourceMetadata": "https://api.namefi.io/.well-known/oauth-protected-resource",
"authorizationServerMetadata": "https://api.namefi.io/.well-known/oauth-authorization-server",
"grantTypes": ["authorization_code", "refresh_token", "device_code"],
"codeChallengeMethods": ["S256"],
"dynamicClientRegistration": true
},
"documentation": "https://namefi.io/llms.txt"
}
]
}
That descriptor lives under .well-known/, the same convention /.well-known/security.txt uses for machine-discoverable metadata — a narrower, JSON-typed sibling to llms.txt's Markdown-prose approach. It advertises both API-key and OAuth discovery metadata, including PKCE and dynamic client registration, and its documentation field points back at llms.txt.
What's included, what's left out, and why
A few choices look deliberate. The mandatory agent policy and MCP setup come before the REST recipes, so a capable client discovers the typed tool interface first. Runnable curl examples remain as a fallback for clients that cannot connect MCP or for users who explicitly ask for raw HTTP. The root file links out rather than including everything, while llms-full.txt inlines the companion material. The ## Optional section links a full OpenAPI 3 spec alongside the Markdown, and wallet-based payment — x402, MPP, EIP-712 — stays in its own file.
llms.txt and MCP: discovery versus connection
It's worth being precise about what each piece does. llms.txt is a document — an agent fetches it once and knows what the API is and where the deeper resources live; it's inert text until something acts on what it says. MCP, in the protocol's own description, is "an open-source standard for connecting AI applications to external systems" — a protocol through which a compatible client discovers and invokes callable tools.
Namefi's file demonstrates the relationship directly: llms.txt tells an agent an MCP server exists at api.namefi.io/mcp and gives it the claude mcp add command to connect. Read the file, learn there's a live tool interface, connect, act. An agent that skips straight to MCP can still find the server through .well-known/mcp/servers.json — but that descriptor's documentation field points back at llms.txt, so the two rarely operate in true isolation.
Guidance for other API vendors
Publishing a working llms.txt doesn't require rebuilding your documentation:
- Front-load the H1, summary, and fastest connection method — a small-context agent may never read past the first few lines.
- Lead with the fastest supported connection, then show a runnable fallback. If you offer MCP, document the typed path first; preserve concrete HTTP examples for clients that cannot connect it.
- Split by size, not by team structure. A short root file plus a fuller expansion, and separate files for concerns like payments, keeps the common path short.
- Document actual failure modes, not just status codes — why a call returns 401 versus 403 matters more than the numbers.
- Use
## Optionalfor secondary links if useful, without relying on automatic exclusion. - Publish an MCP discovery descriptor alongside llms.txt if you run an MCP server — include current authentication and OAuth-discovery metadata, not only the server URL.
Frequently Asked Questions
What is llms.txt?
A proposed Markdown guide for agents, published at a site root or within a subpath. See the format and example above; v2 also explains how pages can advertise the guide that applies to them.
How is llms.txt different from robots.txt?
robots.txt governs cooperative crawling; llms.txt guides reading. A crawl restriction does not necessarily prevent indexing, and neither file replaces authentication.
Does llms.txt replace MCP?
No. llms.txt is a document an agent reads once to understand what an API does; MCP is a protocol a compatible client uses to discover and call tools. Namefi publishes both, and llms.txt is what tells an agent the MCP server exists in the first place.
What's in Namefi's llms.txt file?
The base URL, a mandatory MCP-first agent policy, MCP installation examples, API-key and OAuth authentication, a typed domain-registration path plus REST fallback, DNS and domain-configuration endpoints, troubleshooting, and an "Optional" section linking the SDK, OpenAPI spec, and companion files.
Can I read llms.txt myself, without an AI agent?
Yes — it's plain Markdown, legible to a person as well as a model. namefi.io/llms.txt reads like a terse API quick-reference; the same clarity that helps a human skim also helps a model parse it correctly.
Sources and further reading
- Jeremy Howard — The /llms.txt file, v2, “Proposal” and “Format” — fetched 2026-09-15.
- Jeremy Howard — v2 changes, discovery, path scope, and Optional semantics — fetched 2026-09-15.
- Google Search Central — Introduction to robots.txt, crawling versus indexing and access control — fetched 2026-09-15.
- robotstxt.org — About /robots.txt: "In a nutshell"
- modelcontextprotocol.io — What is the Model Context Protocol (MCP)?
- Namefi — namefi.io/llms.txt (primary source for every annotated excerpt in this article)
- Namefi — namefi.io/web3/llms.txt (x402, MPP, and EIP-712 wallet-payment flows)
- Namefi — namefi.io/.well-known/mcp/servers.json (MCP discovery descriptor)
- Namefi — namefi.io/llms-full.txt (single-file expansion inlining the Web3 and outbound companion files)
- IETF — RFC 8615, Well-Known Uniform Resource Identifiers (the
.well-known/convention)
Read the file yourself
The fastest way to understand llms.txt is to open one. namefi.io/llms.txt is public, unauthenticated, and short enough to read in the time it took to read this article — a concrete example to compare with the format above. For what the MCP tools behind it actually do, see Namefi MCP Server: Domain Tools for AI Agents; to connect from an editor, the MCP Quickstart; to watch an agent run the whole flow, How to Register a Domain with Your AI Agent on Namefi.
Contributors
Aileen Wright is a student in her twenties living in New York City, where the distance between a museum wall and a library reading room is a short walk and a long afternoon. She came to name writing through art and history — the way a single portrait, coin, or manuscript margin can carry a name across centuries and change its meaning on the way.
Most weeks you can find her in Central Park with a paperback, or in the quiet of a public reading room chasing down where a name actually comes from rather than what a name-list says it means. She is also teaching herself to code, which has made her oddly precise about spelling, sorting, and the small details that decide whether a name ages well.
For Namefi she writes about the history and culture behind domain names, the stories brands carry as they rename, and the difference between a good story and a verified source.
Victor Zhou is a technology founder and standards editor focused on digital identity and trust. He founded Namefi, edits Ethereum Improvement Proposals, and previously led smart-contract architecture work at Google Labs.
His work sits at the intersection of naming, ownership, and the systems people use to establish identity online. That perspective makes him especially interested in the way names move between personal meaning, public recognition, and digital infrastructure.
For Namefi, Victor edits and writes about domains as durable digital identity: how names become ownable onchain assets, how tokenization changes custody and trust, and what naming can learn from the systems people use to establish identity online.
Related guides
- MCP vs REST API vs CLI: Differences and When to Use EachCompare MCP, REST APIs, and CLIs for AI agents: tool discovery, context use, authentication, and the cases where each approach fits.
- What Is an Agent-Native Domain Registrar?Registrars have had APIs for decades, but an API alone isn't agent-native. The checklist: discovery, docs, errors, payment, and policy hooks.
- How AI Agents Buy Domains Without a Human (2026)In April 2026, domain registration moved into the agent layer. How AI agents search, price, and register domains — and the guardrails that still matter.
- "AI Domain Search" Means Two Different Things in 2026"AI domain search" can mean an assistant that suggests or an agent that buys. A two-column test to know which you need and where to get each.