Europe/Warsaw
ProjectsFebruary 25, 2026

next-md-negotiate

Your Next.js app serves HTML. LLMs, crawlers, and AI agents want Markdown. Today you're stuck choosing between separate endpoints that duplicate your routing and go stale, or Markdown-only pages that break the browser experience for human visitors. The HTTP Accept header already solves this. A browser sends Accept: text/html. An LLM client sends Accept: text/markdown. Your server should respond accordingly - but Next.js has no built-in way to do this. next-md-negotiate intercepts requests that ask for Markdown, rewrites them to an internal API route, and returns the Markdown version you define - all transparently, from the same URL.
  • Browser sends GET /products/42 with Accept: text/html - gets your normal Next.js page
  • LLM agent sends GET /products/42 with Accept: text/markdown - gets your Markdown version
No new URLs. No duplicate routing. The client just sets an Accept header.
  • Zero-config content negotiation via standard HTTP Accept headers
  • Works with both App Router and Pages Router
  • Type-safe parameters inferred from route patterns
  • CLI scaffolding with npx next-md-negotiate init
  • Published as an npm package for easy integration
  • Next.js - App Router and Pages Router support
  • TypeScript - Fully typed API with route parameter inference
  • HTTP Content Negotiation - Standards-based approach using Accept headers

Related projects

CVForge

CV optimizer that tailors your resume to any job posting for maximum ATS compatibility.

Questioneer

A cutting-edge interview preparation app for aspiring software developers, leveraging AI to provide personalized feedback.

Newsletter Master

A SaaS app designed for managing newsletter subscriptions and sending mass emails with Stripe integration.

Peak Performance

A high-performance web app built with Next.js and Contentful for fitness training planning and exercise tracking.

Mokarico Caffe Clone

A Next.js 13 clone of the Mokarico coffee website, utilizing SSR and dynamic routes.