home / mcp / contentful mcp server

Contentful MCP Server

MCP (Model Context Protocol) server for the Contentful Management API

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "contentful-contentful-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@contentful/mcp-server"
      ],
      "env": {
        "SPACE_ID": "YOUR_SPACE_ID",
        "ENVIRONMENT_ID": "master",
        "CONTENTFUL_HOST": "api.contentful.com",
        "CONTENTFUL_MANAGEMENT_ACCESS_TOKEN": "YOUR CMA TOKEN"
      }
    }
  }
}

You can use this Contentful MCP Server to empower your AI assistants with direct access to Contentful APIs and a rich set of content management actions. It enables you to create, edit, organize, and publish content within Contentful spaces through your preferred MCP client, streamlining workflows and automating repetitive tasks.

How to use

Connect your MCP client to the Contentful MCP Server using the standard MCP connection flow for your tool (for example, Codex, Cursor, or Claude Desktop). Once connected, you can list, create, update, publish, and organize content types, entries, assets, spaces, environments, locales, and tags. You can also create and invoke AI actions to automate common Contentful workflows, such as translating content or applying bulk updates across entries.

Typical usage patterns include: creating new content types or entries, updating fields across multiple entries, uploading and tagging assets, and publishing content changes. You can also search and filter entries, manage locales, and organize assets by campaigns or other metadata. Use natural language prompts in your MCP client to trigger the available tools and workflows.

How to install

Prerequisites you need before installation: Node.js and npm, a Contentful account with a Space ID, and a Contentful Management API personal access token.

2. Install from source or prepare your environment for running the MCP server locally.

# Install from source
```
git clone https://github.com/contentful/contentful-mcp-server.git
cd contentful-mcp-server
npm install
npm run build

3. Start the MCP server using the provided command with your Contentful credentials and configuration. Use the following runtime command and environment variables as shown.

command: npx
args: ["-y", "@contentful/mcp-server"]

4. Set up the required environment variables for your Contentful connection. You can pass these through your shell or your MCP configuration as shown in the example configuration below.

Configuration reference

Below is an example configuration snippet that shows how to wire up the MCP server in your environment. This configuration uses the standard runtime command and exposes the necessary environment variables.

{
  "mcpServers": {
    "contentful_mcp": {
      "command": "npx",
      "args": ["-y", "@contentful/mcp-server"],
      "env": {
        "CONTENTFUL_MANAGEMENT_ACCESS_TOKEN": "your-CMA-token",
        "SPACE_ID": "your-space-id",
        "ENVIRONMENT_ID": "master",
        "CONTENTFUL_HOST": "api.contentful.com"
      }
    }
  }
}

Environment variables

The following environment variables are used to configure the MCP server for Contentful access.

CONTENTFUL_MANAGEMENT_ACCESS_TOKEN=your-CMA-token
SPACE_ID=your-space-id
ENVIRONMENT_ID=master
CONTENTFUL_HOST=api.contentful.com

Available tools overview

The server exposes a comprehensive set of tools for managing Contentful resources. You can perform actions related to context setup, content types, entries, assets, spaces and environments, locales, tags, and AI-driven actions. Each tool is designed to help you interact with Contentful programmatically and efficiently.

Notes and tips

- Ensure your Contentful CMA token has the required permissions for the actions you intend to perform. - Use descriptive environment names to keep spaces and environments organized. - Validate changes in a staging environment before publishing to production. - If you encounter authentication or permission errors, regenerate tokens and verify the associated Space ID and Environment ID.

Available tools

get_initial_context

Initialize connection and get usage instructions

list_content_types

List all content types

get_content_type

Get detailed content type information

create_content_type

Create new content types

update_content_type

Modify existing content types

publish_content_type

Publish content type changes

unpublish_content_type

Unpublish content types

delete_content_type

Remove content types

search_entries

Search and filter entries

get_entry

Retrieve specific entries

create_entry

Create new content entries

update_entry

Modify existing entries

publish_entry

Publish entries (single or bulk)

unpublish_entry

Unpublish entries (single or bulk)

delete_entry

Remove entries

upload_asset

Upload new assets

list_assets

List and browse assets

get_asset

Retrieve specific assets

update_asset

Modify asset metadata

publish_asset

Publish assets (single or bulk)

unpublish_asset

Unpublish assets (single or bulk)

delete_asset

Remove assets

list_spaces

List available spaces

get_space

Get space details

list_environments

List environments

create_environment

Create new environments

delete_environment

Remove environments

list_locales

List all locales in your environment

get_locale

Retrieve specific locale information

create_locale

Create new locales for multi-language content

update_locale

Modify existing locale settings

delete_locale

Remove locales from environment

list_tags

List all tags

create_tag

Create new tags

create_ai_action

Create custom AI-powered workflows

invoke_ai_action

Invoke an AI action with variables

get_ai_action_invocation

Get AI action invocation details

get_ai_action

Retrieve AI action details and configuration

list_ai_actions

List AI actions in a space

update_ai_action

Update existing AI actions

publish_ai_action

Publish AI actions for use

unpublish_ai_action

Unpublish AI actions

delete_ai_action

Remove AI actions