next-md-negotiate

Documentation

Add content negotiation to your Next.js app. Serve markdown to LLMs and HTML to humans from the same URL.


How it works — short version

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)