by ivo-toby
contentful-mcp is an MCP (Model Context Protocol) server that integrates with the Contentful Management API. It enables comprehensive content management capabilities, allowing users to interact with Contentful spaces, entries, assets, and content types through an MCP client.
contentful-mcp is an MCP (Model Context Protocol) server specifically designed to integrate with the Contentful Management API. It enables comprehensive content management capabilities, allowing users to interact with their Contentful spaces, entries, assets, and content types through an MCP client like Claude Desktop.
contentful-mcp can be used in two primary ways:
contentful-mcp
into Claude Desktop by adding a few lines to your claude_desktop_config.json
file. This involves specifying npx
as the command and @ivotoby/contentful-management-mcp-server
as the argument, along with your Contentful Management Access Token. Smithery can also automate this installation.--http
flag, making it suitable for web-based integrations or other MCP clients that support StreamableHTTP transport.Configuration involves setting environment variables or command-line arguments for your Contentful API host and management access token. You can also scope operations to specific Contentful spaces and environments or use App Identity for authentication.
Q: Is contentful-mcp
officially supported by Contentful?
A: No, this MCP server is not officially supported by Contentful.
Q: What are the risks of using this MCP server? A: This MCP server enables MCP clients (like Claude) to update and delete content, spaces, and content models in your Contentful spaces. It is crucial to be aware of what actions you allow the MCP client to perform.
Q: How does contentful-mcp
handle large datasets with LLMs?
A: It implements smart pagination, limiting list operations to 3 items per request to prevent context window overflow in LLMs. It also provides information for the LLM to request more items as needed.
Q: Can I use contentful-mcp
without cloning the repository?
A: Yes, you can use npx
to directly run the MCP server without cloning the repository, especially when integrating with Claude Desktop.
An MCP server implementation that integrates with Contentful's Content Management API, providing comprehensive content management capabilities.
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:
This pagination system allows the LLM to efficiently handle large datasets while maintaining context window limits.
The bulk operations feature provides efficient management of multiple content items simultaneously:
These bulk operation tools are ideal for content migrations, mass updates, or batch publishing workflows.
The project includes an MCP Inspector tool that helps with development and debugging:
npm run inspect
to start the inspector, you can open the inspector by going to http://localhost:5173npm run inspect:watch
to automatically restart the inspector when files changeThe project also contains a npm run dev
command which rebuilds and reloads the MCP server on every change.
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 tokenENABLE_HTTP_SERVER
/ --http
: Set to "true" to enable HTTP/SSE modeHTTP_PORT
/ --port
: Port for HTTP server (default: 3000)HTTP_HOST
/ --http-host
: Host for HTTP server (default: localhost)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
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)
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"
]
}
}
}
To install Contentful Management Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @ivotoby/contentful-management-mcp-server --client claude
If you want to contribute and test what Claude does with your contributions;
npm run dev
, this will start the watcher that rebuilds the MCP server on every changeclaude_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
The MCP server supports two transport modes:
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
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
The implementation follows the standard MCP protocol specification, allowing any MCP client to connect to the server without special handling.
The server implements comprehensive error handling for:
MIT License
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)
Reviews feature coming soon
Stay tuned for community discussions and feedback