Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Demo project for delivering markdown to agents and HTML to humans.
Markdown to agents, HTML to humans is a Next.js demo project that shows how to serve the same documentation URL as raw markdown to AI agents and as rendered HTML to humans using the HTTP Accept header for content negotiation.
It is a minimal open-source demo that implements content negotiation in a Next.js app. The project takes a single URL such as /docs/getting-started and selects a markdown response when the incoming request's Accept header contains text/markdown; otherwise it returns HTML. The project is built with Next.js and TypeScript, uses a rewrite inside next.config.ts, and is deployed at markdown-to-agents.vercel.app. The repository has 26 stars.
has condition to inspect the accept header and match text/markdown.beforeFiles array lets the markdown route take precedence over normal rendering./docs/:slug path, with no separate endpoint.Accept: text/markdown and Accept: text/html responses.next.config.ts, so it benefits from type checking.Accept: text/markdown to get the documentation as markdown for context./docs/:slug when the accept header contains text/markdown and rewrites them to /markdown/:slug.