npm @contentrain/mcpstreamable-httpMITupdated 8d ago
Extract, govern, and ship structured content from your codebase.
Contentrain 能做什么?
Contentrain AI
Website · Docs · Discord · Twitter · LinkedIn
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
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, review branches, and a local UI — no account, no cloud, no proprietary content format.
Start here:
What Contentrain is for
- 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
What it is not
- Not an AI writing app
- Not a database-first or dashboard-first CMS replacement for every team
- Not a proprietary content runtime that locks your app to one platform
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.
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.
How it works
┌─────────────┐ ┌──────────────────┐ ┌──────────────┐
│ AI Agent │────▶│ MCP (27 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
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.
Why teams use it
- 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
- MCP engine — 27 tools (22 core + 5 media) over stdio or HTTP transport, works with Claude Code, Cursor, Windsurf, or any MCP client
- 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.
- 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
Agent Skills
This repo ships 15 Agent Skills — reusable workflow procedures that any AI coding agent can load on demand.
Install all skills to your agent:
npx skills add Contentrain/ai/packages/skills
Or install a specific skill:
npx skills add Contentrain/ai/packages/skills --skill contentrain-normalize
Skills work with Claude Code, Cursor, Windsurf, GitHub Copilot, OpenAI Codex, Gemini CLI, and 40+ other agents.
See AGENTS.md for the full skill catalog and agent guidance.
Packages
| Package | npm | Role |
|---|---|---|
@contentrain/mcp |
26 MCP tools + stdio / HTTP transport + Local / GitHub / GitLab providers | |
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 |
Starter Templates
Production-ready templates with Contentrain content models, generated SDK client, and framework-specific patterns:
| Template | Framework | Use Case |
|---|---|---|
| astro-blog | Astro | Blog / editorial |
| astro-landing | Astro | Landing page |
| next-commerce | Next.js | E-commerce storytelling |
| next-multi-surface-saas | Next.js | Marketing + app + docs unified |
| next-saas-dashboard | Next.js | SaaS dashboard UI copy |
| next-white-label-portal | Next.js | White-label / multi-tenant |
| nuxt-admin-console | Nuxt | Admin console / operations |
| nuxt-saas | Nuxt | SaaS marketing site |
| sveltekit-editorial | SvelteKit | Editorial / publication |
| vitepress-docs | VitePress | Documentation site |
Each template is a GitHub template repo — click "Use this template" to start.
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
npx contentrain reconcile # merge a diverged base branch, content-aware
npx contentrain studio login # authenticate with Studio
npx contentrain studio connect # connect repo to Studio project
Documentation
- 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
- Ecosystem Map — package-to-product bridges across AI and Studio
- Contentrain Studio — open-core team operations for Git-native structured content, self-hostable or available as managed plans (Starter/Pro/Enterprise)
- Full Docs — guides, package reference, and framework integration
Development
pnpm install && pnpm build && pnpm test
See RELEASING.md for the versioning and publish workflow.
Community
- Discord — chat with the team and community
- GitHub Discussions — questions and ideas
- Twitter / X — product updates and announcements
- LinkedIn — company news
- YouTube — tutorials and demos
- GitHub Issues — bug reports and feature requests
If Contentrain AI is useful to you, consider giving it a star — it helps others discover the project.
License
MIT
安装
把 Contentrain 添加到你的客户端。选择你正在使用的那个。
{
"servers": {
"mcp": {
"type": "http",
"url": "https://studio.contentrain.io/api/mcp/v1/{project_id}/mcp"
}
}
}Add to `.vscode/mcp.json` in your workspace.
claude mcp add mcp -- npx -y @contentrain/mcpcodex mcp add mcp -- npx -y @contentrain/mcpamp mcp add mcp -- npx -y @contentrain/mcp{
"mcpServers": {
"mcp": {
"command": "npx",
"args": [
"-y",
"@contentrain/mcp"
]
}
}
}Add to `claude_desktop_config.json`, then restart Claude Desktop.
{
"mcpServers": {
"mcp": {
"command": "npx",
"args": [
"-y",
"@contentrain/mcp"
]
}
}
}Add to `~/.cursor/mcp.json`, or `.cursor/mcp.json` for a single project.
{
"mcpServers": {
"mcp": {
"command": "npx",
"args": [
"-y",
"@contentrain/mcp"
]
}
}
}Add to `~/.codeium/windsurf/mcp_config.json`.
{
"mcpServers": {
"mcp": {
"command": "npx",
"args": [
"-y",
"@contentrain/mcp"
]
}
}
}Add to `cline_mcp_settings.json` via the MCP Servers panel.
{
"mcpServers": {
"mcp": {
"command": "npx",
"args": [
"-y",
"@contentrain/mcp"
]
}
}
}Add to `~/.gemini/settings.json`.
{
"mcpServers": {
"mcp": {
"type": "local",
"command": "npx",
"args": [
"-y",
"@contentrain/mcp"
],
"tools": [
"*"
]
}
}
}Add to `~/.copilot/mcp-config.json`, or run `/mcp add` inside the CLI.
{
"context_servers": {
"mcp": {
"command": {
"path": "npx",
"args": [
"-y",
"@contentrain/mcp"
]
}
}
}
}Add to your Zed `settings.json`.
npx -y @contentrain/mcpRun `goose configure`, choose **Add Extension → Command-line Extension**, and paste this command.
评分
39 / 100
不完整
- 文档25/25
- 维护25/25
- 可信度16/20
- 能力0/15
- 安装体验15/15
- Documents what it does and how to connect
- Has a resolvable package or endpoint
- Exposes at least one tool, prompt or resource
- README has substantive content
- Includes a code example
- Documents its configuration
- Mentions credentials or security posture
- Last commit 0 days ago
- Has a release history
- Repository is not archived
- Licensed MIT
- Namespace verified in the official MCP registry
- Claimed by its owner
- Published under an organisation
- 0 tool(s) documented
- Provides prompt templates
- Provides resources
- 18 documented install method(s)
- Published to a package registry
- Offers a hosted endpoint — no local install
版本历史
| 版本 | 发布于 |
|---|---|
| 3.1.6最新 | 2026年8月31日 |
| 3.1.4 | 2026年8月25日 |
| 3.1.3 | 2026年8月24日 |
| 3.1.1 | 2026年8月24日 |
| 3.1.0 | 2026年8月15日 |
| 3.0.3 | 2026年8月13日 |
| 3.0.2 | 2026年8月13日 |
| 2.3.1 | 2026年7月29日 |
| 2.3.0 | 2026年7月27日 |
| 2.2.0 | 2026年7月27日 |
| 2.1.1 | 2026年7月17日 |
| 2.1.0 | 2026年7月17日 |
| 2.0.1 | 2026年7月16日 |
| 2.0.0 | 2026年7月16日 |
| 1.11.0 | 2026年7月15日 |
| 1.10.1 | 2026年7月13日 |
| 1.10.0 | 2026年7月13日 |
| 1.8.1 | 2026年7月9日 |
| 1.8.0 | 2026年7月9日 |
| 1.6.0 | 2026年6月24日 |
| 1.4.0 | 2026年4月18日 |
| 1.3.0 | 2026年4月18日 |
| 1.2.1 | 2026年4月16日 |
| 1.2.0 | 2026年4月14日 |
| 1.1.2 | 2026年4月10日 |
| 1.1.1 | 2026年4月10日 |
| 1.1.0 | 2026年3月29日 |
| 1.0.7 | 2026年3月25日 |
| 1.0.6 | 2026年3月21日 |