# Contentrain

> Contentrain is an open-source MCP server for developer tools. Git-backed content governance for AI agents, with 23 deterministic MCP tools. It can run locally on your machine or as a hosted remote server.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, self-hosted, API
- **Website:** https://ai.contentrain.io/packages/mcp
- **Repository:** https://github.com/contentrain/ai/tree/HEAD/packages/mcp
- **MCP Registry name:** io.github.Contentrain/contentrain
- **Categories:** developer tools, files and documents
- **Listing updated:** 2026-11-14

## About

Contentrain's engine sits between an agent and a project's files. The agent decides what to write and where, and the server carries out the writes deterministically: validating against schemas, serialising canonically and committing through git, so humans review and merge the result. The stated reason is that agents are non-deterministic, and the same prompt can produce different file formats or broken git state.

It manages a .contentrain/ directory and covers project setup, model creation and deletion, content save, delete and list, validation with auto-fix, normalize scan and apply flows, bulk operations, branch submission and review-mode merge, and a doctor health check. Each write happens in a temporary worktree on a feature branch forked from a dedicated contentrain branch, then merges back, and a local mode can avoid any pushes. Tool annotations mark reads, writes and destructive operations, and tool listings are filtered by what a session can serve.

There are two ways to run it: as a local stdio server (contentrain-mcp, or contentrain serve --stdio) against a checkout, or through Contentrain Studio's hosted MCP Cloud, which uses a project-scoped API key and adds five media tools. It needs Node.js 22 or newer and git, and optional Vue, Astro and Svelte parsers improve source scanning.

## Features

- **Deterministic writes:** Applies content changes with validation and canonical serialisation instead of free-form file edits.
- **Git transaction flow:** Writes on feature branches from a dedicated contentrain branch, with auto-merge or review mode.
- **Schema and locale consistency:** Keeps models, locales and serialisation consistent across content.
- **Normalize scan:** Scans source code, with optional Vue, Astro and Svelte parsers, to extract content.
- **Local or hosted:** Runs on stdio against a checkout or through Studio's project-scoped remote endpoint.
- **Annotated tools:** Marks read-only, destructive and idempotent tools so clients can tell them apart.

## Good for

- Let an agent edit site copy without direct file access
- Review AI-written content changes as git branches
- Keep translations consistent across locales
- Extract hard-coded strings from components into content models
- Run a content health check on a project

## Install

### Claude Code (Terminal)

```sh
claude mcp add --transport http contentrain https://studio.contentrain.io/api/mcp/remote
```

### Claude Desktop (Settings → Connectors → Add custom connector)

```sh
https://studio.contentrain.io/api/mcp/remote
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "contentrain": {
      "url": "https://studio.contentrain.io/api/mcp/remote"
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "contentrain": {
      "type": "http",
      "url": "https://studio.contentrain.io/api/mcp/remote"
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "contentrain": {
      "serverUrl": "https://studio.contentrain.io/api/mcp/remote"
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "contentrain": {
      "type": "http",
      "url": "https://studio.contentrain.io/api/mcp/remote"
    }
  }
}
```

## Tools

- `contentrain_status`: Project status.
- `contentrain_media_ingest`: Fetches a caller-supplied URL server-side into media storage.

## FAQ

### What does it require?

Node.js 22 or newer and git on the machine.

### How is it different from letting the agent write files?

Writes go through validation, canonical serialisation and a git transaction, so output stays consistent.

### Can it avoid pushing to a remote?

Yes. Local mode, set with git.push false or CONTENTRAIN_NO_PUSH=1, never pushes or deletes on the remote.

### Is there a hosted option?

Yes. Contentrain Studio's MCP Cloud provides a project-scoped endpoint using an API key.

### How many tools does it expose?

23 core tools, plus 5 media tools on media-capable providers such as Studio.

### Is Contentrain free?

Yes. Contentrain is open source, so you can use and self-host it for free.

### How do I add Contentrain to Claude Code?

Run this command in your terminal: claude mcp add --transport http contentrain https://studio.contentrain.io/api/mcp/remote

### What are the best alternatives to Contentrain?

The closest alternatives to Contentrain are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [Ouroboros](https://ai-powered.com/mcp/ouroboros): Ouroboros is an open-source MCP server for developer tools.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.
- [Concord MCP](https://ai-powered.com/mcp/concord-mcp): Concord MCP is a freemium MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/contentrain
