nuxt-ai-ready
Covers nuxt-ai-ready v3 on Nuxt 4.6 or Nuxt 5.
The module converts rendered pages to Markdown with mdream and publishes llms.txt, llms-full.txt, and a .md twin per page. Config key: aiReady. Docs: https://nuxtseo.com/ai-ready
Setup
npx nuxt module add nuxt-ai-readyIncluded in @nuxtjs/seo v6: configure aiReady, do not add the module again. Nuxt SEO keeps AI Ready's defaults: database off, no drizzle-orm needed.
The package loads @nuxtjs/robots and @nuxtjs/sitemap; configure them with the robots and sitemap keys.
Set site.url: canonical URLs, Link headers, and /.well-known/ai-catalog.json use it.
Prerender the pages you want in llms-full.txt and the page index (nuxt generate, or nitro.prerender.routes). A page visit indexes nothing.
Automatic behaviour
With no aiReady config:
/llms.txt: site summary and sitemap pages. Large lists split under/llms/./llms-full.txt: full Markdown of each prerendered page.- A
.mdtwin per page:/aboutbecomes/about.md. Paths under/apiand/_get none. - Accept negotiation: a request that prefers
text/markdowngets a307to the.mdURL andVary: Accept.botNegotiation: trueextends this to AI bot user agents. <link rel="alternate" type="text/markdown">anddescribedbylinks, plus matchingLinkheaders./sitemap.mdand a## Sitemapfooter on generated.mdpages;sitemapMd: falseremoves both.- Nuxt Content v3
pagecollections: the.mdroute serves source Markdown;contentSource: falseconverts HTML. - Agent skills in
public/skills/<name>/SKILL.mdpublish at/.well-known/agent-skills/and inllms.txt;agentSkills: falsedisables. Content-Signal: search=yes, ai-input=yesinrobots.txt;contentSignal: falseremoves it.- Off by default: MCP, WebMCP, runtime sync, cron, and the database.
Common tasks
Add llms.txt sections and notes; notes renders before the first heading:
export default defineNuxtConfig({
aiReady: {
llmsTxt: {
sections: [{ title: 'Skills', sitemap: 'skills', path: '/llms/skills.txt' }],
notes: 'Built with Nuxt AI Ready',
},
},
})Every generated file stays within llmsTxt.maxLength (default 80,000); empty sections produce no link or file.
For application-owned discovery, place public/llms.txt (preserved as is) or set llmsTxt: false.
Rewrite the Markdown of every response with the Nitro hook (runtime .md, prerendered .md, llms-full.txt, indexed pages):
// server/plugins/markdown.ts
export default defineNitroPlugin((nitroApp) => {
nitroApp.hooks.hook('ai-ready:page:markdown', (ctx) => {
ctx.markdown += '\n\nSee /support.'
})
})Drop an element from every conversion with mdreamOptions, e.g. aiReady: { mdreamOptions: { filter: { exclude: ['.author-bio'] } } }; the minimal and clean defaults stay on.
Content Signals: a contentSignal object states the whole policy, so an omitted permission renders as no:
export default defineNuxtConfig({ aiReady: { contentSignal: { search: true, aiInput: true, aiTrain: false } } })
// robots.txt: Content-Signal: ai-train=no, search=yes, ai-input=yesMCP: install @nuxtjs/mcp-toolkit, add it to modules; it registers list_pages, search_pages, and get_page_markdown at /mcp. WebMCP: set webmcp: true for the same tools in the browser plus the useWebMcpTool() composable. Both need the database, so run npx nypm add drizzle-orm@1.0.0-rc.4. nuxt generate output cannot host MCP.
Runtime indexing, database drivers, Cloudflare D1, and the query helpers: see references/runtime-indexing.md.
Traps
- Discovery is not authorization. Selected sitemaps exclude stale rows from
llms.txt; they do not delete stored content or protect other APIs. - Custom route policies must allow Markdown twins. If middleware rejects
/skills/planning.md, allow it whenever/skills/planningis allowed. - The same hook name exists twice.
ai-ready:page:markdownis a Nuxt hook (prerender only) and a Nitro hook (every conversion) with different context; an edit in both applies twice. The Nitroctx.eventis undefined outside a request. - Content source pages skip conversion hooks and ignore
mdreamOptions. - Dev has no page data. Query helpers, MCP tools, and search return empty results in
nuxt dev. Test withnuxt buildandnode .output/server/index.mjs. - Cloudflare static pages negotiate only with
contentNegotiation: true. It moves prerendered pages intoassets.run_worker_first: exact paths up to Cloudflare's 100 entries, then globs such as/docs/*. Over 100 top-level pages fail the build. - Response caching turns negotiation off. An ISR,
swr, orcacheroute rule withoutvaries: ['accept']serves HTML to Markdown clients; withbotNegotiation: truethe rule needsvaries: ['accept', 'sec-fetch-dest', 'user-agent']. The.mdURL still works. - Emptying
ctx.markdowndoes not hide a page. It drops the body fromllms-full.txt; the URL stays inllms.txtand the index. Usesitemap.excludeand access control. - Root
skills/folders stay private. Discovery scans public directories only;agentSkills.dir: 'skills'publishes them. database: falseconflicts withruntimeSyncandcron; the build fails and names the option. A database feature withoutdrizzle-orm1.x fails too. If MCP Toolkit serves only your own tools, setdatabase: false.
Version limits
- v3 requires Nuxt
^4.6.0 || ^5.0.0; upgrade Nuxt before the module. It needs@nuxtjs/robotsv7,@nuxtjs/sitemapv9, andnuxt-site-configv5. - v3 does not install
drizzle-orm. Database features neednpx nypm add drizzle-orm@1.0.0-rc.4. SQLite usesnode:sqlite; remove leftoverbetter-sqlite3. - v3 negotiates on
Acceptonly; setbotNegotiation: trueto serve Markdown to AI bot user agents. - v3 exports typed entries: server functions from
#ai-ready/server, app functions from#ai-ready/app. - v2 removed IndexNow. Submit URLs from the
ai-ready:page:indexedNitro hook. - v1 renamed options. Do not write the old form:
| Old | New |
|---|---|
mdreamOptions: { preset: 'minimal' } |
mdreamOptions: { minimal: true } |
cacheMaxAgeSeconds |
llmsTxtCacheSeconds |
Nitro hook ai-ready:markdown |
ai-ready:page:markdown |
?secret=TOKEN on /__ai-ready/* |
Authorization: Bearer TOKEN header |
Config
llmsTxt(object): generated discovery. Setfalsefor application-owned server routes; a publicllms.txtdisables generation.llmsTxt.pages('sitemap'):'all'includes stored pages outside the sitemap.llmsTxt.markdownLinks(true): link page entries to.mdtwins instead of canonical URLs.autoI18n(true): with@nuxtjs/i18n, adds hreflangLinkheaders and a languages section inllms.txt.- Other options: https://nuxtseo.com/docs/ai-ready/api/config
Debug
For example, a deployed page with negotiation enabled:
curl -s -H 'Accept: text/markdown' -D - -o /dev/null https://mysite.com/about
HTTP/1.1 307 Temporary Redirect
location: /about.md
vary: acceptA 200 means a cache rule turned negotiation off. /__ai-ready__/debug.json exists in dev, or with debug: true. Nuxt DevTools has an AI Ready tab (needs nuxtseo-devtools-host).