SuperAPIAI Directory

contentful-mcp

github.com · AI developer platforms

Create, update and delete content, content models and assets in a Contentful space.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)

About this tool

contentful-mcp is a community-driven MCP (Model Context Protocol) server for integrating with Contentful's Content Management API, providing comprehensive content management capabilities. If you only want to use it in Claude Desktop or other tools that support MCP servers, there is no need to clone the repository; you can refer to the "Usage with Claude Desktop" section for configuration.

Main Capabilities

Content Management: Full CRUD operations for entries and assets.

Comment Management: Create, retrieve, and manage comments on entries, supporting plain text and rich text formats, including threaded conversations.

Space Management: Create, update, and manage spaces and environments.

Content Types: Manage content type definitions.

Localization: Support multi-language environments.

Publishing: Control the content publishing workflow.

Bulk Operations: Perform bulk publish, unpublish, and validation across multiple entries and assets.

Smart Pagination: List operations return up to 3 items per request to prevent context window overflow, with built-in pagination support.

Pagination System

To prevent LLM context window overflow, list operations (such as search_entries and list_assets) are limited to 3 items per request. Each response includes: the total number of available items, the current page items (up to 3), the number of remaining items, the skip value for the next page, and a message prompting the LLM to retrieve more items. This system allows the LLM to efficiently handle large datasets while maintaining context window limits.

Bulk Operations

Bulk operation features efficiently manage multiple content items at the same time:

  • Asynchronous Processing: Operations run asynchronously and provide status updates.
  • Efficient Content Management: Handle multiple entries or assets in a single API call.
  • Status Tracking: Monitor progress through success and failure counts.
  • Resource Optimization: Reduce API calls and improve bulk operation performance.

These bulk operation tools are suitable for content migration, bulk updates, or bulk publishing workflows.

Tool List

Entry Management

  • search_entries: Search entries using query parameters
  • create_entry: Create a new entry
  • get_entry: Retrieve an existing entry
  • update_entry: Update entry fielSection
  • delete_entry: Delete entry
  • publish_entry: Publish entry
  • unpublish_entry: Unpublish entry

Comment Management

  • get_comments: Retrieve comments of an entry, filterable by status (active, resolved, all)
  • create_comment: Create a new comment on an entry, supporting plain text and rich text formats. Reply to an existing comment by providing the parent comment ID, supporting threaded conversations.
  • get_single_comment: Retrieve a specific comment of an entry by ID
  • delete_comment: Delete a specific comment from an entry
  • update_comment: Update the body content or status of an existing comment

Comments support threading to enable structured conversations and bypass the 512-character limit:

  • Reply to comments: Use the parent parameter in create_comment to reply to an existing comment
  • Threaded conversations: Build a conversation tree by replying to specific comments
  • Extended discussions: Continue longer messages by creating threaded replies, bypassing the 512-character limit
  • Conversation context: Maintain discussion context by organizing related comments in threads

Example flow: Create a main comment: call create_comment with entryId, body, and status; Reply to that comment: call create_comment with entryId, body, status, and parent (the ID of the comment being replied to); Continue the thread: reply using the ID of any comment in the thread as parent.

  • bulk_publish: Publish multiple entries and assets in a single operation. Accepts an array of entities (entries and assets) and processes their publication in bulk.
  • bulk_unpublish: Unpublish multiple entries and assets in a single operation. Similar to bulk_publish, but removes content from the Delivery API.
  • bulk_validate: Validate content consistency, references, and required fields for multiple entries. Returns validation results without modifying content.

Asset Management

  • list_assets: List assets with pagination (3 items per page)
  • upload_asset: Upload a new asset with metadata
  • get_asset: Retrieve asset details and information
  • update_asset: Update asset metadata and files
  • delete_asset: Delete an asset from a space
  • publish_asset: Publish an asset to the Delivery API
  • unpublish_asset: Unpublish an asset from the Delivery API

Space and Environment Management

  • list_spaces: List available spaces
  • get_space: Get space details
  • list_environments: List environments in a space
  • create_environment: Create a new environment
  • delete_environment: Delete an environment

Content Type Management

  • list_content_types: List available content types
  • get_content_type: Get content type details
  • create_content_type: Create a new content type
  • update_content_type: Update a content type
  • delete_content_type: Delete a content type
  • publish_content_type: Publish a content type

Development Tools

The project includes an MCP Inspector tool that helps with development and debugging:

  • Inspect mode: Run npm run inspect to start the inspector, which can be opened via http://localhost:5173 .
  • Watch mode: Use npm run inspect:watch to automatically restart the inspector when files change.
  • Visual interface: The inspector provides a web interface to test and debug MCP tools.
  • Real-time testing: Try out tools immediately and view their responses.
  • Bulk operation testing: Test and monitor bulk operations with visual feedback on progress and results.

The project also includes an npm run dev command that rebuilds and reloads the MCP server on every change.

Installation and Configuration

  1. Create an account on Contentful
  2. Generate a Content Management API token from account settings

Environment Variables

These variables can also be set as arguments:

  • CONTENTFUL_HOST / --host: Contentful Management API endpoint (default https://api.contentful.com)
  • CONTENTFUL_MANAGEMENT_ACCESS_TOKEN / --management-token: Your Content Management API token
  • ENABLE_HTTP_SERVER / --http: Set to "true" to enable HTTP/SSE mode
  • HTTP_PORT / --port: HTTP server port (default 3000)
  • HTTP_HOST / --http-host: HTTP server host (default localhost)
  • DISABLE_AI_ACTIONS: Set to "true" to disable fetching AI Actions at startup (useful if this feature is inaccessible)

Space and Environment Scoping

spaceId and EnvironmentId can be scoped to ensure the LLM only operates on defined space/environment IDs. This is primarily used to support agents running within a specific space. If both the SPACE_ID and ENVIRONMENT_ID environment variables are set, the tools will not report that these values are required, and the handlers will use the environment variables to perform CMA operations. You will also lose access to tools in space-handler because these tools are cross-space. SPACE_ID and ENVIRONMENT_ID can also be added via the parameters --space-id and --environment-id.

App Identity Authentication

In addition to providing a Management token, you can also use App Identity for authentication. You need to set up and install a Contentful App, and set the following parameters when calling the MCP server:

  • --app-id: The application ID that provides the Apptoken
  • --private-key: The private key created in the app UI and associated with app_id
  • --space-id: The space ID where the app is installed
  • --environment-id: The environment ID where the app is installed within the space

Using these values, the MCP server will request a temporary AppToken to perform content operations in the defined space/environment ID. This is especially useful for using this server as an MCP client in backend systems (such as chat agents).

In Claude Desktop

This MCP can be used without cloning this repository; simply add it to claude_desktop_config.json: Edit ~/Library/Application Support/Claude/claude_desktop_config.json and add the corresponding lines. If your MCP client does not support setting environment variables, you can also set the management token using parameters.

Install via Smithery

To automatically install Contentful Management Server for Claude Desktop via Smithery.

Development and Using Claude Desktop

If you want to contribute and test Claude's response to your contributions:

  • Run npm run dev, which will start a watcher and rebuild the MCP server on every change
  • Update claude_desktop_config.json to reference the project directly This allows you to test any modifications directly in the MCP server, but if you add new tools/resources, you need to restart Claude Desktop.

Transport Modes

The MCP server supports two transport modes:

stdio Transport

The default transport mode uses standard input/output streams for communication. It is ideal for integration with MCP clients that support stdio transport (such as Claude Desktop). To use stdio mode, simply run the server without the --http flag.

StreamableHTTP Transport

The server also supports the StreamableHTTP transport defined by the MCP protocol. This mode is suitable for web-based integrations or for running the server as a standalone service. To use StreamableHTTP mode, run with the --http flag.

  • Uses the official MCP StreamableHTTP transport
  • Supports standard MCP protocol operations
  • Includes session management to maintain state
  • Correctly handles the initialize/notify pattern
  • Compatible with standard MCP clients
  • Replaces the deprecated SSE transport with a modern approach

The implementation follows the standard MCP protocol specification, allowing any MCP client to connect to the server without special handling.

Error Handling

The server implements comprehensive error handling: authentication failures, invalid requests, API-specific errors.

Use Cases and Limitations

This MCP server enables Claude (or other agents that can consume MCP resources) to update and delete content, spaces, and content models. Therefore, please make sure you allow Claude to perform operations on your Contentful space!

This MCP server is not yet officially supported by Contentful. Contentful has released an official server, which can be found separately.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools