Add content negotiation to your Next.js app. Serve markdown to LLMs and HTML to humans from the same URL.
Install, initialize, and serve your first markdown route in under 2 minutes.
HTTP content negotiation, Accept headers, route patterns, and the request flow.
How content negotiation preserves crawl budget and avoids duplicate content.
md.config.ts, route patterns, handlers, integration strategies, and options.
Make markdown endpoints discoverable to AI agents with LlmHint.
Every function, component, type, and CLI command.
HTTP already supports content negotiation via the Accept header. When an agent requests a page with Accept: text/markdown, next-md-negotiate returns a markdown body instead of the HTML page.
The important part: no new URLs are created. One path serves both formats — no sitemap changes, no duplicate content, no wasted crawl budget.
// Same URL, different Accept, different response
GET /products/42
Accept: text/html → HTML page (~26 KB)
GET /products/42
Accept: text/markdown → Markdown (~101 B)