Model Context Protocol (MCP) server
Table of contents
- Overview
- Remote vs local at a glance
- Choose your region (global vs. EU)
- Connect to Contentful MCP server
- Manage MCP client sessions
- Configure access per space and environment (Marketplace app)
- Upload assets through the remote server
- Run a local MCP server
- Troubleshoot OAuth and connection issues
- 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. - A local, open‑source MCP server you can run in your own environment.
Both servers expose the same core toolset; they differ in how clients authenticate and how access is gated. If you’re evaluating which to use, see Remote vs local at a glance below.
Remote vs local at a glance
| Remote MCP server | Local MCP server | |
|---|---|---|
| Endpoint | Hosted by Contentful at https://mcp.contentful.com/mcp |
You run it yourself (Node.js / npx @contentful/mcp-server) |
| Authentication | OAuth 2.1 — users sign in to Contentful through the client | Contentful Management API personal access token (PAT) supplied via environment variables |
| User identity | Each user connects with their own Contentful identity | All tool calls run as the identity that owns the PAT |
| Permission gating | Two layers: (1) the user’s own Contentful permissions, and (2) a per‑space/per‑environment allow‑list managed by the Contentful MCP app (see Configure access per space and environment) | Single layer: whatever the supplied PAT can do. There is no per‑space, per‑environment, or per‑tool gating beyond the PAT itself |
| Space/environment scope | Selected per session in the OAuth tenant configuration UI; can include multiple spaces/environments | Any space/environment the PAT can reach. SPACE_ID and ENVIRONMENT_ID environment variables are optional defaults the agent uses for context — every tool call still takes spaceId and environmentId arguments and can target a different space/env |
| Setup effort | Zero infrastructure — just point a client at the URL | You provision a PAT and run the process locally (or in your own infra) |
| Best for | Day‑to‑day use across teams; environments where central admins want to control which tools are exposed | Local development, scripting, CI, or environments where you can’t use OAuth |
Choose your region (global vs. EU)
Contentful runs the remote MCP server in two regions. Pick the endpoint that matches your organization's data residency requirements and use it everywhere you'd otherwise use the global URL.
| Region | MCP endpoint | CMA routing | Sign-in |
|---|---|---|---|
| Global | https://mcp.contentful.com/mcp |
api.contentful.com |
be.contentful.com |
| EU | https://mcp.eu.contentful.com/mcp |
api.eu.contentful.com |
be.eu.contentful.com |
If your Contentful organization is provisioned in the EU region, use the EU endpoint so that authentication and all Content Management API calls stay within EU infrastructure. The region is fixed by the endpoint you connect to — there is no in-session switch. To move between regions, connect a client to the other endpoint.
https://mcp.contentful.com/mcp. EU customers should substitute https://mcp.eu.contentful.com/mcp in every client configuration snippet below.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.
To use the remote MCP server from Windsurf, add the server to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"contentful": {
"serverUrl": "https://mcp.contentful.com/mcp"
}
}
}
Then open Windsurf's MCP settings and refresh the server. Windsurf will:
- Detect that the server requires OAuth.
- Open your browser to sign in to Contentful.
- Let you select which spaces and environments to connect before returning an MCP token scoped to those selections.
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)
The remote MCP server enforces a per‑environment permission layer through the Contentful MCP app. This lets admins decide exactly which tool categories are available in each environment, independent of the client being used. The app doesn't replace a user’s underlying Contentful permissions — it sits on top of them as an additional allow‑list.
https://mcp.contentful.com/mcp. Conversely, the remote server cannot be used in a space/environment until the MCP app is installed and configured there. The app is available directly in the Marketplace, and it is also installed automatically when an admin completes the tenant configuration UI for a space/environment (see below).Space/environment‑level configuration
For each environment where you want to use the remote MCP server:
- The Contentful MCP app must be installed into the space and environment. You can install it directly from the Marketplace, or it is installed through the tenant configuration UI the first time an admin connects (see How configuration works during connection).
- 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 already installed, its existing configuration determines available tools.
- If the MCP app is not installed and you have admin permissions, completing the configuration UI installs the app for you with the settings you choose.
- 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 and your underlying Contentful permissions
- The current space/environment
- The MCP app configuration for that environment.
Upload assets through the remote server
MCP tool calls are JSON over HTTP, so binary files (images, PDFs, and other media) can't be sent through a normal tool call. The remote server uses a two-phase upload:
- Stage the raw bytes.
- Bind them to a Contentful asset.
To upload assets through the remote server:
- Create an upload session. Call the
create_upload_sessiontool (no arguments). It returns a short-lived session:
{
"uploadHandle": "9f2c…",
"uploadUrl": "https://mcp.contentful.com/uploads/9f2c…",
"expiresAt": "2026-06-08T13:00:00.000Z"
}
- Upload the bytes.
PUTthe raw file bytes to the returneduploadUrlwith aContent-Lengthheader. This endpoint is intentionally unauthenticated — theuploadHandleitself is the capability token, so treat it like a secret:
curl -X PUT "https://mcp.contentful.com/uploads/9f2c…" \
--data-binary @image.png \
-H "Content-Length: $(wc -c < image.png)"
- Create the asset. Call the
upload_assettool with the handle so the server retrieves the staged bytes and creates the Contentful asset:
{
"spaceId": "<<YOUR_SPACE_ID>>",
"environmentId": "master",
"file": {
"uploadHandle": "9f2c…",
"fileName": "image.png",
"contentType": "image/png"
}
}
Upload sessions expire one hour after creation and are single-use — once an asset is created from a handle (or the handle expires), the handle can't be reused. Create a fresh session for each upload.
create_upload_session entirely. Attach the file to the conversation and call upload_asset directly — ChatGPT passes the file to the server for you.uploadUrl returned by create_upload_session is absolute and already points at the correct host (for example https://mcp.eu.contentful.com/uploads/<handle>), so always PUT to the URL the tool returns rather than constructing it yourself.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 on your own machine or infrastructure.
- Authenticates with a Contentful Management API personal access token (PAT) that you supply via environment variables — there is no OAuth flow.
- Can address any space and environment the PAT has access to.
SPACE_IDandENVIRONMENT_IDare optional environment variables that act as default context for the agent (surfaced viaget_initial_context); every tool call still acceptsspaceIdandenvironmentIdarguments and can target a different space or environment within the same process. - Exposes the same core toolset as the remote server, but doesn't use the Contentful MCP app for permission gating. Every tool call runs as the PAT’s owner, with whatever permissions that PAT has — there is no per‑environment or per‑tool allow‑list. Treat the PAT itself as the security boundary, and prefer a token scoped to the minimum permissions you need.
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).
Troubleshoot OAuth and connection issues
Most remote-server problems come down to authentication or per-environment configuration. Work through these common pitfalls first if you are having trouble connecting:
A tool you expect returns a "not allowed" error : Tool availability is gated per environment by the Contentful MCP app, on top of your own Contentful permissions. If a tool is being blocked because of your permissions configuration, that tool category has likely not been authorized for that space/environment. Try updating the app's configuration, then re-run the connection flow. See Configure access per space and environment.
The browser never opens, or sign-in fails : Your client may have cached a stale or revoked token. Remove and re-add the Contentful MCP server in your client so it re-runs the OAuth flow from scratch.
You're an EU customer and calls fail or route to the wrong region : Make sure every client snippet points at
https://mcp.eu.contentful.com/mcp, not the global endpoint. Region is determined by the endpoint you connect to — see Choose your region (global vs. EU).You get a
Failed to fetch app installation: Forbiddenerror when running tools : The most common cause is using an environment alias. Environment aliases are not currently supported. Connect to and reference the underlying environment ID directly instead of the alias.Make sure to select a space and environment every time you connect : Even when the MCP app is already installed in an environment, each new connection's configuration screen requires you to select the space/environment pair(s) for that session. Selecting them again does not reinstall or reconfigure the app — it scopes the current session. If you skip this, the session has nothing to operate on.
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 | Tools | Description |
|---|---|---|
| Context & Setup | get_initial_context |
Initialize connection and return usage instructions. |
| Entries | search_entries, semantic_search, get_entry, create_entry, update_entry, publish_entry, unpublish_entry, archive_entry, unarchive_entry, delete_entry, get_entry_snapshot, resolve_entry_references |
Manage content entries end‑to‑end, including semantic search, archiving, version snapshots, and reference resolution. |
| Content Types | list_content_types, get_content_type, create_content_type, update_content_type, publish_content_type, unpublish_content_type, delete_content_type, delete_content_type_field, disable_content_type_field, omit_content_type_field |
Inspect and evolve your content model, including field‑level changes. |
| Assets | upload_asset, create_upload_session, list_assets, get_asset, update_asset, publish_asset, unpublish_asset, archive_asset, unarchive_asset, delete_asset |
Upload, organize, archive, and publish media assets. |
| Spaces & Environments | list_spaces, get_space, list_environments, create_environment, delete_environment |
Discover and manage spaces and environments. |
| Organizations | list_orgs, get_org |
Discover the organizations your identity can access. |
| 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. |
| Taxonomy | list_concepts, get_concept, create_concept, update_concept, delete_concept, list_concept_schemes, get_concept_scheme, create_concept_scheme, update_concept_scheme, delete_concept_scheme |
Manage concepts and concept schemes in the taxonomy system. |
| Editor Interfaces | get_editor_interface, list_editor_interfaces, update_editor_interface |
Inspect and configure how fields appear in the entry editor. |
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.