Governed content for Astro
Your team and your AI agents work on Astro content inside the same rules. Agents edit through MCP, editors review in Studio, and Astro loads the result into content collections. Coming from WordPress, a free plugin exports your content layer.
$ npx contentrain init
✓ Detected stack: astro
✓ Created .contentrain/
✓ MCP server configured for your IDE
→ Git is now your content source of truth
AI agents
Agents edit content inside your rules
Coding agents create and change content through the Contentrain MCP tools. Your models and validation bound what they can write, and every change arrives as a reviewable diff.
- MCP tools for Claude Code, Cursor, and other agents
- Validation against your models
- Shared rules every agent on the repo follows
$ contentrain serve --mcpHttp
◇ MCP server ready on :4000/mcp
19 deterministic tools registered
contentrain_content_save
contentrain_validate
contentrain_scan
contentrain_merge
# agent proposes · tools enforce · git reviews
Studio
Editors review in Studio
Studio is the team operating surface for governed content: structured forms, media, roles, and review over the same files your agents work on. Changes can go through a review branch before they reach your site.
- Structured editing for every model
- Review before content reaches main
- Self-host the AGPL core or use the managed service
.contentrain/content/marketing/hero/en.json
"title": "Govern content your AI ships",
-"cta": "Sign up",
+"cta": "Start free trial",
+"badge": "New",
"locale": "en"
Reviewed by @editor · approved
Content collections
Astro loads the content into collections
@contentrain/query/astro exports contentrainLoader(), a content layer loader. Point a collection at a model and pages read it with getCollection() and getEntry(); Markdown documents render with <Content />. Prefer imports? contentrain generate writes a typed client you can query in frontmatter.
- Works with defineCollection({ loader }) from Astro 5
- Typed client for frontmatter and getStaticPaths()
- Read at build time, no content API to call
import { defineCollection } from 'astro:content'
import { contentrainLoader } from '@contentrain/query/astro'
export const collections = {
posts: defineCollection({
loader: contentrainLoader({ model: 'blog-post', locale: 'en' }),
}),
}
# pages: getCollection('posts')
Audit
Every change is a commit
Content lives as JSON and Markdown in your repository. Whether a person saved it in Studio or an agent wrote it through MCP, the change is a Git commit you can diff, review, and roll back. Because Contentrain is Git-native, your host rebuilds the Astro site the way it does for any other commit.
- A diff for every content change
- History and rollback from Git
- Your host's normal build and deploy
Git is the source of truth
Content lives in your repo as plain JSON and Markdown — every change is a commit, branch, and reviewable diff.
From WordPress
Coming from WordPress
Contentrain Bridge is a free WordPress plugin under GPL-2.0-or-later. It exports posts, pages, custom fields, and interface text as a validated Contentrain store, as a ZIP or to a branch in your own GitHub repository. To move the whole site, with layouts as Astro components and old URLs kept or redirected, Contentrain Migrate does it as a paid service.
- Free, open-source export plugin
- Content lands in your repository, ready for Astro
- Full-site move to Astro with Migrate
# free WordPress plugin, GPL-2.0-or-later
✓ Posts and pages
✓ Custom fields as real collections
✓ Interface text
✓ Local media copied into media/
→ ZIP, or a branch in your own GitHub repo
Starters
Start from an Astro starter
The Astro blog and landing starters ship with content models, seed content, and the generated client wired in, so a new site starts with structured content instead of hard-coded copy.
- Astro blog starter
- Astro landing page starter
- MIT-licensed, ready for Studio
$ npx contentrain init
✓ Detected stack: astro
✓ Created .contentrain/
✓ MCP server configured for your IDE
→ Git is now your content source of truth
Common questions
Does Contentrain need a server or database for Astro?
No. Content is JSON and Markdown in your repository and Astro reads it at build time. Studio is optional, for editors and review; self-host the AGPL core or use the managed service.
Which Astro versions does the loader support?
contentrainLoader() uses the content layer API introduced in Astro 5. The generated query client is plain TypeScript and works in any Astro page frontmatter.
Can I bring my WordPress content?
Yes. The free Contentrain Bridge plugin exports posts, pages, custom fields, and interface text as a Contentrain store. Contentrain Migrate moves the whole site to an Astro project as a paid service.
Next paths
Continue through the content system
Start local. Scale to Studio.
Build a governed content layer before content becomes product debt.
Start locally with the MIT packages. Add Studio when teams need review, roles, structured editing, managed delivery, or deployment control.