Contentrain — Claude Code MCP server: what it does, how to install
Enables Git-backed content governance for AI agents through 27 MCP tools. Keeps schemas consistent and isolates content writes from your active working tree.
claude mcp add --transport http contentrain https://studio.contentrain.io/api/mcp/remoteWhat Contentrain does
Contentrain creates a .contentrain/ directory to store models and structured data. When an agent writes content, the server routes changes into temporary Git worktrees on isolated feature branches. Your active working tree remains untouched. Updates merge back into the contentrain branch or pause for manual team review.
The package delivers 27 tools: 22 core utilities and 5 media endpoints. It handles schema definitions, content entries, scaffolding, and validation auto-fixes. A built-in doctor tool checks project health. On remote providers without local files, the server restricts its exposed tools to safe remote actions.
Local execution requires Node.js 22+ and Git. Without them, the server cannot start. If your codebase uses Astro, Svelte, or Vue, installing optional parsers such as @astrojs/compiler, svelte, or @vue/compiler-sfc enhances source scanner accuracy.
What it helps with
- isolate AI content writes in separate Git worktrees
- validate structured content against schemas with auto-fixes
- scaffold starting content templates for blogs or SaaS sites
- diagnose repository health, orphans, and branch divergence
Example prompts for the agent
- Initialize Contentrain in this repository and create a blog post model
- Run project validation and automatically fix any schema mismatches
- Check project health and active content branches with
contentrain_doctor
How to install Contentrain
1Platform CLI: remote server
claude mcp add --transport http contentrain https://studio.contentrain.io/api/mcp/remote2Platform CLI
claude mcp add mcp -- npx -y @contentrain/mcp1Platform CLI: remote server
codex mcp add mcp --url https://studio.contentrain.io/api/mcp/remote2Platform CLI
codex mcp add mcp -- npx -y @contentrain/mcpConfig file
{
"mcpServers": {
"mcp": {
"url": "https://studio.contentrain.io/api/mcp/remote"
}
}
}{
"mcpServers": {
"mcp": {
"command": "npx",
"args": [
"-y",
"@contentrain/mcp"
]
}
}
}Config file
{
"servers": {
"mcp": {
"type": "http",
"url": "https://studio.contentrain.io/api/mcp/remote"
}
}
}{
"servers": {
"mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@contentrain/mcp"
]
}
}
}1Platform CLI: remote server
gemini mcp add -t http mcp https://studio.contentrain.io/api/mcp/remote2Platform CLI
gemini mcp add mcp npx -y @contentrain/mcpStep by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Contentrain
How to install Contentrain in Claude Code?
Run claude mcp add mcp -- npx -y @contentrain/mcp for the local stdio server. If you prefer the hosted remote version, use claude mcp add --transport http contentrain https://studio.contentrain.io/api/mcp/remote.
What does Contentrain do?
It gives AI assistants 27 tools to manage structured content inside Git. Every modification runs on isolated Git branches and worktrees, keeping your main development tree clean while validating data schemas.
What are the requirements for running Contentrain locally?
You must have Node.js 22 or higher and Git installed on your system. Optional packages such as svelte, @astrojs/compiler, or @vue/compiler-sfc can also be added for improved source scanning.