Skip to main content
Glama

Contentful MCP Server

Notice

This is a community driven server! Contentful has released an official server which you can find here

An MCP server implementation that integrates with Contentful's Content Management API, providing comprehensive content management capabilities.

  • Please note *; if you are not interested in the code, and just want to use this MCP in Claude Desktop (or any other tool that is able to use MCP servers) you don't have to clone this repo, you can just set it up in Claude desktop, refer to the section "Usage with Claude Desktop" for instructions on how to install it.

Related MCP server: Storyblok MCP Server

Features

  • Content Management: Full CRUD operations for entries and assets

  • Comment Management: Create, retrieve, and manage comments on entries with support for both plain-text and rich-text formats, including threaded conversations

  • Space Management: Create, update, and manage spaces and environments

  • Content Types: Manage content type definitions

  • Localization: Support for multiple locales

  • Publishing: Control content publishing workflow

  • Bulk Operations: Execute bulk publishing, unpublishing, and validation across multiple entries and assets

  • Smart Pagination: List operations return maximum 3 items per request to prevent context window overflow, with built-in pagination support

Pagination

To prevent context window overflow in LLMs, list operations (like search_entries and list_assets) are limited to 3 items per request. Each response includes:

  • Total number of available items

  • Current page of items (max 3)

  • Number of remaining items

  • Skip value for the next page

  • Message prompting the LLM to offer retrieving more items

This pagination system allows the LLM to efficiently handle large datasets while maintaining context window limits.

Bulk Operations

The bulk operations feature provides efficient management of multiple content items simultaneously:

  • Asynchronous Processing: Operations run asynchronously and provide status updates

  • Efficient Content Management: Process multiple entries or assets in a single API call

  • Status Tracking: Monitor progress with success and failure counts

  • Resource Optimization: Reduce API calls and improve performance for batch operations

These bulk operation tools are ideal for content migrations, mass updates, or batch publishing workflows.

Tools

Entry Management

  • search_entries: Search for entries using query parameters

  • create_entry: Create new entries

  • get_entry: Retrieve existing entries

  • update_entry: Update entry fields

  • delete_entry: Remove entries

  • publish_entry: Publish entries

  • unpublish_entry: Unpublish entries

Comment Management

  • get_comments: Retrieve comments for an entry with filtering by status (active, resolved, all)

  • create_comment: Create new comments on entries with support for both plain-text and rich-text formats. Supports threaded conversations by providing a parent comment ID to reply to existing comments

  • get_single_comment: Retrieve a specific comment by its ID for an entry

  • delete_comment: Delete a specific comment from an entry

  • update_comment: Update existing comments with new body content or status changes

Threaded Comments

Comments support threading functionality to enable structured conversations and work around the 512-character limit:

  • Reply to Comments: Use the parent parameter in create_comment to reply to an existing comment

  • Threaded Conversations: Build conversation trees by replying to specific comments

  • Extended Discussions: Work around the 512-character limit by creating threaded replies to continue longer messages

  • Conversation Context: Maintain context in discussions by organizing related comments in threads

Example usage:

  1. Create a main comment: create_comment with entryId, body, and status

  2. Reply to that comment: create_comment with entryId, body, status, and parent (the ID of the comment you're replying to)

  3. Continue the thread: Reply to any comment in the thread by using its ID as the parent

Bulk Operations

  • bulk_publish: Publish multiple entries and assets in a single operation. Accepts an array of entities (entries and assets) and processes their publication as a batch.

  • bulk_unpublish: Unpublish multiple entries and assets in a single operation. Similar to bulk_publish but removes content from the delivery API.

  • bulk_validate: Validate multiple entries for content consistency, references, and required fields. Returns validation results without modifying content.

Asset Management

  • list_assets: List assets with pagination (3 items per page)

  • upload_asset: Upload new assets with metadata

  • get_asset: Retrieve asset details and information

  • update_asset: Update asset metadata and files

  • delete_asset: Remove assets from space

  • publish_asset: Publish assets to delivery API

  • unpublish_asset: Unpublish assets from delivery API

Space & Environment Management

  • list_spaces: List available spaces

  • get_space: Get space details

  • list_environments: List environments in a space

  • create_environment: Create new environment

  • delete_environment: Remove environment

Content Type Management

  • list_content_types: List available content types

  • get_content_type: Get content type details

  • create_content_type: Create new content type

  • update_content_type: Update content type

  • delete_content_type: Remove content type

  • publish_content_type: Publish a content type

Development Tools

MCP Inspector

The project includes an MCP Inspector tool that helps with development and debugging:

  • Inspect Mode: Run npm run inspect to start the inspector, you can open the inspector by going to http://localhost:5173

  • Watch Mode: Use npm run inspect:watch to automatically restart the inspector when files change

  • Visual Interface: The inspector provides a web interface to test and debug MCP tools

  • Real-time Testing: Try out tools and see their responses immediately

  • Bulk Operations Testing: Test and monitor bulk operations with visual feedback on progress and results

The project also contains a npm run dev command which rebuilds and reloads the MCP server on every change.

Configuration

Prerequisites

  1. Create a Contentful account at Contentful

  2. Generate a Content Management API token from your account settings

Environment Variables

These variables can also be set as arguments

  • CONTENTFUL_HOST / --host: Contentful Management API Endpoint (defaults to https://api.contentful.com)

  • CONTENTFUL_MANAGEMENT_ACCESS_TOKEN / --management-token: Your Content Management API token

  • ENABLE_HTTP_SERVER / --http: Set to "true" to enable HTTP/SSE mode

  • HTTP_PORT / --port: Port for HTTP server (default: 3000)

  • HTTP_HOST / --http-host: Host for HTTP server (default: localhost)

  • DISABLE_AI_ACTIONS: Set to "true" to disable fetching AI Actions on startup (useful if you don't have access to this feature)

Space and Environment Scoping

You can scope the spaceId and EnvironmentId to ensure the LLM will only do operations on the defined space/env ID's. This is mainly to support agents that are to operate within specific spaces. If both SPACE_ID and ENVIRONMENT_ID env-vars are set the tools will not report needing these values and the handlers will use the environment vars to do CMA operations. You will also loose access to the tools in the space-handler, since these tools are across spaces. You can also add the SPACE_ID and ENVIRONMENT_ID by using arguments --space-id and --environment-id

Using App Identity

Instead of providing a Management token you can also leverage App Identity for handling authentication. You would have to setup and install a Contentful App and set the following parameters when calling the MCP-server:

  • --app-id = the app Id which is providing the Apptoken

  • --private-key = the private key you created in the user-interface with your app, tied to app_id

  • --space-id = the spaceId in which the app is installed

  • --environment-id = the environmentId (within the space) in which the app is installed.

With these values the MCP server will request a temporary AppToken to do content operation in the defined space/environment-id. This especially useful when using this MCP server in backend systems that act as MCP-client (like chat-agents)

Usage with Claude Desktop

You do not need to clone this repo to use this MCP, you can simply add it to your claude_desktop_config.json:

Add or edit ~/Library/Application Support/Claude/claude_desktop_config.json and add the following lines:

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

If your MCPClient does not support setting environment variables you can also set the management token using an argument like this:

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

Installing via Smithery

To install Contentful Management Server for Claude Desktop automatically via Smithery:

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

Developing and using Claude desktop

If you want to contribute and test what Claude does with your contributions;

  • run npm run dev, this will start the watcher that rebuilds the MCP server on every change

  • update claude_desktop_config.json to reference the project directly, ie;

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

This will allow you to test any modification in the MCP server with Claude directly, however; if you add new tools/resources you will need to restart Claude Desktop

Transport Modes

The MCP server supports two transport modes:

stdio Transport

The default transport mode uses standard input/output streams for communication. This is ideal for integration with MCP clients that support stdio transport, like Claude Desktop.

To use stdio mode, simply run the server without the --http flag:

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

StreamableHTTP Transport

The server also supports the StreamableHTTP transport as defined in the MCP protocol. This mode is useful for web-based integrations or when running the server as a standalone service.

To use StreamableHTTP mode, run with the --http flag:

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 Details

  • Uses the official MCP StreamableHTTP transport

  • Supports standard MCP protocol operations

  • Includes session management for maintaining state

  • Properly handles initialize/notify patterns

  • Compatible with standard MCP clients

  • Replaces the deprecated SSE transport with the modern approach

The implementation follows the standard MCP protocol specification, allowing any MCP client to connect to the server without special handling.

Error Handling

The server implements comprehensive error handling for:

  • Authentication failures

  • Rate limiting

  • Invalid requests

  • Network issues

  • API-specific errors

License

MIT License

Fine print

This MCP Server enables Claude (or other agents that can consume MCP resources) to update, delete content, spaces and content-models. So be sure what you allow Claude to do with your Contentful spaces!

This MCP-server is not officially supported by Contentful (yet)

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