@contentful/mcp-tools
A toolkit package containing reusable MCP (Model Context Protocol) tools for Contentful. This package provides structured tool collections with complete metadata including descriptions, input schemas, semantic annotations, and tool implementations.
Installation
npm install @contentful/mcp-tools
Usage
Using Tool Collections
The package exports tool collections organized by category. Each tool in a collection includes:
title: The tool namedescription: What the tool doesinputParams: Zod schema or raw shape for input validationannotations: Semantic hints about tool behavior (readOnly, destructive, idempotent, openWorld)tool: The actual tool implementation function
import { ContentfulMcpTools } from '@contentful/mcp-tools';
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
const server = new McpServer({ name: 'my-contentful-mcp', version: '1.0.0' });
const tools = new ContentfulMcpTools({
accessToken: '<management-token>',
mcpVersion: '1.0.0',
});
// Register a specific tool
const { searchEntries } = tools.getEntryTools();
server.registerTool(
searchEntries.title,
{
description: searchEntries.description,
inputSchema: searchEntries.inputParams,
annotations: searchEntries.annotations,
},
searchEntries.tool,
);
// Register all tools from a collection
Object.values(tools.getAssetTools()).forEach((toolConfig) => {
server.registerTool(
toolConfig.title,
{
description: toolConfig.description,
inputSchema: toolConfig.inputParams,
annotations: toolConfig.annotations,
},
toolConfig.tool,
);
});
Data Assembly write inputs
create_data_assembly takes editable configuration without sys, dataType, or
variant. The API generates sys.id and infers sys.dataType from return.
parameters is an ordered array of declarations with stable id and explicit
boolean required. Updates that omit parameters require a canonical array from
the current GET response and retain server metadata. Coordinate canonical GET
coverage and tool distribution before releasing this array-only contract.
This is a breaking input change: callers still passing top-level sys, dataType,
or variant receive a validation error. Remove those arguments when upgrading.
Nested ResourceLink sys objects remain part of the configuration.
ContentfulMcpTools.getDataAssemblyTools() exposes these tools to MCP hosts.
The local server registers ExO tools only when ENABLE_EXO_TOOLS is enabled and
the organization has the exoM1 entitlement. The remote server also requires
the exoM1 entitlement.
{
"spaceId": "my-space",
"environmentId": "master",
"name": "Page title",
"description": "A static page title",
"parameters": [{ "id": "title", "type": "String", "required": false }],
"resolvers": {},
"return": { "$object": { "title": { "$literal": "Hello" } } }
}
update_data_assembly takes the assembly ID and the current sys.version from
get_data_assembly. Omitted editable fields retain their current values.
{
"spaceId": "my-space",
"environmentId": "master",
"dataAssemblyId": "the-created-sys-id",
"version": 3,
"name": "Updated page title"
}
Available Tool Collections
Collections come from ContentfulMcpTools getters such as getEntryTools(),
getAssetTools(), getContentTypeTools(), getReleaseTools(), and
getDataAssemblyTools(). ExO collections are registered by each server only
when its access gates pass.
Tool Annotations
Each tool includes semantic annotations to help MCP clients understand tool behavior:
readOnlyHint:trueif the tool only reads data without modificationsdestructiveHint:trueif the tool permanently deletes or removes dataidempotentHint:trueif calling the tool multiple times with the same input produces the same resultopenWorldHint:trueif the tool interacts with external services or systems beyond Contentful
🛠️ Available Tools
| Category | Tool Name | Description |
|---|---|---|
| Context & Setup | get_initial_context | Initialize connection and get usage instructions |
| Content Types | list_content_types | List content types (max 10 per request) |
get_content_type | Get detailed content type information | |
create_content_type | Create new content types | |
update_content_type | Modify existing content types | |
publish_content_type | Publish content type changes | |
unpublish_content_type | Unpublish content types | |
delete_content_type | Remove content types | |
| Entries | search_entries | Search and filter entries in your space |
get_entry | Retrieve specific entries | |
create_entry | Create new content entries with locale support | |
update_entry | Modify existing entries with locale support | |
patch_entry | Change specific field locales without resending the others (JSON Patch) | |
publish_entry | Publish entries (single or bulk up to 100) | |
unpublish_entry | Unpublish entries (single or bulk up to 100) | |
delete_entry | Remove entries | |
| Editor Interfaces | list_editor_interfaces | List all editor interfaces in a space |
get_editor_interface | Get editor interface for a content type | |
update_editor_interface | Update field controls, sidebars, and layouts | |
| Assets | upload_asset | Upload new assets |
list_assets | List and browse assets (max 3 per request) | |
get_asset | Retrieve specific assets | |
update_asset | Modify asset metadata | |
publish_asset | Publish assets (single or bulk up to 100) | |
unpublish_asset | Unpublish assets (single or bulk up to 100) | |
delete_asset | Remove assets | |
| Spaces & Environments | list_spaces | List available spaces (max 10 per request) |
get_space | Get space details | |
list_environments | List environments in a space | |
create_environment | Create new environments | |
delete_environment | Remove environments | |
| Locales | list_locales | List all locales in your environment |
get_locale | Retrieve specific locale information | |
create_locale | Create new locales for multi-language content | |
update_locale | Modify existing locale settings | |
delete_locale | Remove locales from environment | |
| Tags | list_tags | List all tags in an environment |
create_tag | Create new tags with public/private visibility | |
| Organizations | list_orgs | List organizations user has access to |
get_org | Get details of a specific organization | |
| Releases | list_releases | List releases (max 10 per request) |
get_release | Retrieve a release | |
create_release | Create a release with Entries/Assets | |
update_release | Modify a release's title and/or contents | |
delete_release | Remove a release (and its linked release actions) | |
publish_release | Publish a release (async; check via get_release_action) | |
unpublish_release | Unpublish a release (async; check via get_release_action) | |
validate_release | Validate a release, optionally against publish/unpublish | |
get_release_action | Check the status of a queued release action | |
list_release_actions | List release actions (max 10 per request) | |
schedule_publish_release | Schedule a release to publish at a future datetime (or reschedule) | |
schedule_unpublish_release | Schedule a release to unpublish at a future datetime (or reschedule) | |
cancel_scheduled_release | Cancel a scheduled release action (two-phase confirm) | |
list_scheduled_actions | List scheduled actions (max 10 per request) | |
| Data Assemblies (ExO) | get_data_assembly | Get an assembly and its current version |
get_published_data_assembly | Get the published assembly | |
list_data_assemblies | List assemblies | |
list_published_data_assemblies | List published assemblies | |
create_data_assembly | Create with a sys-free body and API-generated ID | |
update_data_assembly | Update with a sys-free body and current version | |
delete_data_assembly | Delete an assembly | |
publish_data_assembly | Publish an assembly | |
unpublish_data_assembly | Unpublish an assembly | |
| AI Actions | create_ai_action | Create custom AI-powered workflows |
invoke_ai_action | Invoke AI action with variables (bulk support) | |
get_ai_action_invocation | Get AI action invocation details | |
get_ai_action | Retrieve AI action details and configuration | |
list_ai_actions | List AI actions in a space (max 3 per request) | |
update_ai_action | Update existing AI actions | |
publish_ai_action | Publish AI actions for use | |
unpublish_ai_action | Unpublish AI actions | |
delete_ai_action | Remove AI actions | |
| Taxonomy Concepts | create_concept | Create new taxonomy concepts with localization |
get_concept | Retrieve specific taxonomy concept | |
list_concepts | List concepts with filtering and hierarchy | |
update_concept | Update taxonomy concept properties | |
delete_concept | Remove taxonomy concepts | |
| Taxonomy Schemes | create_concept_scheme | Create new taxonomy concept schemes |
get_concept_scheme | Retrieve specific concept scheme | |
list_concept_schemes | List concept schemes with pagination | |
update_concept_scheme | Update concept scheme properties | |
delete_concept_scheme | Remove concept schemes | |
| Space Migration | space_to_space_migration_handler | Enable/disable space migration workflow |
space_to_space_param_collection | Collect parameters for migration workflow | |
export_space | Export space to file for migration | |
import_space | Import space from exported file | |
| Usage | get_usages | Get aggregated usage metrics for an organization, optionally filtered or grouped by space |
Configuration
The tools require environment variables to be configured:
CONTENTFUL_MANAGEMENT_ACCESS_TOKEN=your_token_here
CONTENTFUL_HOST=api.contentful.com
SPACE_ID=your_space_id
ENVIRONMENT_ID=master
Testing
All tools include comprehensive unit tests. Run tests with:
npm test
License
MIT