Open source · v0.3.0 · Astro 4–7
Markdown for Agents.
Built for Astro.
Serve clean Markdown at request time, generate static .md pages, and publish llms.txt—without requiring a paid Cloudflare plan.
Zero runtime dependencies. Normal browser responses stay unchanged.
astro.config.mjs
$ pnpm add @puralex/astro-markdown-for-agents
import markdownForAgents
from '@puralex/astro-markdown-for-agents';
export default defineConfig({
integrations: [markdownForAgents()]
});/llms.txt- 0 runtime dependencies
- 99 automated tests
- 51% smaller demo payload
- 4–7 Astro peer range
Two delivery modes
One integration. Static and server-rendered sites.
Delivery behavior stays explicit. Runtime sites negotiate by HTTP header. Static hosts expose generated Markdown files directly.
01 / Runtime
Content negotiation for SSR
Requests containing Accept: text/markdown receive converted Markdown. HTML, JSON, images, and browser traffic pass through.
curl -H "Accept: text/markdown" \
https://your-site.dev/docs- Cloudflare Workers
- Node, Vercel, Deno
- Correct
Varyheaders
02 / Static
Markdown files at build time
Every generated HTML page gets a matching .md file. The llms.txt index maps the full machine-readable site.
dist/
├── index.html
├── index.md
├── docs/index.md
└── llms.txt- GitHub Pages and static hosts
- No runtime function required
- Optional host rewrite for negotiation
Measured demo
Navigation noise out. Content structure in.
This output is generated during the documentation build by the same converter exported in the npm package.
368 bytes<nav><a href="/">Docs</a><a href="/pricing">Pricing</a></nav>
<main>
<h1>Deploy an Astro site</h1>
<p>Build fast, content-driven websites with clean output.</p>
<h2>Install</h2>
<pre><code>pnpm create astro@latest</code></pre>
<ul><li>Zero client JavaScript by default</li><li>Deploy anywhere</li></ul>
</main>
<footer>Copyright and navigation noise</footer>179 bytes# Deploy an Astro site
Build fast, content-driven websites with clean output.
## Install
```
pnpm create astro@latest
```
- Zero client JavaScript by default
- Deploy anywhereStart in one command
Make your Astro site readable by agents.
Then choose runtime negotiation, static files, or both.
pnpm add @puralex/astro-markdown-for-agentsnpm ↗Choose with evidence
How approaches compare.
| Capability | This integration | Cloudflare feature | DIY build script |
|---|---|---|---|
| Runtime negotiation | Yes, with SSR | Yes | Host-specific |
Static .md files | Yes | No | Yes |
llms.txt | Generated | Manual | Manual |
| Cloudflare Free | Yes | No | Yes |
| Runtime dependencies | None | Managed service | Varies |
| Astro-aware build | Yes | No | Usually not |
Cloudflare comparison reflects its published Pro, Business, and Enterprise availability.
Practical guides
Ship it on your stack.
Markdown for Agents with Astro
Install, configure, test, and deploy runtime negotiation.
Read guide →CloudflareCloudflare Free Plan Setup
Use SSR middleware or generated Markdown without upgrading.
Read guide →DiscoveryGenerate llms.txt in Astro
Publish a machine-readable map alongside Markdown pages.
Read guide →DocumentationAstro Starlight + text/markdown
Make documentation cheaper and cleaner for coding agents.
Read guide →Early adopter program
Running Astro docs in production?
We are recruiting the first ten public deployments. Get setup help, benchmark review, and a permanent link from this project.