CO

Contentful MCP Server: Read Update Delete Publish

Manage Contentful content: read, update, delete, and publish across your spaces using this MCP server.

Quick Install
npx -y @ivo-toby/contentful-mcp

Overview

This MCP (Model Context Protocol) server provides a lightweight HTTP interface to manage Contentful content programmatically. It wraps common Contentful Management API actions—read, update, delete and publish—behind a simple REST layer and supports operating across multiple Contentful spaces and environments. It’s intended for developers who want an easy, scriptable bridge between automation tools (or LLM-driven agents using MCP) and Contentful.

The server authenticates using a Contentful Management token, accepts requests to operate on entries and assets, and can be configured to target different spaces or environments. Use it to automate content workflows, implement integration tests against preview spaces, or give tools model-aware access to live content without embedding Management API logic everywhere.

Features

  • Read entries, assets, content types and locales from any configured Contentful space
  • Update entries and assets with partial or full payloads (patch/put)
  • Delete entries and assets
  • Publish and unpublish entries and assets
  • Support for multiple spaces and environments via configuration
  • Simple REST endpoints suitable for MCP integrations and automation scripts
  • Optional dry-run mode for testing changes before applying them
  • Docker-friendly: run as a container in CI or deployment pipelines

Installation / Configuration

Requirements: Node.js 16+ and a Contentful Management token with the necessary permissions for target spaces.

Install and run locally:

git clone https://github.com/ivo-toby/contentful-mcp.git
cd contentful-mcp
npm install
# configure environment variables (see below)
npm start

Environment variables (examples):

# required
CONTENTFUL_MANAGEMENT_TOKEN=your-management-token

# optional
PORT=3000
CONFIG_PATH=./config/spaces.json
DEFAULT_ENVIRONMENT=master
DRY_RUN=false

Example config file (config/spaces.json):

{
  "spaces": {
    "marketing": {
      "spaceId": "abcd1234marketing",
      "environment": "master"
    },
    "staging": {
      "spaceId": "wxyz9876staging",
      "environment": "staging"
    }
  }
}

Docker usage:

# build
docker build -t contentful-mcp .

# run
docker run -e CONTENTFUL_MANAGEMENT_TOKEN=token -e PORT=3000 -p 3000:3000 contentful-mcp

API Endpoints

Below is a concise list of commonly provided endpoints. Adjust paths if you use different configuration or prefixing.

MethodPathDescription
GET/spaces/:spaceKey/entries/:entryIdRead an entry
GET/spaces/:spaceKey/assets/:assetIdRead an asset
GET/spaces/:spaceKey/contentTypesList content types
PUT/spaces/:spaceKey/entries/:entryIdUpdate an entry (full replace)
PATCH/spaces/:spaceKey/entries/:entryIdUpdate an entry (partial)
DELETE/spaces/:spaceKey/entries/:entryIdDelete an entry
POST/spaces/:spaceKey/entries/:entryId/publishPublish an entry
POST/spaces/:spaceKey/entries/:entryId/unpublishUnpublish an entry
POST/spaces/:spaceKey/publishBatch publish by filter (optional)

Example curl — read an entry:

curl "http://localhost:3000/spaces/marketing/entries/entryId123"

Example curl — update an entry (PATCH):

curl -X PATCH "http://localhost:3000/spaces/marketing/entries/entryId123" \
  -H "Content-Type: application/json" \
  -d '{"fields": {"title": {"en-US": "New Title"}}}}'

Example curl — publish:

curl -X POST "http://localhost:3000/spaces/marketing/entries/entryId123/publish"

Note: The server maps spaceKey (e.g., marketing, staging) to spaceId and environment from the config file.

Available Resources

  • GitHub repository: https://github.com/ivo-toby/contentful-mcp
  • Contentful Management API docs: https://www.contentful.com/developers/docs/references/content-management-api/
  • MCP (Model Context Protocol) integrations and specifications: link to your MCP client/agent library or docs (if applicable)

If your installation exposes a health endpoint (e.g., /health) the server will report status and configured spaces.

Use Cases

  • Automated publishing workflows
    • A CI job prepares content in a staging space and calls the server to publish entries automatically after validation.
  • Cross-space content propagation
    • Copy or sync specific entries/assets from one space to another by reading from a source space and posting to a target space using the server as an intermediary.
  • Integration testing and QA
    • Run tests against a preview environment: reset state, create test entries, run assertions, and then clean up by deleting/unpublishing via the server.
  • LLM / agent-driven content updates
    • An LLM using MCP can request context (read) and then instruct the server to update or publish entries based on generated edits, without the model needing direct Contentful API credentials.
  • Bulk operations with safety
    • Use dry-run mode or a staging space to preview batch updates before applying them to production.

Best Practices

  • Use a dedicated Contentful Management token scoped only to the spaces and actions required.
  • Keep production space keys separate and protect configuration files in CI/CD.
  • Prefer PATCH for small updates to avoid overwriting unrelated fields.
  • Use dry-run in automated scripts when performing large batch operations.

If you need custom behavior (e.g., content type validation, migration logic, or rate-limit handling), extend the server by adding middleware or new route handlers in the repository.