# Contentrain

Enables Git-backed content governance for AI agents through 27 MCP tools. Keeps schemas consistent and isolates content writes from your active working tree.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 6
- Author: Contentrain
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/Contentrain/ai/tree/HEAD/packages/mcp
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/mcp/contentrain

## What it 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.

## Requirements
- Needs: Node.js (commands run via npx)
- Remote server: `https://studio.contentrain.io/api/mcp/remote`

## Install

### Claude Code (native platform)

1. **Platform CLI: remote server**
```bash
claude mcp add --transport http contentrain https://studio.contentrain.io/api/mcp/remote
```

2. **Platform CLI**
```bash
claude mcp add mcp -- npx -y @contentrain/mcp
```

### Codex

1. **Platform CLI: remote server**
```bash
codex mcp add mcp --url https://studio.contentrain.io/api/mcp/remote
```

2. **Platform CLI**
```bash
codex mcp add mcp -- npx -y @contentrain/mcp
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "mcp": {
            "url": "https://studio.contentrain.io/api/mcp/remote"
        }
    }
}
```
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "mcp": {
            "command": "npx",
            "args": [
                "-y",
                "@contentrain/mcp"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "mcp": {
            "type": "http",
            "url": "https://studio.contentrain.io/api/mcp/remote"
        }
    }
}
```
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "mcp": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@contentrain/mcp"
            ]
        }
    }
}
```

### Gemini CLI

1. **Platform CLI: remote server**
```bash
gemini mcp add -t http mcp https://studio.contentrain.io/api/mcp/remote
```

2. **Platform CLI**
```bash
gemini mcp add mcp npx -y @contentrain/mcp
```

## When to use it
- 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
- 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`

## Similar
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33989
- [GitDiagram](https://affpapa.org/en/nevibecode/mcp/gitdiagram.md) — MCP server · ★ 18511
- [Repowise](https://affpapa.org/en/nevibecode/mcp/repowise.md) — MCP server · ★ 7925
- [sem](https://affpapa.org/en/nevibecode/mcp/sem.md) — MCP server · ★ 3427
- [GitLab MCP Server](https://affpapa.org/en/nevibecode/mcp/gitlab-mcp-server.md) — MCP server · ★ 2068
- [Octocode MCP - AI Context Platform](https://affpapa.org/en/nevibecode/mcp/octocode-mcp-ai-context-platform.md) — MCP server · ★ 955

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
