MCP.so
ログイン

Contentrain MCP Server

@Contentrain

基本情報

カテゴリ

開発者ツール

ライセンス

MIT

トランスポート

stdio

作者

Contentrain

投稿者

AHMET BAYHAN BAYRAMOGLU

Contentrain MCP Server について

Repo-native content governance for AI agents. Extract, review, and deliver UI text, docs, and structured content from Git.

Contentrain MCP Server の設定

以下の設定を使って、このサーバーを MCP 対応クライアントに追加してください。

{
  "mcpServers": {
    "contentrain": {
      "command": "npx",
      "args": [
        "-y",
        "@contentrain/mcp@^3"
      ]
    }
  }
}

Contentrain MCP Server のツール

22

Get full project status (read-only). Returns config, models, context. Do NOT manually edit .contentrain/ based on this output.

Get full schema of a single model (read-only). Do NOT manually create content files — use contentrain_content_save instead.

Describes the Contentrain content file format for any language/platform. Returns a comprehensive specification of the file structure, JSON formats, markdown conventions, meta files, and locale strategies.

Initialize .contentrain/ structure. Changes are auto-committed to git — do NOT manually create .contentrain/ files.

Template-based project setup. Available templates: blog, landing, docs, ecommerce, saas, i18n, mobile. Changes are auto-committed to git.

Create or update a model definition. Changes are auto-committed to git — do NOT manually edit .contentrain/ files after calling this tool.

Delete a model and its content/meta. Changes are auto-committed to git — do NOT manually edit .contentrain/ files.

Save content entries. Entry format varies by model kind: DICTIONARY — provide "locale" and "data" (flat key-value, all string values); "id" and "slug" are ignored; data keys are the identities. COLLECTION — provide "locale" and "data"; "id" is optional (auto-generated if omitted); "slug" is ignored. DOCUMENT — provide "slug" (required), "locale", and "data"; use the "body" key inside data for markdown content. SINGLETON — provide only "locale" and "data". MEDIA FIELDS (image/video/file): for a media-library asset, pass its storage path ("media/...") or URL; in cloud mode these are automatically normalized to absolute public delivery URLs on save (in markdown bodies too), so saved content renders in a browser anywhere with no SDK — in local mode the relative path is kept as-is. For external images (e.g. a CDN or Unsplash URL), pass the URL directly; it is saved untouched. Changes are auto-committed to git — do NOT manually edit .contentrain/ files after calling this tool.

Delete content entries. For dictionaries, use "keys" to remove specific keys (omit to delete entire locale file). Changes are auto-committed to git — do NOT manually edit .contentrain/ files after calling this tool.

List content entries (read-only). Returns data from .contentrain/ — do NOT manually create or modify content files.

Add or update canonical vocabulary terms. Terms nest as { "term-slug": { "en": "…", "tr": "…" } } — the OUTER key is the term, the INNER key is a locale. Merges with the existing vocabulary: a term you omit is untouched. Changes are auto-committed to git — do NOT manually edit .contentrain/vocabulary.json.

Remove canonical vocabulary terms by slug. Content already using a term is not touched — the vocabulary only advises. Changes are auto-committed to git.

Validate project content against model schemas. Detects required field violations, type mismatches, broken relations, secret leaks, i18n parity issues, and more. If fix:true, auto-fixes structural issues (canonical sort, orphan meta, missing locale files, stray non-i18n meta layout, scheduling keys an older content_save leaked into document frontmatter) and backfills a missing model title_field — do NOT manually edit .contentrain/ files.

Push contentrain/* branches to remote. MCP is push-only — PR creation is handled by the platform. Do NOT manually push or create PRs.

Merge a review-mode branch into contentrain. Local git operation — no external platform needed. Merges the feature branch into the contentrain branch, advances the base branch via update-ref, selectively syncs .contentrain/ files to the working tree, and prunes the merged branch. Target by exact "branch" name, or resolve by "model" (+ optional "locale"/"latest").

List pending contentrain (cr/*) branches with their merge status against the contentrain branch. Use this to discover branch names for contentrain_merge / contentrain_branch_delete, and to monitor branch-health limits (warning at 50, blocked at 80 unmerged).

Delete a pending contentrain (cr/*) branch that will not be merged — e.g. a branch left behind by a failed operation, or a superseded draft. Only cr/* branches can be deleted; the contentrain branch is protected. This is destructive: the branch and its unmerged commits are removed.

Reconcile a diverged contentrain ↔ base-branch pair with a content-aware three-way merge. DRY RUN (default, dry_run:true): reports what would merge and which conflicts need a decision — touches nothing. EXECUTE (dry_run:false): performs the merge as a two-parent commit on contentrain and fast-forwards the base branch. Everything one side changed merges mechanically (entry-, key-, term+locale-level); only the same item changed differently on both sides becomes a conflict. Answer conflicts by passing resolutions (from the dry-run ids) and running again — a resolution whose values changed since the dry-run is dropped and the conflict re-reported. Recommended workflow: always run dry_run first, review the summary and conflicts, then execute.

Scan project source code for content strings. Three modes: "graph" builds import/component graph for project intelligence, "candidates" extracts string literals with pre-filtering and pagination, "summary" provides quick overview stats. Read-only — no changes to disk or git. MCP finds strings deterministically; the agent decides what is content. Recommended workflow: start with "summary" or "graph" for orientation, then paginate through "candidates" to evaluate strings.

Apply normalize operations. Two modes: "extract" writes agent-approved strings to Contentrain content files (source untouched), "reuse" patches source files with agent-provided replacement expressions. DRY RUN (default, dry_run:true): validates inputs, resolves conflicts, and returns a full preview — NO changes to disk or git. EXECUTE (dry_run:false): writes files to disk, commits to a branch, and requires branch health check to pass. Recommended workflow: always run dry_run first, review the preview, then call again with dry_run:false to execute. Normalize operations always use review workflow (never auto-merge).

Batch operations on content entries. All operations are auto-committed to git. DRY RUN (dry_run:true): runs the whole operation in a throwaway worktree and reports exactly what would change — nothing is committed and no branch survives. Recommended workflow: preview with dry_run:true, review the counts, then call again to execute.

Project health report (read-only). Returns structured checks: git, node, .contentrain/ structure, model parse, orphan content, branch pressure, SDK freshness. Pass `usage: true` for a deeper analysis of content-key references in source files (unused keys, duplicate dictionary values, locale coverage). Local-filesystem only — unavailable over remote providers.

概要

What is Contentrain?

Contentrain is a content governance ecosystem for teams and AI agents. Its open-source MCP server (@contentrain/mcp) helps teams extract, govern, and ship structured content from their codebase. It transforms hardcoded UI text, docs, and structured data into a reviewable, Git-native content layer that agents can create, translate, and update while Contentrain enforces schema, review branches, and portable file output.

How to use Contentrain?

Initialize a project with npx contentrain init, then run npx contentrain serve for the local review UI or npx contentrain serve --stdio for MCP over stdio. Agents (Claude Code, Cursor, Windsurf, etc.) connect via its 27 MCP tools over stdio or HTTP transport to extract, create, and update content.

Key features of Contentrain

  • 27 MCP tools (22 core + 5 media) over stdio or HTTP transport
  • Git-native workflow with worktree isolation and review branches
  • Normalize flow: extract hardcoded strings into i18n-ready content
  • 4 content kinds: Collection, Singleton, Document, Dictionary
  • Provider-agnostic: local, GitHub, GitLab (self-hosted)
  • 16 Agent Skills for reusable workflow procedures
  • Canonical serialization for clean git diffs and conflict-free edits
  • Outputs plain JSON and Markdown consumable by any framework

Use cases of Contentrain

  • Rescue hardcoded strings from existing apps and turn them into structured, translatable content
  • Start new projects with a real content layer instead of scattering copy across components
  • Serve the same content across web, docs, mobile, and backend systems from plain JSON and Markdown in Git
  • Enable AI agents to autonomously create and update content while enforcing schema and human review

よくある質問

1

What is Contentrain and how does it differ from a CMS?

Contentrain is not a database-first or dashboard-first CMS; it’s a Git-native content layer that works with plain JSON and Markdown. It enforces schemas, validation, and review branches, and is designed for agent-driven content operations alongside human review.

2

What dependencies are required to use Contentrain?

Node.js and npm. Run `npx contentrain init` and `npx contentrain serve` to start — no account, cloud, or proprietary runtime is needed.

3

Where is content stored when using Contentrain?

Content lives in a `.contentrain/` directory in your project. Files are plain JSON and Markdown stored in Git. For team workflows, it integrates with GitHub or GitLab via worktree isolation and review branches.

4

What transports does the MCP server support?

The MCP server supports stdio (for local IDE agents) and HTTP transport (for remote drivers such as Contentrain Studio).

5

Does Contentrain require authentication?

No. The local workflow works without authentication. For remote drivers (e.g., Studio), optionally run `npx contentrain studio login` and `npx contentrain studio connect` to link a project.

コメント

「開発者ツール」の他のコンテンツ