跳过安装。2 分钟内即可运行。
在 cloud.anythingmcp.com 开始免费试用,一键添加 Contentful,然后将你的 AI 客户端(Claude、ChatGPT、Copilot 或 Cursor)指向生成的 MCP 端点。无需 Docker,无需 git clone,无需任何工程经验。
摘要
让你的 AI 处理 Contentful 中的内容:搜索条目和资源,读取内容类型、语言区域和标签,并创建、修改、发布或取消发布条目。读取使用 Delivery 令牌,写入使用 Management 令牌。
试试这样问
Contentful 的示例提示
点击任意提示即可复制,然后粘贴到 Claude、ChatGPT、Cursor、Gemini、Copilot 或 OpenClaw 中,在该连接器上运行。
Claude 是 AI,可能会出错。请核对回答。
💡 无需安装? 直接使用 cloud.anythingmcp.com。 登录、点击 Connectors → Contentful、粘贴凭证、生成 MCP API key,即可完成。无 Docker、无
git clone、无本地服务器。
Contentful + ChatGPT
让你的 AI 处理 Contentful 中的内容:搜索条目和资源,读取内容类型、语言区域和标签,并创建、修改、发布或取消发布条目。读取使用 Delivery 令牌,写入使用 Management 令牌。
前提条件
完整的设置说明已内置在连接器中 (在 store 中选择连接器时可见)。所需环境变量:
CONTENTFUL_SPACE_ID, CONTENTFUL_ENVIRONMENT, CONTENTFUL_DELIVERY_URL, CONTENTFUL_DELIVERY_TOKEN
步骤 1 — 获取凭证
- 在 Contentful(
https://app.contentful.com)中打开你的空间,然后进入 Settings → API keys → Add API key。为密钥命名(例如 "AnythingMCP"),勾选它可以读取的环境(至少master),然后保存。 - 将 Space ID 复制到
CONTENTFUL_SPACE_ID,将 Content Delivery API access token 复制到CONTENTFUL_DELIVERY_TOKEN。 - 将
CONTENTFUL_ENVIRONMENT设为环境 ID,通常是master。其他环境列在 Settings → Environments 中。 - 将
CONTENTFUL_DELIVERY_URL设为https://cdn.contentful.com;如果空间位于欧盟数据区域,则设为https://cdn.eu.contentful.com,末尾不要加斜杠。如果希望 AI 也能读取草稿,请改用https://preview.contentful.com(或https://preview.eu.contentful.com),并搭配同一密钥的 Content Preview API access token。 - 如需写入,请创建个人访问令牌:头像菜单 → Account settings → CMA tokens → Create personal access token。选择有效期后立即复制令牌,因为 Contentful 只显示一次。将它粘贴到
CONTENTFUL_MANAGEMENT_TOKEN(不要加 Bearer 字样),并将CONTENTFUL_MANAGEMENT_URL设为https://api.contentful.com(或https://api.eu.contentful.com)。该令牌以你的身份操作,在你可以编辑的每个空间中都有效。 - 如果你的组织需要批准个人访问令牌,请组织管理员打开 Organization settings,在个人访问令牌的访问设置中找到该令牌并授予访问权限。在此之前,写入工具会返回 401
OrganizationAccessGrantRequired;使用 Delivery 令牌的读取不受影响。 - 安装连接器,先运行
contentful_get_space:它会返回空间名称及其语言区域,可以快速确认 Space ID 和 Delivery 令牌是否匹配。
两个令牌是有意为之:Delivery 令牌只能读取已发布的内容(使用 Preview 令牌时还能读取草稿),因此只配置了四个必填值的连接器可以查找所有内容,但不会做任何修改。写入、未发布的草稿、空间和环境都通过 Content Management API 并使用个人访问令牌处理。如果 CONTENTFUL_MANAGEMENT_URL 和 CONTENTFUL_MANAGEMENT_TOKEN 留空,管理类工具只会提示它们缺失。
发布会改变线上网站:contentful_publish_entry 和 contentful_unpublish_entry 会改变访客在你的网站或应用中看到的内容,因此 AI 会先说明是哪个条目以及会产生什么影响,并等待你确认。contentful_delete_entry 在安装时处于关闭状态,因为删除的条目无法恢复。
修改的工作方式:contentful_list_content_types 提供内容类型和字段的 ID,contentful_list_locales 提供语言区域代码。字段值先按字段 ID、再按语言区域组织,例如 {"title": {"en-US": "Hello"}}。每次修改前,AI 会用 contentful_get_entry_for_editing 读取条目以获取当前的 sys.version;如果期间有其他人保存过,Contentful 会返回 409 VersionMismatch,AI 会重新读取。contentful_update_entry 会替换全部字段,未包含的字段会被删除;只改一两个字段时,AI 会使用 contentful_patch_entry。只有发布新版本后,修改才会上线。
搜索:contentful_list_entries 接受 content_type、全文搜索 query,以及 fields.slug=hello 或 fields.date[gte]=2026-01-01 等其他筛选条件。按字段筛选或排序时需要 content_type。关联的条目和资源会在 includes 中返回;资源 URL 以 // 开头,AI 会补上 https:。
分页:列表返回 total、skip 和 limit(最多 1,000);下一页从 skip + limit 开始。
常见错误:401 AccessTokenInvalid 表示令牌错误或已过期,或者在 Preview 主机上使用了 Delivery 令牌(或反之)。404 NotFound 表示 ID 错误,或者令牌未覆盖该空间或环境:此时 Contentful 返回 404 而不是 403。400 "A Content Type ID is required" 表示按字段筛选时缺少 content_type。422 ValidationFailed 会指出为空或违反校验规则的字段。429 RateLimitExceeded:Management API 每秒约允许 7 个请求,请稍候重试。
该连接器不会上传资源,不会创建或编辑内容类型,不管理环境、Webhook、角色和应用,也不使用 GraphQL API。
步骤 2 — 安装 adapter
curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d
步骤 3 — 在 ChatGPT 中添加连接器
你的服务器 URL: 在 AnythingMCP 中打开 MCP Servers → 此连接器所在的服务器,复制它的 URL(
https://cloud.anythingmcp.com/mcp/…)。本指南中出现YOUR_SERVER_ID的地方都用它替换。
ChatGPT 通过开发者模式(Developer mode)将 MCP 服务器作为自定义应用接入,仅付费套餐可用,免费套餐不可用。在 Business 和 Enterprise 工作区中,可能需要管理员先开启。
- 在 ChatGPT 中打开 Settings → Security and login,开启 Developer mode。
- 前往 chatgpt.com/plugins,点击 +。
- 填写名称和简短描述,例如 Name:
Contentful。 - 在 Connection 下填入 MCP 服务器 URL
https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID,然后创建连接。 - ChatGPT 提示时,登录 AnythingMCP(OAuth)并允许访问。
可用工具
| Tool | What it does |
|---|---|
contentful_get_space | Read the space the connector is set up for (Content Delivery API): its name and locales with the default locale |
contentful_list_content_types | List the content types of the environment (Content Delivery API): for each its sys.id (the id entries are filtered by), name, displayField… |
contentful_get_content_type | Read one content type by id (Content Delivery API): its fields with id, name, type (Symbol, Text, RichText, Integer, Number, Date, Boolean… |
contentful_list_entries | Search published entries (Content Delivery API) |
contentful_get_entry | Read one published entry by id (Content Delivery API): sys (id, contentType, createdAt, updatedAt, revision), metadata.tags and fields |
contentful_list_assets | Search published assets (images, documents, videos) via the Content Delivery API |
contentful_get_asset | Read one published asset by id (Content Delivery API): title, description and file with url (prefix https:), fileName, contentType, size… |
contentful_list_locales | List the locales of the environment (Content Delivery API): code (e.g. en-US, de-DE), name, default flag and fallbackCode |
contentful_list_tags | List the public content tags of the environment (Content Delivery API) with sys.id and name |
contentful_list_spaces | List the spaces the management token can reach (Content Management API), with sys.id and name |
contentful_list_environments | List the environments of the space (Content Management API), e.g. master, staging, with sys.id, name, status and aliases |
contentful_list_all_entries | Search all entries including drafts and changed-but-unpublished versions (Content Management API) |
contentful_get_entry_for_editing | Read the latest version of an entry, draft changes included (Content Management API): fields with every locale, metadata.tags and… |
contentful_create_entry | Create a draft entry of a content type (Content Management API). fields maps each field id to its values per locale, e.g. {"title"… |
contentful_update_entry | Replace the fields of an entry (Content Management API) |
contentful_patch_entry | Change single fields of an entry with JSON Patch operations (Content Management API), leaving the rest untouched |
contentful_publish_entry | Publish an entry, making its current version visible on the website or app through the delivery API (Content Management API). version must… |
contentful_unpublish_entry | Unpublish an entry: it disappears from the delivery API, so from the website or app, and stays as a draft (Content Management API) |
contentful_delete_entry | Delete an entry for good (Content Management API) |
contentful_create_tag | Create a content tag in the environment (Content Management API) |
示例提示
- “找出我们过去 30 天内发布的博客文章,列出每篇的标题、slug 和作者。”
- “哪些条目有已保存但尚未发布的修改?”
- “列出我们本月上传的图片,以及它们的文件大小和尺寸。”
- “把春季促销落地页的标题改为‘春季促销:全场 8 折’,在我确认后发布。”
FAQ
ChatGPT 免费套餐能用自定义 MCP 连接器吗? 不能。自定义 MCP 连接需要开发者模式,只有付费套餐提供。
下一步
这份指南对你有帮助吗?