MCP server/ai-tools

Contentrain MCP Server

Local-first MCP server for AI content governance

★ 2Contentrain/ai ↗by Contentrainupdated
1

Add it to Claude Code

claude mcp add contentrain -- npx -y @contentrain/mcp
2

Make your agent remember this setup

contentrain's config, env vars, and the gotchas you hit — recalled in every future Claude Code, Cursor, and Codex session.

npx conare@latest

Free · one command · indexes the sessions already on disk. Set up in the browser instead →

What it does

  • Git-native workflow with worktree isolation and review branches
  • Normalize flow to extract hardcoded strings and create i18n-ready content
  • Canonical serialization for deterministic output and clean git diffs
  • Local web dashboard for browsing models, content, and validation status
  • Framework-agnostic content storage using plain JSON and Markdown

Tools 2

content_managementManage models, content, translations, and documentation with typed schemas.
normalize_flowScan codebase for hardcoded strings, extract them, and patch source files.

Try it

Initialize a new Contentrain workspace in my current project.
Scan my codebase for hardcoded strings and normalize them into i18n JSON files.
Create a new singleton model for my hero section with fields for title, subtitle, and cta.
Generate a typed SDK for my current content models.
Original README from Contentrain/ai

Contentrain AI

Your AI agent writes content. Contentrain makes sure it doesn't wreck your repo.

Contentrain gives AI agents a governed place to create models, content, translations, and docs — with typed schemas, git-backed review, and deterministic file output that any platform can consume.

Agent produces → System standardizes → Human approves → Any platform consumes

Try it in 30 seconds

npx contentrain init        # create .contentrain/ workspace
npx contentrain serve       # open the local review UI

That's it. You now have a governed content workspace with models, validation, and a local UI — no account, no cloud, no config files.

What it looks like

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>
      Start your free trial today
      <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>
      {t('hero.subtitle')}
      <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.

How it works

┌─────────────┐     ┌──────────────────┐     ┌──────────────┐
│  AI Agent    │────▶│  MCP (13 tools)  │────▶│ .contentrain/│
│  (decides)   │     │  (enforces)      │     │ (stores)     │
└─────────────┘     └──────────────────┘     └──────┬───────┘
                                                     │
                    ┌──────────────────┐              │
                    │  Review UI / Git │◀─────────────┘
                    │  (human approves)│
                    └──────────────────┘
  • Agent decides what content should exist
  • MCP enforces schemas, validation, canonical serialization, and git workflow
  • Human reviews through branches, PRs, or the local Serve UI
  • Output is plain JSON + Markdown — consumed by any language or framework

4 content kinds

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.

Use your content anywhere

Content is plain JSON and Markdown. Any language reads it directly.

For TypeScript projects, generate a typed SDK:

npx contentrain generate
import { 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.

Key features

  • 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 — 13 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

Packages

Package npm Role
`@contentrain/mcp` [![npm](https://img.shields.io/npm/

Frequently Asked Questions

What are the key features of Contentrain?

Git-native workflow with worktree isolation and review branches. Normalize flow to extract hardcoded strings and create i18n-ready content. Canonical serialization for deterministic output and clean git diffs. Local web dashboard for browsing models, content, and validation status. Framework-agnostic content storage using plain JSON and Markdown.

What can I use Contentrain for?

Managing i18n translations for multi-language web applications. Governing AI-generated content to ensure it follows project schemas. Standardizing hardcoded UI strings into structured, reviewable JSON files. Creating typed content models for blogs, documentation, and product catalogs.

How do I install Contentrain?

Install Contentrain by running: npx contentrain init

What MCP clients work with Contentrain?

Contentrain works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Conare · memory for coding agents

Turn this server into reusable context

Keep Contentrain docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Set up free$npx conare@latest