Was this page helpful?

Model Context Protocol (MCP) server

Table of contents

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:

  1. Cursor discovers that the server requires OAuth.
  2. You’re redirected to Contentful to sign in.
  3. 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:

  1. Discover the MCP server at https://mcp.contentful.com/mcp.
  2. Run the OAuth flow in your browser.
  3. 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:

  1. Signing in to Contentful.
  2. Selecting the spaces and environments you want Claude to access.
  3. 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:

  1. ChatGPT starts an OAuth flow in your browser.
  2. You sign in to Contentful and choose which spaces/environments ChatGPT can work with.
  3. 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:

  1. The client opens an OAuth consent flow in your browser.
  2. You approve the client and select which spaces/environments are in scope for the session.
  3. 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:

  1. Install the Contentful MCP app into the space and environment from the Marketplace.
  2. Open the app’s configuration screen.
  3. Select the tool categories that you would like to be allowed for that environment (for example: entries, assets, content types, environments, AI Actions).
  4. 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:

  1. You see a tenant configuration UI hosted by Contentful.

  2. You select one or more space/environment pairs for the session (for example: space A / master, space B / staging).

  3. 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.
  1. 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.
Security note: When using the remote MCP server, we recommend enabling human confirmation of tool calls in your client wherever possible, and starting with read‑only enablements in the MCP app before turning on write capabilities.

See also