Labsco
ivo-toby logo

Contentful

โ˜… 61

from ivo-toby

Interact with your content on the Contentful platform

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedAccount requiredNeeds API keys
<img width="700" src="https://images.ctfassets.net/jtqsy5pye0zd/6wNuQ2xMvbw134rccObi0q/bf61badc6d6d9780609e541713f0bba6/Contentful_Logo_2.5_Dark.svg?w=700&q=100" alt="Contentful MCP server"/>

Contentful MCP Server

Notice

This is a community driven server! Contentful has released an official server which you can find here

smithery badge

An MCP server implementation that integrates with Contentful's Content Management API, providing comprehensive content management capabilities.

  • Please note *; if you are not interested in the code, and just want to use this MCP in Claude Desktop (or any other tool that is able to use MCP servers) you don't have to clone this repo, you can just set it up in Claude desktop, refer to the section "Usage with Claude Desktop" for instructions on how to install it.

<a href="https://glama.ai/mcp/servers/l2fxeaot4p"><img width="380" height="200" src="https://glama.ai/mcp/servers/l2fxeaot4p/badge" alt="contentful-mcp MCP server" /></a>

Features

  • Content Management: Full CRUD operations for entries and assets
  • Comment Management: Create, retrieve, and manage comments on entries with support for both 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 for multiple locales
  • Publishing: Control content publishing workflow
  • Bulk Operations: Execute bulk publishing, unpublishing, and validation across multiple entries and assets
  • Smart Pagination: List operations return maximum 3 items per request to prevent context window overflow, with built-in pagination support

Pagination

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:

  • Total number of available items
  • Current page of items (max 3)
  • Number of remaining items
  • Skip value for the next page
  • Message prompting the LLM to offer retrieving more items

This pagination system allows the LLM to efficiently handle large datasets while maintaining context window limits.

Bulk Operations

The bulk operations feature provides efficient management of multiple content items simultaneously:

  • Asynchronous Processing: Operations run asynchronously and provide status updates
  • Efficient Content Management: Process multiple entries or assets in a single API call
  • Status Tracking: Monitor progress with success and failure counts
  • Resource Optimization: Reduce API calls and improve performance for batch operations

These bulk operation tools are ideal for content migrations, mass updates, or batch publishing workflows.

Tools

Entry Management

  • search_entries: Search for entries using query parameters
  • create_entry: Create new entries
  • get_entry: Retrieve existing entries
  • update_entry: Update entry fields
  • delete_entry: Remove entries
  • publish_entry: Publish entries
  • unpublish_entry: Unpublish entries

Comment Management

  • get_comments: Retrieve comments for an entry with filtering by status (active, resolved, all)
  • create_comment: Create new comments on entries with support for both plain-text and rich-text formats. Supports threaded conversations by providing a parent comment ID to reply to existing comments
  • get_single_comment: Retrieve a specific comment by its ID for an entry
  • delete_comment: Delete a specific comment from an entry
  • update_comment: Update existing comments with new body content or status changes

Threaded Comments

Comments support threading functionality to enable structured conversations and work around the 512-character limit:

  • Reply to Comments: Use the parent parameter in create_comment to reply to an existing comment
  • Threaded Conversations: Build conversation trees by replying to specific comments
  • Extended Discussions: Work around the 512-character limit by creating threaded replies to continue longer messages
  • Conversation Context: Maintain context in discussions by organizing related comments in threads

Example usage:

  1. Create a main comment: create_comment with entryId, body, and status
  2. Reply to that comment: create_comment with entryId, body, status, and parent (the ID of the comment you're replying to)
  3. Continue the thread: Reply to any comment in the thread by using its ID as the parent

Bulk Operations

  • bulk_publish: Publish multiple entries and assets in a single operation. Accepts an array of entities (entries and assets) and processes their publication as a batch.
  • 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 multiple entries for content consistency, references, and required fields. Returns validation results without modifying content.

Asset Management

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

Space & Environment Management

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

Content Type Management

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

Development Tools

MCP Inspector

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

  • Inspect Mode: Run npm run inspect to start the inspector, you can open the inspector by going to 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 and see their responses immediately
  • Bulk Operations Testing: Test and monitor bulk operations with visual feedback on progress and results

The project also contains a npm run dev command which rebuilds and reloads the MCP server on every change.

Transport Modes

The MCP server supports two transport modes:

stdio Transport

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

StreamableHTTP Transport

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

StreamableHTTP Details

  • Uses the official MCP StreamableHTTP transport
  • Supports standard MCP protocol operations
  • Includes session management for maintaining state
  • Properly handles initialize/notify patterns
  • Compatible with standard MCP clients
  • Replaces the deprecated SSE transport with the 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 for:

  • Authentication failures
  • Rate limiting
  • Invalid requests
  • Network issues
  • API-specific errors

Verified on MseeP

License

MIT License

Fine print

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)