Model Context Protocol (MCP) server
Table of contents
- Overview
- Connect to Contentful MCP server
- Manage MCP client sessions
- Configure access per space and environment (Marketplace app)
- Run a local MCP server
- Tools
- See also
Overview
Let your AI agents interact with Contentful by using our MCP servers.
The Contentful Model Context Protocol (MCP) servers provide tools that AI agents can use to read and write content, manage content models, work with assets, invoke AI Actions, and more, across your Contentful spaces and environments. Contentful offers:
- A remote, hosted MCP server at
https://mcp.contentful.com/mcp(Beta). - A local, open‑source MCP server you can run in your own environment.
Connect to Contentful MCP server
Use the remote server if you want a zero‑infrastructure setup that works with popular MCP‑aware clients. All examples below use:
https://mcp.contentful.com/mcp
{
"mcpServers": {
"contentful": {
"url": "https://mcp.contentful.com/mcp"
}
}
}
When Cursor first connects:
- Cursor discovers that the server requires OAuth.
- You’re redirected to Contentful to sign in.
- After signing in, you’ll select which spaces and environments to connect (see “Configure access per space and environment” below).
To use Contentful MCP from GitHub Copilot Chat with MCP support, add the following to your workspace’s .vscode/mcp.json:
{
"servers": {
"contentful": {
"type": "http",
"url": "https://mcp.contentful.com/mcp"
}
}
}
VS Code will:
- Discover the MCP server at
https://mcp.contentful.com/mcp. - Run the OAuth flow in your browser.
- Use the resulting token to call Contentful tools from Copilot Chat in your chosen environments.
To use the remote MCP server from Claude Code:
claude mcp add --transport http contentful https://mcp.contentful.com/mcp
Then start the MCP flow:
claude /mcp
Claude opens a browser window for:
- Signing in to Contentful.
- Selecting the spaces and environments you want Claude to access.
- Completing OAuth and returning to Claude with an MCP token scoped to those selections.
You can enable MCP servers on ChatGPT (Pro, Plus, Business, Enterprise, or Education). Follow the OpenAI documentation for adding a custom MCP server and use:
- Server URL:
https://mcp.contentful.com/mcp - Connection mechanism: OAuth
After you configure the server:
- ChatGPT starts an OAuth flow in your browser.
- You sign in to Contentful and choose which spaces/environments ChatGPT can work with.
- The MCP session is then authorized only for those environments and tools you’ve enabled via the MCP marketplace app.
MCP is an open protocol supported by many clients. For any HTTP‑based MCP client:
- Server URL:
https://mcp.contentful.com/mcp - Transport: HTTP MCP base protocol
- Auth: OAuth (recommended)
Manage MCP client sessions
The remote MCP server uses OAuth to connect clients to Contentful, following the MCP authorization spec for HTTP transports.
When you add the Contentful MCP server to a client:
- The client opens an OAuth consent flow in your browser.
- You approve the client and select which spaces/environments are in scope for the session.
- The MCP server exchanges the authorization code for an access token and issues an MCP‑specific token for subsequent tool calls.
You can:
- Re‑run the connection flow to update which environments are attached to a session.
Configure access per space and environment (Marketplace app)
Contentful adds a per‑environment permission layer via the Contentful MCP app in the Marketplace. This lets admins decide exactly which tools are available in each environment, independent of the client being used.
Space/environment‑level configuration
For each environment where you want MCP:
- Install the Contentful MCP app into the space and environment from the Marketplace.
- Open the app’s configuration screen.
- Select the tool categories that you would like to be allowed for that environment (for example: entries, assets, content types, environments, AI Actions).
- For the selected tool categories, select either read‑only or read/write.
At runtime:
- The remote MCP server looks up the MCP app configuration for the space + environment currently in use.
- Only tools enabled in that config are exposed to MCP clients; disabled tools are rejected even if a client tries to call them directly.
- All users connecting to that environment via the remote MCP server share the same allow‑list, but are still subject to their own underlying Contentful permissions.
How configuration works during connection
When a client first connects to https://mcp.contentful.com/mcp and completes OAuth:
You see a tenant configuration UI hosted by Contentful.
You select one or more space/environment pairs for the session (for example:
space A / master,space B / staging).For each selected environment:
- If the MCP app is installed, its config is used to determine available tools.
- If the MCP app is not installed and you have permissions, the flow can install it with the configuration you specify.
- If you lack installation permissions, you’ll be prompted to ask an admin to install and configure the app.
- These selections are stored in the MCP session, and every tool call is evaluated against:
- Your identity
- The current space/environment
- The MCP app configuration for that environment.
Run a local MCP server
If you prefer or require a local setup, use the local Contentful MCP server from our open‑source repository:
The local server:
- Runs as a Node.js application.
- Uses a Contentful Management API personal access token (PAT) and a target space/environment.
- Exposes the same core toolset as the remote server, without Marketplace‑based enablements (you control access via the token you provide).
Add this to your ~/.cursor/mcp.json:
{
"mcpServers": {
"contentful-local": {
"command": "npx",
"args": ["-y", "@contentful/mcp-server"],
"env": {
"CONTENTFUL_MANAGEMENT_ACCESS_TOKEN": "<<YOUR_CMA_PAT>>",
"SPACE_ID": "<<YOUR_SPACE_ID>>",
"ENVIRONMENT_ID": "master",
"CONTENTFUL_HOST": "api.contentful.com"
}
}
}
}
For GitHub Copilot Chat with MCP support, add to .vscode/mcp.json:
{
"servers": {
"contentful-local": {
"command": "npx",
"args": ["-y", "@contentful/mcp-server"],
"env": {
"CONTENTFUL_MANAGEMENT_ACCESS_TOKEN": "<<YOUR_CMA_PAT>>",
"SPACE_ID": "<<YOUR_SPACE_ID>>",
"ENVIRONMENT_ID": "master",
"CONTENTFUL_HOST": "api.contentful.com"
}
}
}
}
For other local‑execution MCP clients (Windsurf, Claude Desktop, etc.), configure a server entry that:
- Runs
npx -y @contentful/mcp-server(or your built binary). - Supplies the same environment variables (
CONTENTFUL_MANAGEMENT_ACCESS_TOKEN,SPACE_ID,ENVIRONMENT_ID,CONTENTFUL_HOST).
Tools
The Contentful MCP servers expose the following tool categories. The remote server filters these per environment based on MCP app configuration; the local server exposes all tools allowed by your token.
| Resource / Domain | Example tools | Description |
|---|---|---|
| Context & Setup | get_initial_context |
Initialize connection and return usage instructions. |
| Entries | search_entries, get_entry, create_entry, update_entry, publish_entry, unpublish_entry, delete_entry |
Manage content entries end‑to‑end. |
| Content Types | list_content_types, get_content_type, create_content_type, update_content_type, publish_content_type, unpublish_content_type, delete_content_type |
Inspect and evolve your content model. |
| Assets | upload_asset, list_assets, get_asset, update_asset, publish_asset, unpublish_asset, delete_asset |
Upload, organize, and publish media assets. |
| Spaces & Environments | list_spaces, get_space, list_environments, create_environment, delete_environment |
Discover and manage spaces and environments. |
| Locales | list_locales, get_locale, create_locale, update_locale, delete_locale |
Configure and manage locales for multi‑language content. |
| Tags | list_tags, create_tag |
Work with tags for organizing content. |
| AI Actions | create_ai_action, invoke_ai_action, get_ai_action, get_ai_action_invocation, list_ai_actions, update_ai_action, publish_ai_action, unpublish_ai_action, delete_ai_action |
Create and invoke AI‑powered workflows with Contentful AI Actions. |
See also
Contentful MCP server (open source) – GitHub repository and README with full tool list and examples.
Model Context Protocol: The new AI connection standard – Blog post introducing MCP and how to use it with Contentful.