@42a/ael-astro
v0.1.1
Published
Astro integration for the 42a Agentic Enablement Layer: markdown page variants, llms.txt and an MCP server for your site with one integrations entry.
Readme
@42a/ael-astro
Astro integration for the 42a Agentic Enablement Layer: markdown page variants, llms.txt, and an on-site MCP server with one integrations entry.
Requires Astro ≥ 4.
Install
npm install @42a/ael @42a/ael-astro// astro.config.mjs
import ael from "@42a/ael-astro";
import { defineConfig } from "astro/config";
export default defineConfig({
site: "https://example.com", // required — AEL uses it as the canonical origin
integrations: [ael()],
});Content collections (recommended)
Collections are served verbatim — the markdown source of each entry, no HTML round-trip:
ael({
collections: [{ name: "blog", base: "/blog" }],
})Everything else falls back to the self-render provider (sitemap + rendered HTML).
Static vs SSR
| Feature | Fully static (no adapter) | SSR / static + adapter |
|---|---|---|
| llms.txt, llms-full.txt | ✅ generated at build | ✅ live |
| <path>.md page variants | ✅ generated at build from the rendered HTML | ✅ live (?format=markdown + Accept too) |
| MCP endpoint + /.well-known discovery | ❌ needs a server | ✅ |
On static builds the integration writes .md files next to every page in dist/ at astro:build:done and links them with .md URLs in llms.txt (static hosts don't route query strings). To get the MCP server, add any SSR adapter (@astrojs/node, @astrojs/vercel, @astrojs/netlify).
Verify with:
npx @42a/ael doctor https://example.comConnect to 42a (optional)
npx @42a/ael connectMints a site token; add it as the FORTYTWOA_SITE_TOKEN environment variable and redeploy. Domain verification happens automatically via /.well-known/42a.json (SSR only).
Options
ael({ siteUrl?, siteName?, description?, language?, collections?, markdown?, llms?, mcp?, telemetry?, ssr? }) — all JSON-serializable (they cross the build/runtime boundary). For custom providers or MCP tools, mount createAel from @42a/ael in your own routes instead.
