{
  "markdown": "# Contentrain AI\n\n[![npm: @contentrain/mcp](https://img.shields.io/npm/v/%40contentrain%2Fmcp?label=%40contentrain%2Fmcp)](https://www.npmjs.com/package/@contentrain/mcp)\n[![npm: contentrain](https://img.shields.io/npm/v/contentrain?label=contentrain)](https://www.npmjs.com/package/contentrain)\n[![npm: @contentrain/query](https://img.shields.io/npm/v/%40contentrain%2Fquery?label=%40contentrain%2Fquery)](https://www.npmjs.com/package/@contentrain/query)\n[![Agent Skills](https://img.shields.io/badge/Agent_Skills-15_skills-8B5CF6)](https://agentskills.io)\n[![Docs](https://img.shields.io/badge/docs-ai.contentrain.io-0f172a)](https://ai.contentrain.io)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n\n[Website](https://contentrain.io) · [Docs](https://ai.contentrain.io) · [Discord](https://discord.gg/8XbFKfgeZx) · [Twitter](https://x.com/Contentrain_io) · [LinkedIn](https://www.linkedin.com/company/contentrain)\n\n**Extract, govern, and ship structured content from your codebase.**\n\nContentrain 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.\n\n```\nAgent extracts or updates content → Contentrain standardizes → Human reviews → Any platform consumes\n```\n\n## Try it in 30 seconds\n\n```bash\nnpx contentrain init        # create .contentrain/ workspace\nnpx contentrain serve       # open the local review UI\n```\n\nThat'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.\n\nStart here:\n\n- [See the 2-minute demo](https://ai.contentrain.io/demo)\n- [Open the normalize guide](https://ai.contentrain.io/guides/normalize)\n- [Read the docs](https://ai.contentrain.io)\n\n## What Contentrain is for\n\n- **Rescuing hardcoded strings** from existing apps and turning them into structured, translatable content\n- **Starting new projects with a real content layer** instead of scattering copy across components\n- **Serving the same content across web, docs, mobile, and backend systems** from plain JSON and Markdown in Git\n\n## What it is not\n\n- Not an AI writing app\n- Not a database-first or dashboard-first CMS replacement for every team\n- Not a proprietary content runtime that locks your app to one platform\n\n## What it looks like\n\n**Before:** Hardcoded strings scattered across your codebase — no structure, no translations, no review.\n\n```tsx\nexport default function Hero() {\n  return (\n    <section>\n      <h1>Welcome to our platform</h1>\n      <p>Start your free trial today</p>\n      <button>Get Started</button>\n    </section>\n  )\n}\n```\n\n**After:** Content lives in `.contentrain/`, typed and structured. Source files use i18n keys.\n\n```tsx\nexport default function Hero() {\n  const t = useTranslations()\n  return (\n    <section>\n      <h1>{t('hero.title')}</h1>\n      <p>{t('hero.subtitle')}</p>\n      <button>{t('hero.cta')}</button>\n    </section>\n  )\n}\n```\n\n```json\n// .contentrain/content/marketing/hero/en.json\n{\n  \"cta\": \"Get Started\",\n  \"subtitle\": \"Start your free trial today\",\n  \"title\": \"Welcome to our platform\"\n}\n```\n\nThe normalize flow extracts strings, creates models, and patches your source files — all through reviewable git branches.\n\nThis is the strongest entry point into the product:\n\n**take the content chaos already in your codebase and turn it into a governed, reviewable content layer.**\n\n## How it works\n\n```\n┌─────────────┐     ┌──────────────────┐     ┌──────────────┐\n│  AI Agent    │────▶│  MCP (27 tools)  │────▶│ .contentrain/│\n│  (decides)   │     │  (enforces)      │     │ (stores)     │\n└─────────────┘     └──────────────────┘     └──────┬───────┘\n                                                     │\n                    ┌──────────────────┐              │\n                    │  Review UI / Git │◀─────────────┘\n                    │  (human approves)│\n                    └──────────────────┘\n```\n\n- **Agent** decides what content should exist and where it should come from\n- **Contentrain** enforces schemas, validation, canonical serialization, and git workflow\n- **Human** reviews through branches, PRs, or the local Serve UI\n- **Output** is plain JSON + Markdown that any language or framework can consume\n\n## 4 content kinds\n\n| Kind | What it stores | Storage | Example |\n|---|---|---|---|\n| **Collection** | Multiple typed entries | JSON object-map | Blog posts, products, team |\n| **Singleton** | Single entry per locale | JSON object | Hero section, site config |\n| **Document** | Markdown + frontmatter | `.md` files | Docs, articles, changelog |\n| **Dictionary** | Flat key-value strings | JSON flat map | i18n translations, UI labels |\n\n27 field types (string, email, url, image, relation, array, object, markdown, ...) with built-in validation.\n\n## Use your content anywhere\n\nContent is plain JSON and Markdown. Any language reads it directly.\n\nFor TypeScript projects, generate a typed SDK:\n\n```bash\nnpx contentrain generate\n```\n\n```ts\nimport { query, singleton, dictionary, document } from '#contentrain'\n\nconst hero    = singleton('hero').locale('en').get()\nconst posts   = query('blog-post').locale('en').include('author').all()\nconst labels  = dictionary('ui-labels').locale('tr').get('auth.login')\nconst article = document('docs').locale('en').bySlug('getting-started')\n```\n\nWorks with Nuxt, Next.js, Astro, SvelteKit, Vue, React, Node, Go, Python, Swift, Flutter, and 20+ stacks.\n\n## Why teams use it\n\n- **Git-native** — every write goes through worktree isolation + review branches\n- **Normalize flow** — scan codebase for hardcoded strings → extract → create i18n-ready content → patch source files\n- **MCP engine** — 27 tools (22 core + 5 media) over stdio or HTTP transport, works with Claude Code, Cursor, Windsurf, or any MCP client\n- **Provider-agnostic engine** — the same tool surface runs over a local worktree, GitHub, or GitLab (self-hosted included) with zero tool-code changes. HTTP transport available for remote drivers such as Studio.\n- **Canonical serialization** — sorted keys, deterministic output, clean git diffs, conflict-free parallel edits\n- **Agent rules & skills** — behavioral policies and step-by-step workflows ship as npm packages\n- **Serve UI** — local web dashboard for browsing models, content, validation, and normalize status\n- **Framework-agnostic** — MCP doesn't know your framework. Agent + skills handle stack-specific logic\n\n## Agent Skills\n\nThis repo ships 15 [Agent Skills](https://agentskills.io) — reusable workflow procedures that any AI coding agent can load on demand.\n\nInstall all skills to your agent:\n\n```bash\nnpx skills add Contentrain/ai/packages/skills\n```\n\nOr install a specific skill:\n\n```bash\nnpx skills add Contentrain/ai/packages/skills --skill contentrain-normalize\n```\n\nSkills work with Claude Code, Cursor, Windsurf, GitHub Copilot, OpenAI Codex, Gemini CLI, and 40+ other agents.\n\nSee [`AGENTS.md`](AGENTS.md) for the full skill catalog and agent guidance.\n\n## Packages\n\n| Package | npm | Role |\n|---|---|---|\n| [`@contentrain/mcp`](packages/mcp) | [![npm](https://img.shields.io/npm/v/%40contentrain%2Fmcp)](https://www.npmjs.com/package/@contentrain/mcp) | 26 MCP tools + stdio / HTTP transport + Local / GitHub / GitLab providers |\n| [`contentrain`](packages/cli) | [![npm](https://img.shields.io/npm/v/contentrain)](https://www.npmjs.com/package/contentrain) | CLI + Serve UI + MCP stdio entrypoint |\n| [`@contentrain/query`](packages/sdk/js) | [![npm](https://img.shields.io/npm/v/%40contentrain%2Fquery)](https://www.npmjs.com/package/@contentrain/query) | Generated TypeScript query SDK |\n| [`@contentrain/types`](packages/types) | [![npm](https://img.shields.io/npm/v/%40contentrain%2Ftypes)](https://www.npmjs.com/package/@contentrain/types) | Shared type definitions + constants |\n| [`@contentrain/rules`](packages/rules) | [![npm](https://img.shields.io/npm/v/%40contentrain%2Frules)](https://www.npmjs.com/package/@contentrain/rules) | Agent quality rules for IDE integration |\n| [`@contentrain/skills`](packages/skills) | [![npm](https://img.shields.io/npm/v/%40contentrain%2Fskills)](https://www.npmjs.com/package/@contentrain/skills) | Workflow procedures + framework guides |\n\n## Starter Templates\n\nProduction-ready templates with Contentrain content models, generated SDK client, and framework-specific patterns:\n\n| Template | Framework | Use Case |\n|---|---|---|\n| [astro-blog](https://github.com/Contentrain/contentrain-starter-astro-blog) | Astro | Blog / editorial |\n| [astro-landing](https://github.com/Contentrain/contentrain-starter-astro-landing) | Astro | Landing page |\n| [next-commerce](https://github.com/Contentrain/contentrain-starter-next-commerce) | Next.js | E-commerce storytelling |\n| [next-multi-surface-saas](https://github.com/Contentrain/contentrain-starter-next-multi-surface-saas) | Next.js | Marketing + app + docs unified |\n| [next-saas-dashboard](https://github.com/Contentrain/contentrain-starter-next-saas-dashboard) | Next.js | SaaS dashboard UI copy |\n| [next-white-label-portal](https://github.com/Contentrain/contentrain-starter-next-white-label-portal) | Next.js | White-label / multi-tenant |\n| [nuxt-admin-console](https://github.com/Contentrain/contentrain-starter-nuxt-admin-console) | Nuxt | Admin console / operations |\n| [nuxt-saas](https://github.com/Contentrain/contentrain-starter-nuxt-saas) | Nuxt | SaaS marketing site |\n| [sveltekit-editorial](https://github.com/Contentrain/contentrain-starter-sveltekit-editorial) | SvelteKit | Editorial / publication |\n| [vitepress-docs](https://github.com/Contentrain/contentrain-starter-vitepress-docs) | VitePress | Documentation site |\n\nEach template is a GitHub template repo — click \"Use this template\" to start.\n\n## Quick reference\n\n```bash\nnpx contentrain init         # initialize project\nnpx contentrain serve        # local review UI (port 3333)\nnpx contentrain serve --stdio # MCP over stdio for IDE agents\nnpx contentrain validate     # check content health\nnpx contentrain generate     # generate typed SDK client\nnpx contentrain status       # project overview\nnpx contentrain doctor       # setup health check\nnpx contentrain reconcile    # merge a diverged base branch, content-aware\nnpx contentrain studio login   # authenticate with Studio\nnpx contentrain studio connect # connect repo to Studio project\n```\n\n## Documentation\n\n- **[2-Minute Demo](https://ai.contentrain.io/demo)** — the fastest way to understand the product\n- **[Getting Started](https://ai.contentrain.io/getting-started)** — install, connect an agent, and run the first workflow\n- **[Normalize Guide](https://ai.contentrain.io/guides/normalize)** — the main hardcoded-string rescue flow\n- **[Ecosystem Map](https://ai.contentrain.io/ecosystem)** — package-to-product bridges across AI and Studio\n- **[Contentrain Studio](https://ai.contentrain.io/studio)** — open-core team operations for Git-native structured content, self-hostable or available as managed plans (Starter/Pro/Enterprise)\n- **[Full Docs](https://ai.contentrain.io)** — guides, package reference, and framework integration\n\n## Development\n\n```bash\npnpm install && pnpm build && pnpm test\n```\n\nSee [`RELEASING.md`](RELEASING.md) for the versioning and publish workflow.\n\n## Community\n\n- [Discord](https://discord.gg/8XbFKfgeZx) — chat with the team and community\n- [GitHub Discussions](https://github.com/Contentrain/ai/discussions) — questions and ideas\n- [Twitter / X](https://x.com/Contentrain_io) — product updates and announcements\n- [LinkedIn](https://www.linkedin.com/company/contentrain) — company news\n- [YouTube](https://www.youtube.com/@contentrain) — tutorials and demos\n- [GitHub Issues](https://github.com/Contentrain/ai/issues) — bug reports and feature requests\n\nIf Contentrain AI is useful to you, consider giving it a star — it helps others discover the project.\n\n## License\n\nMIT\n",
  "bytes": 12004,
  "sha": "edee07529e5406e06811e8891767f39237a5afbfbd5b5a1226a1a41c1bd2f591",
  "repo_slug": "contentrain/ai",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_contentrain_contentrain_04e04b4d/readme"
}