Contentful MCP Server: Read Update Delete Publish
Manage Contentful content: read, update, delete, and publish across your spaces using this MCP server.
npx -y @ivo-toby/contentful-mcpOverview
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:
# configure environment variables (see below)
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):
Docker usage:
# build
# run
API Endpoints
Below is a concise list of commonly provided endpoints. Adjust paths if you use different configuration or prefixing.
| Method | Path | Description |
|---|---|---|
| GET | /spaces/:spaceKey/entries/:entryId | Read an entry |
| GET | /spaces/:spaceKey/assets/:assetId | Read an asset |
| GET | /spaces/:spaceKey/contentTypes | List content types |
| PUT | /spaces/:spaceKey/entries/:entryId | Update an entry (full replace) |
| PATCH | /spaces/:spaceKey/entries/:entryId | Update an entry (partial) |
| DELETE | /spaces/:spaceKey/entries/:entryId | Delete an entry |
| POST | /spaces/:spaceKey/entries/:entryId/publish | Publish an entry |
| POST | /spaces/:spaceKey/entries/:entryId/unpublish | Unpublish an entry |
| POST | /spaces/:spaceKey/publish | Batch publish by filter (optional) |
Example curl — read an entry:
Example curl — update an entry (PATCH):
Example curl — 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.