Contentful MCP
Contentful MCP Server enables AI assistants to create, manage, and publish content in Contentful efficiently. It offers tools for content types, entries, assets, locales, tags, and AI-powered workflows.
How to Install and Use Contentful MCP
Contentful MCP (Model Context Protocol) is a tool that helps AI assistants work with Contentful APIs. It allows you to easily create, manage, and publish content in Contentful using simple and natural commands.
Step 1: Prerequisites
Before you install Contentful MCP, make sure you have a few things ready. You will need Node.js and npm (these help run JavaScript programs on your computer). Also, you need a Contentful account with a Space ID (your content area) and a Contentful Management API personal access token (a key to access Contentful).
Once these are set, you can move on to installation.
Step 2: Install Contentful MCP
There are two ways to install Contentful MCP: using a one-click install with Cursor or by installing from the source code.
Option 1: One-Click Install
If you have Cursor installed, you can install Contentful MCP easily with this link:
Install Contentful MCP on Cursor
This link sets up everything with your Contentful information automatically.
Option 2: Install from Source
If you want more control, you can install Contentful MCP by cloning the project and installing it manually. Open your terminal and run these commands:
git clone https://github.com/contentful/contentful-mcp-server.git
cd contentful-mcp-server
npm install
npm run build
This downloads the program, adds all needed parts, and builds it for use.
Step 3: Set Environment Variables
To use Contentful MCP, you must give it some settings through environment variables. These tell it how to connect to Contentful. Here are the important ones:
CONTENTFUL_MANAGEMENT_ACCESS_TOKEN(required): Your Contentful API access token.SPACE_ID(required): Your Contentful space ID.ENVIRONMENT_ID(optional): Environment inside your space; default ismaster.CONTENTFUL_HOST(optional): API host, default isapi.contentful.com.NODE_ENV(optional): Run mode, default isproduction.
You must provide your token and space ID for the setup to work.
Step 4: Configure Your AI Tool
After installing and setting environment variables, you need to configure your AI tool to use Contentful MCP.
Here is an example configuration in JSON format:
{
"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"
}
}
}
}
Replace "your-CMA-token" and "your-space-id" with your actual Contentful token and space ID. This setup helps your AI assistant communicate with Contentful through MCP.
By following these steps, you’ll have Contentful MCP installed and ready to help you manage your Contentful content in a smart and easy way.