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.

[Install integration](#install)[View this page as Markdown ↗](/astro-markdown-for-agents/index.md)

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()]
});
```

Markdown routes ready`/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 `Vary` headers

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.

HTML input`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>
```

Markdown output`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 anywhere
```

[Open full demo](/astro-markdown-for-agents/demo/)[Inspect generated Markdown →](/astro-markdown-for-agents/index.md)

Start in one command

## Make your Astro site readable by agents.

Then choose runtime negotiation, static files, or both.

`pnpm add @puralex/astro-markdown-for-agents`[npm ↗](https://www.npmjs.com/package/@puralex/astro-markdown-for-agents)

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.

[Core guide

### Markdown for Agents with Astro

Install, configure, test, and deploy runtime negotiation.

**Read guide →**](/astro-markdown-for-agents/guides/astro-markdown-for-agents/)[Cloudflare

### Cloudflare Free Plan Setup

Use SSR middleware or generated Markdown without upgrading.

**Read guide →**](/astro-markdown-for-agents/guides/cloudflare-free-plan/)[Discovery

### Generate llms.txt in Astro

Publish a machine-readable map alongside Markdown pages.

**Read guide →**](/astro-markdown-for-agents/guides/astro-llms-txt/)[Documentation

### Astro Starlight + text/markdown

Make documentation cheaper and cleaner for coding agents.

**Read guide →**](/astro-markdown-for-agents/guides/starlight-text-markdown/)

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.

[Apply with your site](https://github.com/magnifito/astro-markdown-for-agents/issues/new?template=pilot.yml)[Star on GitHub](https://github.com/magnifito/astro-markdown-for-agents)