Skip to main content
Glama

コンテンツフル MCP サーバー

鍛冶屋のバッジ

Contentful のコンテンツ管理 API と統合し、包括的なコンテンツ管理機能を提供する MCP サーバー実装。

  • ご注意ください *; コードに興味がなく、この MCP を Claude Desktop (または MCP サーバーを使用できるその他のツール) で使用したいだけの場合は、このリポジトリを複製する必要はなく、Claude Desktop でセットアップするだけで済みます。インストール方法については、「Claude Desktop での使用」セクションを参照してください。

特徴

  • コンテンツ管理: エントリとアセットの完全なCRUD操作

  • スペース管理: スペースと環境を作成、更新、管理します

  • コンテンツタイプ: コンテンツタイプの定義を管理する

  • ローカライズ: 複数のロケールのサポート

  • 公開: コンテンツ公開ワークフローを制御する

  • 一括操作: 複数のエントリとアセットにわたって一括公開、非公開、検証を実行します。

  • スマートページネーション: リスト操作は、コンテキストウィンドウのオーバーフローを防ぐために、組み込みのページネーションサポートを使用して、リクエストごとに最大3つのアイテムを返します。

Related MCP server: Storyblok MCP Server

ページネーション

LLMにおけるコンテキストウィンドウのオーバーフローを防ぐため、リスト操作(search_entriesやlist_assetsなど)はリクエストごとに3項目までに制限されています。各レスポンスには以下が含まれます。

  • 利用可能なアイテムの合計数

  • 現在のアイテムページ(最大 3 件)

  • 残りのアイテム数

  • 次のページのスキップ値

  • LLMにさらなるアイテムの取得を提案するよう促すメッセージ

このページ区切りシステムにより、LLM はコンテキスト ウィンドウの制限を維持しながら大規模なデータセットを効率的に処理できます。

一括操作

一括操作機能により、複数のコンテンツ項目を同時に効率的に管理できます。

  • 非同期処理: 操作は非同期的に実行され、ステータスの更新が提供されます

  • 効率的なコンテンツ管理: 1回のAPI呼び出しで複数のエントリまたはアセットを処理

  • ステータス追跡: 成功と失敗の数で進捗状況を監視

  • リソースの最適化: API呼び出しを減らし、バッチ操作のパフォーマンスを向上

これらの一括操作ツールは、コンテンツの移行、大量更新、バッチ公開ワークフローに最適です。

ツール

入場管理

  • search_entries : クエリパラメータを使用してエントリを検索する

  • create_entry : 新しいエントリを作成する

  • get_entry : 既存のエントリを取得する

  • update_entry : エントリフィールドを更新する

  • delete_entry : エントリを削除する

  • publish_entry : エントリを公開する

  • unpublish_entry : エントリを非公開にする

一括操作

  • bulk_publish : 複数のエントリとアセットを1回の操作で公開します。エンティティ(エントリとアセット)の配列を受け取り、それらの公開を一括処理します。

  • bulk_unpublish : 複数のエントリとアセットを1回の操作で非公開にします。bulk_publish と似ていますが、配信APIからコンテンツを削除します。

  • bulk_validate : 複数のエントリのコンテンツの一貫性、参照、必須フィールドを検証します。コンテンツを変更せずに検証結果を返します。

資産運用管理

  • list_assets : ページ区切りでアセットを一覧表示します(1 ページあたり 3 項目)

  • upload_asset : メタデータを含む新しいアセットをアップロードする

  • get_asset : 資産の詳細と情報を取得する

  • update_asset : アセットのメタデータとファイルを更新する

  • delete_asset : スペースからアセットを削除する

  • publish_asset : アセットを配信APIに公開する

  • unpublish_asset : 配信 API からアセットを非公開にする

宇宙と環境管理

  • list_spaces : 利用可能なスペースを一覧表示する

  • get_space : スペースの詳細を取得する

  • list_environments : スペース内の環境を一覧表示する

  • create_environment : 新しい環境を作成する

  • delete_environment : 環境を削除する

コンテンツタイプ管理

  • list_content_types : 利用可能なコンテンツタイプを一覧表示する

  • get_content_type : コンテンツタイプの詳細を取得する

  • create_content_type : 新しいコンテンツタイプを作成する

  • update_content_type : コンテンツタイプの更新

  • delete_content_type : コンテンツタイプを削除する

  • publish_content_type : コンテンツタイプを公開する

開発ツール

MCP検査官

このプロジェクトには、開発とデバッグに役立つ MCP Inspector ツールが含まれています。

  • インスペクターモード: npm run inspectを実行してインスペクターを起動します。http ://localhost:5173にアクセスしてインスペクターを開くことができます。

  • ウォッチモード: npm run inspect:watchを使用すると、ファイルが変更されたときにインスペクターが自動的に再起動されます。

  • ビジュアルインターフェース: インスペクターは、MCPツールをテストおよびデバッグするためのWebインターフェースを提供します。

  • リアルタイムテスト: ツールを試して、その反応をすぐに確認します

  • 一括操作のテスト: 進捗状況と結果の視覚的なフィードバックを使用して一括操作をテストおよび監視します。

このプロジェクトには、変更のたびに MCP サーバーを再構築して再ロードするnpm run devコマンドも含まれています。

構成

前提条件

  1. ContentfulでContentfulアカウントを作成する

  2. アカウント設定からコンテンツ管理APIトークンを生成する

環境変数

これらの変数は引数として設定することもできる

  • CONTENTFUL_HOST / --host : Contentful 管理 API エンドポイント (デフォルトはhttps://api.contentful.com )

  • CONTENTFUL_MANAGEMENT_ACCESS_TOKEN / --management-token : コンテンツ管理APIトークン

  • ENABLE_HTTP_SERVER / --http : HTTP/SSEモードを有効にするには「true」に設定します

  • HTTP_PORT / --port : HTTPサーバーのポート(デフォルト: 3000)

  • HTTP_HOST / --http-host : HTTPサーバーのホスト(デフォルト: localhost)

宇宙と環境のスコープ

spaceIdとEnvironmentIdのスコープを設定することで、LLMが定義された空間/環境IDに対してのみ操作SPACE_ID実行するようにすることができます。これは主に、特定の空間内で動作するエージェントをサポートするためです。SPACE_IDとENVIRONMENT_ID両方の環境変数が設定されている場合、ツールはこれらの値が必要であることを報告せず、ハンドラーは環境変数を使用してCMA操作を実行します。また、これらのツールは複数の空間にまたがるため、空間ハンドラー内のツールへのアクセスも失われます。-- --space-idおよび--environment-id引数を使用して、 SPACE_IDとENVIRONMENT_IDを追加することもできます。

アプリIDの使用

管理トークンを提供する代わりに、 App Identityを利用して認証を処理することもできます。Contentfulアプリをセットアップしてインストールし、MCPサーバーを呼び出す際に以下のパラメータを設定する必要があります。

  • --app-id = Apptokenを提供しているアプリID

  • --private-key = アプリのユーザーインターフェースで作成した、 app_idに紐付けられた秘密鍵

  • --space-id = アプリがインストールされているスペースID

  • --environment-id = アプリがインストールされている環境 ID (スペース内)。

これらの値により、MCPサーバーは定義された空間/環境IDでコンテンツ操作を行うために一時的なAppTokenを要求します。これは、MCPクライアント(チャットエージェントなど)として機能するバックエンドシステムでこのMCPサーバーを使用する場合に特に便利です。

Claude Desktopでの使用

この MCP を使用するためにこのリポジトリをクローンする必要はありませんclaude_desktop_config.jsonに追加するだけです。

~/Library/Application Support/Claude/claude_desktop_config.jsonを追加または編集し、次の行を追加します。

{
  "mcpServers": {
    "contentful": {
      "command": "npx",
      "args": ["-y", "@ivotoby/contentful-management-mcp-server"],
      "env": {
        "CONTENTFUL_MANAGEMENT_ACCESS_TOKEN": "<Your CMA token>"
      }
    }
  }
}

MCPClient が環境変数の設定をサポートしていない場合は、次のような引数を使用して管理トークンを設定することもできます。

{
  "mcpServers": {
    "contentful": {
      "command": "npx",
      "args": [
        "-y",
        "@ivotoby/contentful-management-mcp-server",
        "--management-token",
        "<your token>",
        "--host",
        "http://api.contentful.com"
      ]
    }
  }
}

Smithery経由でインストール

Smithery経由で Claude Desktop 用の Contentful Management Server を自動的にインストールするには:

npx -y @smithery/cli install @ivotoby/contentful-management-mcp-server --client claude

Claudeデスクトップの開発と使用

あなたが貢献して、Claude があなたの貢献によって何を行うかをテストしたい場合;

  • npm run devを実行すると、変更ごとに MCP サーバーを再構築するウォッチャーが起動します。

  • プロジェクトを直接参照するようにclaude_desktop_config.jsonを更新します。

{
  "mcpServers": {
    "contentful": {
      "command": "node",
      "args": ["/Users/ivo/workspace/contentful-mcp/bin/mcp-server.js"],
      "env": {
        "CONTENTFUL_MANAGEMENT_ACCESS_TOKEN": "<Your CMA Token>"
      }
    }
  }
}

これにより、MCPサーバーの変更をClaudeで直接テストできるようになります。ただし、新しいツール/リソースを追加する場合は、Claude Desktopを再起動する必要があります。

輸送モード

MCP サーバーは、次の 2 つのトランスポート モードをサポートしています。

stdioトランスポート

デフォルトのトランスポートモードでは、通信に標準入出力ストリームを使用します。これは、Claude Desktop などの標準入出力トランスポートをサポートする MCP クライアントとの統合に最適です。

stdio モードを使用するには、 --httpフラグなしでサーバーを実行するだけです。

npx -y contentful-mcp --management-token YOUR_TOKEN
# or alternatively
npx -y @ivotoby/contentful-management-mcp-server --management-token YOUR_TOKEN

ストリーミング可能なHTTPトランスポート

サーバーは、MCPプロトコルで定義されているStreamableHTTPトランスポートもサポートしています。このモードは、Webベースの統合や、サーバーをスタンドアロンサービスとして実行する場合に役立ちます。

StreamableHTTP モードを使用するには、 --httpフラグを付けて実行します。

npx -y contentful-mcp --management-token YOUR_TOKEN --http --port 3000
# or alternatively
npx -y @ivotoby/contentful-management-mcp-server --management-token YOUR_TOKEN --http --port 3000

StreamableHTTPの詳細

  • 公式MCP StreamableHTTPトランスポートを使用

  • 標準MCPプロトコル操作をサポート

  • 状態を維持するためのセッション管理が含まれています

  • 初期化/通知パターンを適切に処理します

  • 標準MCPクライアントと互換性あり

  • 廃止されたSSEトランスポートを最新のアプローチに置き換えます

実装は標準の MCP プロトコル仕様に準拠しており、特別な処理なしで任意の MCP クライアントがサーバーに接続できます。

エラー処理

サーバーは、以下に対する包括的なエラー処理を実装します。

  • 認証失敗

  • レート制限

  • 無効なリクエスト

  • ネットワークの問題

  • API固有のエラー

ライセンス

MITライセンス

細則

このMCPサーバーは、Claude(またはMCPリソースを消費できる他のエージェント)がコンテンツ、スペース、コンテンツモデルを更新、削除できるようにします。そのため、ContentfulスペースでClaudeにどのような操作を許可するかは慎重に検討してください。

このMCPサーバーはContentfulによって公式にサポートされていません(まだ)

Available Tools

40 tools
bulk_validateC

Validate multiple entries at once

Inputs: entryIds (required), spaceId (required), environmentId (required).

create_ai_actionC

Create a new AI Action

Inputs: name (required), description (required), instruction (required), configuration (required), +3 more.

create_commentA

Create a new comment on an entry. The comment will be created with the specified body and status. To create a threaded conversation (reply to an existing comment), provide the parent comment ID. This allows you to work around the 512-character limit by creating threaded replies.

Inputs: entryId (required), body (required), spaceId (required), environmentId (required), +2 more.

create_content_typeD

Create a new content type

Inputs: name (required), fields (required), spaceId (required), environmentId (required), +2 more.

create_entryA

Create a new entry in Contentful. Before executing this function, you need to know the contentTypeId (not the content type NAME) and the fields of that contentType. You can get the fields definition by using the GET_CONTENT_TYPE tool. IMPORTANT: All field values MUST include a locale key (e.g., 'en-US') for each value, like: { title: { 'en-US': 'My Title' } }. Every field in Contentful requires a locale even for single-language content.

Inputs: contentTypeId (required), fields (required), spaceId (required), environmentId (required).

create_environmentD

Create a new environment

Inputs: spaceId (required), environmentId (required), name (required).

delete_ai_actionB

Delete an AI Action

Inputs: aiActionId (required), spaceId (required), environmentId (required).

delete_assetC

Delete an asset

Inputs: assetId (required), spaceId (required), environmentId (required).

delete_commentC

Delete a specific comment from an entry.

Inputs: entryId (required), commentId (required), spaceId (required), environmentId (required).

delete_content_typeC

Delete a content type

Inputs: contentTypeId (required), spaceId (required), environmentId (required).

delete_entryC

Delete an entry

Inputs: entryId (required), spaceId (required), environmentId (required).

delete_environmentC

Delete an environment

Inputs: spaceId (required), environmentId (required).

get_ai_actionB

Get a specific AI Action by ID

Inputs: aiActionId (required), spaceId (required), environmentId (required).

get_ai_action_invocationB

Get the result of a previous AI Action invocation

Inputs: aiActionId (required), invocationId (required), spaceId (required), environmentId (required).

get_assetC

Retrieve an asset

Inputs: assetId (required), spaceId (required), environmentId (required).

get_commentsB

Retrieve comments for an entry with pagination support. Returns comments with their status and body content.

Inputs: entryId (required), spaceId (required), environmentId (required), bodyFormat, +3 more.

get_content_typeB

Get details of a specific content type

Inputs: contentTypeId (required), spaceId (required), environmentId (required).

get_entryC

Retrieve an existing entry

Inputs: entryId (required), spaceId (required), environmentId (required).

get_single_commentB

Retrieve a specific comment by its ID for an entry.

Inputs: entryId (required), commentId (required), spaceId (required), environmentId (required), +1 more.

get_spaceC

Get details of a space

Inputs: spaceId (required).

invoke_ai_actionC

Invoke an AI Action with variables

Inputs: aiActionId (required), spaceId (required), environmentId (required), variables, +3 more.

list_ai_actionsC

List all AI Actions in a space

Inputs: spaceId (required), environmentId (required), limit, skip, +1 more.

list_assetsA

List assets in a space. Returns a maximum of 3 items per request. Use skip parameter to paginate through results.

Inputs: limit (required), skip (required), spaceId (required), environmentId (required).

list_content_typesB

List content types in a space. Returns a maximum of 10 items per request. Use skip parameter to paginate through results.

Inputs: limit (required), skip (required), spaceId (required), environmentId (required).

list_environmentsC

List all environments in a space

Inputs: spaceId (required).

list_spacesA

List all available spaces

Inputs: no named parameters.

publish_ai_actionC

Publish an AI Action

Inputs: aiActionId (required), spaceId (required), environmentId (required).

publish_assetC

Publish an asset

Inputs: assetId (required), spaceId (required), environmentId (required).

publish_content_typeC

Publish a content type

Inputs: contentTypeId (required), spaceId (required), environmentId (required).

publish_entryA

Publish an entry or multiple entries. Accepts either a single entryId (string) or an array of entryIds (up to 100 entries). For a single entry, it uses the standard publish operation. For multiple entries, it automatically uses bulk publishing.

Inputs: entryId (required), spaceId (required), environmentId (required).

search_entriesA

Search for entries using query parameters. Returns a maximum of 3 items per request. Use skip parameter to paginate through results.

Inputs: query (required), spaceId (required), environmentId (required).

unpublish_ai_actionC

Unpublish an AI Action

Inputs: aiActionId (required), spaceId (required), environmentId (required).

unpublish_assetC

Unpublish an asset

Inputs: assetId (required), spaceId (required), environmentId (required).

unpublish_entryA

Unpublish an entry or multiple entries. Accepts either a single entryId (string) or an array of entryIds (up to 100 entries). For a single entry, it uses the standard unpublish operation. For multiple entries, it automatically uses bulk unpublishing.

Inputs: entryId (required), spaceId (required), environmentId (required).

update_ai_actionC

Update an existing AI Action

Inputs: aiActionId (required), name (required), description (required), instruction (required), +4 more.

update_assetD

Update an asset

Inputs: assetId (required), spaceId (required), environmentId (required), title, +2 more.

update_commentA

Update an existing comment on an entry. The handler will merge your updates with the existing comment data.

Inputs: entryId (required), commentId (required), spaceId (required), environmentId (required), +3 more.

update_content_typeB

Update an existing content type. The handler will merge your field updates with existing content type data, so you only need to provide the fields and properties you want to change.

Inputs: contentTypeId (required), fields (required), spaceId (required), environmentId (required), +3 more.

update_entryA

Update an existing entry. The handler will merge your field updates with the existing entry fields, so you only need to provide the fields and locales you want to change. IMPORTANT: All field values MUST include a locale key (e.g., 'en-US') for each value, like: { title: { 'en-US': 'My Updated Title' } }. Every field in Contentful requires a locale even for single-language content.

Inputs: entryId (required), fields (required), spaceId (required), environmentId (required).

upload_assetC

Upload a new asset

Inputs: title (required), file (required), spaceId (required), environmentId (required), +1 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.9/5.0

    Scored across 40 tools

    Disambiguation5/5

    Each tool targets a distinct resource and action (e.g., create_entry vs. get_entry, publish_asset vs. unpublish_asset). There is no overlap in purpose, and descriptions clearly differentiate similar operations like get_ai_action vs. get_ai_action_invocation.

    Naming Consistency5/5

    All tools follow a consistent verb_noun snake_case pattern (e.g., create_entry, list_assets, update_comment). No mixing of conventions like camelCase or different verb styles.

    Tool Count2/5

    With 40 tools, the count exceeds the typical well-scoped range (3-15) and the '25+' threshold for too many. Even considering Contentful's complexity, the number feels heavy and may overwhelm agents.

    Completeness5/5

    The tool set covers full CRUD plus publish/unpublish, search, and validation for entries; CRUD plus upload for assets; lifecycle for comments, environments, AI actions; and space listing. No obvious gaps such as missing delete for content types or bulk operations.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers