Extract, govern, and ship structured content from your codebase.
Contentrain helps teams turn hardcoded UI text, docs, and structured content into a governed, reviewable content layer. Agents can extract, create, translate, and update content, while Contentrain enforces schema, Git review, and portable file output.
Agent extracts or updates content → Contentrain standardizes → Human reviews → Any platform consumes
npx contentrain init # create .contentrain/ workspace
npx contentrain serve # open the local review UIThat's it. You now have a governed content workspace with models, validation, review branches, and a local UI — no account, no cloud, no proprietary content format.
Start here:
- Rescuing hardcoded strings from existing apps and turning them into structured, translatable content
- Starting new projects with a real content layer instead of scattering copy across components
- Serving the same content across web, docs, mobile, and backend systems from plain JSON and Markdown in Git
- Not an AI writing app
- Not a hosted headless CMS replacement for every team
- Not a proprietary content runtime that locks your app to one platform
Before: Hardcoded strings scattered across your codebase — no structure, no translations, no review.
export default function Hero() {
return (
<section>
<h1>Welcome to our platform</h1>
<p>Start your free trial today</p>
<button>Get Started</button>
</section>
)
}After: Content lives in .contentrain/, typed and structured. Source files use i18n keys.
export default function Hero() {
const t = useTranslations()
return (
<section>
<h1>{t('hero.title')}</h1>
<p>{t('hero.subtitle')}</p>
<button>{t('hero.cta')}</button>
</section>
)
}// .contentrain/content/marketing/hero/en.json
{
"cta": "Get Started",
"subtitle": "Start your free trial today",
"title": "Welcome to our platform"
}The normalize flow extracts strings, creates models, and patches your source files — all through reviewable git branches.
This is the strongest entry point into the product:
take the content chaos already in your codebase and turn it into a governed, reviewable content layer.
┌─────────────┐ ┌──────────────────┐ ┌──────────────┐
│ AI Agent │────▶│ MCP (15 tools) │────▶│ .contentrain/│
│ (decides) │ │ (enforces) │ │ (stores) │
└─────────────┘ └──────────────────┘ └──────┬───────┘
│
┌──────────────────┐ │
│ Review UI / Git │◀─────────────┘
│ (human approves)│
└──────────────────┘
- Agent decides what content should exist and where it should come from
- Contentrain enforces schemas, validation, canonical serialization, and git workflow
- Human reviews through branches, PRs, or the local Serve UI
- Output is plain JSON + Markdown that any language or framework can consume
| Kind | What it stores | Storage | Example |
|---|---|---|---|
| Collection | Multiple typed entries | JSON object-map | Blog posts, products, team |
| Singleton | Single entry per locale | JSON object | Hero section, site config |
| Document | Markdown + frontmatter | .md files |
Docs, articles, changelog |
| Dictionary | Flat key-value strings | JSON flat map | i18n translations, UI labels |
27 field types (string, email, url, image, relation, array, object, markdown, ...) with built-in validation.
Content is plain JSON and Markdown. Any language reads it directly.
For TypeScript projects, generate a typed SDK:
npx contentrain generateimport { query, singleton, dictionary, document } from '#contentrain'
const hero = singleton('hero').locale('en').get()
const posts = query('blog-post').locale('en').include('author').all()
const labels = dictionary('ui-labels').locale('tr').get('auth.login')
const article = document('docs').locale('en').bySlug('getting-started')Works with Nuxt, Next.js, Astro, SvelteKit, Vue, React, Node, Go, Python, Swift, Flutter, and 20+ stacks.
- Git-native — every write goes through worktree isolation + review branches
- Normalize flow — scan codebase for hardcoded strings → extract → create i18n-ready content → patch source files
- Local-first MCP — 15 tools, stdio transport, works with Claude Code, Cursor, Windsurf, or any MCP client
- Canonical serialization — sorted keys, deterministic output, clean git diffs, conflict-free parallel edits
- Agent rules & skills — behavioral policies and step-by-step workflows ship as npm packages
- Serve UI — local web dashboard for browsing models, content, validation, and normalize status
- Framework-agnostic — MCP doesn't know your framework. Agent + skills handle stack-specific logic
| Package | npm | Role |
|---|---|---|
@contentrain/mcp |
15 MCP tools — content operations engine | |
contentrain |
CLI + Serve UI + MCP stdio entrypoint | |
@contentrain/query |
Generated TypeScript query SDK | |
@contentrain/types |
Shared type definitions + constants | |
@contentrain/rules |
Agent quality rules for IDE integration | |
@contentrain/skills |
Workflow procedures + framework guides |
npx contentrain init # initialize project
npx contentrain serve # local review UI (port 3333)
npx contentrain serve --stdio # MCP over stdio for IDE agents
npx contentrain validate # check content health
npx contentrain generate # generate typed SDK client
npx contentrain status # project overview
npx contentrain doctor # setup health check- 2-Minute Demo — the fastest way to understand the product
- Getting Started — install, connect an agent, and run the first workflow
- Normalize Guide — the main hardcoded-string rescue flow
- Contentrain Studio — hosted team operations for Git-native structured content
- Full Docs — guides, package reference, and framework integration
pnpm install && pnpm build && pnpm testSee RELEASING.md for the versioning and publish workflow.
MIT