Contentrain MCP
Local-first MCP server for AI content governance. 13 tools for model/content management, validation, normalization, and i18n across any framework.
README
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>
<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.
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 |
13 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 |
Quick reference
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
Documentation
ai.contentrain.io — full docs with guides, reference, and framework integration.
Development
pnpm install && pnpm build && pnpm test
See RELEASING.md for the versioning and publish workflow.
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。