MCP + Headless CMS: Complete developer guide

By Arso Stojović•December 1, 2026•13 min read
A coding agent can rewrite a React component in one pass. It still has to guess the content shape unless it can ask the CMS. On a headless project that guess is expensive: the summary might be called description in one project and excerpt in another, and a card built against the wrong name renders an empty paragraph.
MCP, the Model Context Protocol, is how the agent asks. This guide explains the idea, then connects Cursor to one BCMS blog and builds a card from a real entry.
What is MCP (Model Context Protocol)?
MCP lets a coding agent use tools on a system outside the editor. The agent does not receive a database login. It receives a menu of actions, and it asks the editor to run one.
Four names are enough to follow the rest of this guide:
The host is the app you work in, such as Cursor, Claude Code, or VS Code.
The client is the piece of that app that talks to an MCP server.
A tool is one action the server offers, such as "list templates" or "read this entry."
A resource is reference material the server can attach, such as a short note about how writes should be formatted. It is not the same thing as loading an entry.
The model never connects to the CMS itself. It asks the host to run a tool. The client sends that request to the MCP server. The server reads the CMS and returns the answer to the chat.
A small architecture
For a headless CMS, the path is short. The editor hosts the client. The client talks to the MCP server. The server reads templates and entries, and it can change them only when the key allows it.
flowchart LR editor[Cursor] client[MCP client] server[BCMS MCP server] cms[Templates and entries] editor --> client --> server --> cms
You add a server URL in the editor. After that, the agent can ask the CMS questions while you write the component. The website keeps using its own API client.
Why MCP Matters for Headless CMS
Headless content is structured data: strings, dates, media, and pointers to other entries. The website reads that schema through an API.
All you need to know: Headless CMS in 2026 explains why the content sits outside the git repository. The agent in the editor sees the repository. It does not see the schema unless a tool returns it.
Field names belong to that schema, and they differ by project. The blog in this guide stores the summary as description, the picture as an image group (a label plus a media file), and the byline as an authors pointer. It does not have excerpt, coverImage, or authorName. A card written for those other names renders an empty paragraph even when the entry is full.
That is the practical case for an AI agents headless CMS setup. Have the agent read the template before it writes JSX. The public site keeps its own read path.
API-first CMS: A developer's guide to modern content architecture is how a site loads those same entries at build time. MCP is an extra client for the person writing the code, not a replacement for the site's API key.
MCP server vs REST API: What's the difference?
Both reach the same content. They serve different callers.
A REST API, or the BCMS SDK in front of it, is how application code loads content. The website already knows which methods it needs. With @thebcms/client those look like template.getAll(), entry.getAll(), and entry.getById(). The app renders the body, often with BCMSContentManager. Types, caching, and retries live in the project. This path should keep working when nobody has an editor open.
An MCP server is a menu for an agent that does not know the project yet. The agent asks what tools exist, then calls one, such as "describe the blog template" or "read this entry." It learns the real field names before it drafts a component. You do not add a new tool every time you add a template. The same tools accept an id for whichever template you name.
Choose by who is calling:
Use REST or the SDK for the website, for scripts, and for CI.
Use MCP while you and an agent are building against the live content model.
Use both on the same project. Give them separate keys. The site key fetches entries for visitors. The agent key stays on your machine.
REST or the BCMS SDK | MCP server | |
|---|---|---|
Who calls it | The website, a script, or CI | An agent inside the editor |
What the caller knows up front | The methods your code imports | Only the tool menu the server advertises |
What you set up | A client, types, and a site key | A server URL and an agent key |
What it is good at | Rendering and publishing the site | Learning field names before generating code |
What it should not replace | The agent discovering a schema | The site's data fetching |
MCP complements the API. It does not retire it.
How AI Agents Interact with Headless CMS content
Once the editor is connected, the agent only knows what the tools return. The useful jobs on a CMS are below. Every example is the same BCMS blog: the template named blog, and the entry headless-cms-101.
The server also offers tools that create, update, and delete entries, templates, groups, and widgets. Those names matter later, in the security section. The examples here are read-only.
Discovering content models
Ask which templates exist, then ask for the blog template. You should get each field's name, type, and whether it is required:
Field | Type | Required |
|---|---|---|
title | String | Yes |
slug | String | Yes |
description | String | Yes |
category | Entry pointer | No |
authors | Entry pointer | No |
image | Group, with a label and a media file | No |
created_at | Date | No |
updated_at | Date | No |
description is the summary. image is a group, not a single file field. authors points at author entries. A generated card should use these names and no others.
Retrieving entries
Ask for one entry and for the English title, slug, and description. For headless-cms-101 that read returns:
{
"title": "All you need to know: Headless CMS in 2026",
"slug": "headless-cms-101",
"description": "All you ned to know: Discover the benefits of headless CMS and its value for you. Elevate your understanding with our insights."
}The description is stored with that spelling. Use it as stored. The raw entry keeps each value under a field id, so ask the agent for the named fields rather than pasting the raw object into a component. If the blog is large, ask for one entry. A request for every entry at once can be too big to return.
Understanding content relationships
category and authors point at other entries. A rich-text link uses a pointer string from get-entry-pointer-link, shaped . Ask the agent to fetch that string. A pointer it invents does not resolve.
Generating frontend components
With the template and one entry in the chat, the agent can draft a component whose props match those names. The tutorial does that with title, slug, and description only.
Agentic CMS: The future of content management in an AI-agent world is the wider setting: the agent can reach the CMS, and the site still loads entries through @thebcms/client.
Creating or updating content when authorized
Write tools are on the same menu as the read tools. A sentence in your prompt that says "do not write" does not remove them. Create or update an entry only when you mean to, and read the arguments in the approval dialog before you accept them.
Hosted vs Custom MCP Servers
You can use an MCP server the CMS vendor runs, or a server you run yourself. Both speak the same protocol to the editor. The difference is who operates the process, and how much of the CMS you choose to expose.
A hosted server is the faster path. The vendor runs the endpoint, ships the tool list, and updates it when the product changes. You create a key and paste a URL into Cursor. You do not deploy anything. The tradeoff is the menu: you get the tools the vendor decided to publish. BCMS works this way. Create a key under Settings → MCP, and the tutorial at the end uses that hosted URL.
A custom server is a small program you run beside the editor. You register only the tools you want, often just the reads. That is the right choice when a CMS has no hosted MCP server, when you want a read-only menu, or when one agent should reach the CMS and another internal system through a single connection. You then own hosting, dependencies, and every API change.
Hosted MCP server | Custom MCP server | |
|---|---|---|
Who runs it | The CMS vendor | You |
Setup | A key and a URL | A process you write and keep running |
Maintenance | The vendor updates the tools | You update the process |
Tool menu | The vendor's full set, including writes on BCMS | Only the tools you register |
Fits when | You want the editor connected today | You need a narrower menu, or more than one system |
Start with the hosted server unless you have a reason to own the process.
MCP Security and Best Practices
A hosted MCP key can do whatever tools the server advertises. On BCMS that includes delete. Per-template permission toggles do not hide those tools, so a key that looks read-only in the dashboard can still be asked to write. Treat every MCP key as able to change content.
Create one key per person and per environment. The value has three parts separated by dots. A key without MCP access is rejected when the editor connects.
The key sits in the server URL. Shell history, proxy logs, and a committed
mcp.jsonare copies of it. Keep the file at~/.cursor/mcp.json, outside the repository, or pass the key through an environment variable.Do not put the key in a
NEXT_PUBLIC_variable or in any file the browser downloads. The website uses a different key. The BCMS Next.js guide shows where that key belongs.readOnlyHintis a hint to the client. It does not turn write tools off. If a read-only chat starts proposing edits, disconnect the server or revoke the key.BCMS AI Agent capabilities: What makes an AI Agent useful? is a checklist for what an agent should be allowed to see. Read one template and one entry before any write, and read the tool arguments before you approve a change.
Rate limits match the rest of the BCMS API and are counted per key.
Tutorial: How to Connect Cursor to BCMS Using MCP
This walkthrough connects Cursor to the hosted BCMS server, reads the blog template, reads the entry headless-cms-101, and generates a card from title, slug, and description. It does not create or edit content.
Prerequisites
A BCMS project that contains the
blogtemplate and the entryheadless-cms-101.Cursor.
A few minutes to create a key and paste a URL.
Step 1: Create a BCMS MCP Key
1. In the BCMS dashboard, open Settings → MCP.
2. Create a key and copy the URL BCMS shows you. It has this shape:
https://app.thebcms.com/api/v3/mcp?mcpKey=YOUR_MCP_KEY
3. Store the key in a password manager, or in an environment variable named BCMS_MCP_KEY.
You should see a URL that contains mcpKey, and a key made of three parts separated by dots.
Do not commit the URL, and do not paste the key into a chat. If it has been logged, rotate it in the dashboard.
The same style of setup for ChatGPT is in Connect BCMS MCP to ChatGPT.
Step 2: Configure BCMS MCP in Cursor
Cursor reads ~/.cursor/mcp.json for every project, and .cursor/mcp.json inside one project. Use the home-directory file so the key never lands in git.
1. Open ~/.cursor/mcp.json.
2. Add a server named bcms. This form keeps the key out of the file:
{
"mcpServers": {
"bcms": {
"url": "https://app.thebcms.com/api/v3/mcp?mcpKey=${env:BCMS_MCP_KEY}"
}
}
}3. Set BCMS_MCP_KEY where Cursor can read it, then reload MCP servers from Cursor's settings.
If Cursor does not substitute the variable, put the full URL in ~/.cursor/mcp.json and nowhere else. More client options are in the BCMS MCP guide and the Cursor MCP docs.
You should see a server named bcms in the MCP list. If the tool list is empty, the URL or the variable did not load. Reload once before you change your prompt.
Step 3: Verify the Connection
Open the agent chat with the BCMS server enabled and paste:
What BCMS tools do you have right now? Describe each one in a short phrase. Do not change any content.
You should see tools that list templates, read a template, and read an entry. You should also see tools that can create, update, or delete content. Those write tools are part of the hosted server. Leave them unused for the rest of this tutorial, and reject any approval that would change the project.
Step 4: Retrieve BCMS Content
Ask for the blog model in plain language:
Using BCMS, list my templates. Then describe the blog template: every field name, its type, and whether it is required. Do not change anything.
You should see required fields title, slug, and description, plus category, authors, image, created_at, and updated_at. image is a group with a label and a media file. authors points at other entries.
Then read the one entry this guide uses:
Read the BCMS blog entry whose slug is headless-cms-101. Tell me its English title, slug, and description. Do not change the entry.
You should see these values, with the description spelled the way it is stored:
Title: All you need to know: Headless CMS in 2026 Slug: headless-cms-101 Description: All you ned to know: Discover the benefits of headless CMS and its value for you. Elevate your understanding with our insights.
Step 5: Generate a Component Using BCMS Content
Keep the two answers above in the chat, then paste:
Write a BlogCard component for this blog entry. The props are title, slug, and description only. Link to /blog/ plus the slug. Do not add excerpt, coverImage, or authorName.
A component that follows the template looks like this. Rendered in a small Next.js 15.5.29 page, it linked to /blog/headless-cms-101, showed the entry title in the heading, and showed the stored description in the paragraph.
export function BlogCard(post: { title: string slug: string description: string }) { return ( <h2>{post.title}</h2> <p>{post.description}</p> ) }
The page checked the props. A production site should still load the entry with @thebcms/client.
Troubleshooting
What you see | What to do |
|---|---|
No BCMS tools | The URL or |
HTTP 400 when connecting | The key is not three dot-separated parts. Copy the full value from Settings → MCP. |
HTTP 401 when connecting | The key id or secret does not match. Create a new key if this one may have leaked. |
HTTP 403 when connecting | MCP access is turned off for that key. Enable it, then reload. |
HTTP 404 when connecting | The project id inside the key does not match a BCMS project. |
The entry cannot be found | The connection is fine and the id or slug is wrong. Ask again using the slug |
Listing every entry fails | The blog is too large for one response. Ask for the single entry by slug. |
The agent wants to edit content | Write tools are still available. Reject the approval, then disconnect the server or revoke the key. |
FAQs about MCP + Headless CMS
What is an MCP server?
An MCP server is a program that offers a menu of tools to an AI app. The app lists those tools, the model picks one, and the server runs it. A headless CMS server's tools read templates and entries, and sometimes create or update them.
Why connect a headless CMS to an AI coding agent?
The content model lives in the CMS, not in the repository. Connected, the agent can read the real field names and a real entry before it writes a component. Without that, it copies names from some other project and the component renders blank.
Does MCP replace the CMS API?
No. The website, your scripts, and CI should keep calling the API or SDK. MCP is the interface for the agent in the editor. Use both, with separate keys.
When would I run my own MCP server?
Run your own when the CMS does not host one, when you want to expose only read tools, or when the agent should reach the CMS and another system together. If the vendor already hosts a server, as BCMS does, start there.
Can an agent change live content through MCP?
Yes, if the server offers write tools and you approve the call. On the hosted BCMS server those tools are part of the menu. Saying "read only" in the prompt does not remove them. Use a key you can revoke, and do not approve a write you did not ask for.
Conclusion
MCP gives a coding agent a tool menu instead of a guess about your schema. On a headless CMS, let it read the real template and one real entry before you accept a generated component. The website keeps its API. The agent uses MCP from the editor, with its own key.
BCMS already hosts that server. Create a key, add the URL in Cursor, and ask for the blog template and the headless-cms-101 entry before you ask for a component. Setup notes are at thebcms.com/agents, and the endpoint is documented in the BCMS MCP guide.
Sources
A CMS your agents can use
Connect BCMS over MCP and let agents draft and update content with scoped keys.
14-day free trial · No credit card required
Give your agents a CMS and your clients an editor
Connect an agent in a few minutes, or start from a framework starter. Try it free for 14 days, no credit card required.
Connect an agentContent
A CMS your agents can use
Connect BCMS over MCP and let agents draft and update content with scoped keys.
14-day free trial · No credit card required
Continue reading

Best Vibe Coding tools in 2026: 9 options compared by use case
Compare the 9 best vibe coding tools in 2026 for MVPs, websites, internal apps, and existing codebases. Explore use cases, limitations, and pricing.

Context Engineering vs Prompt Engineering: What's the Difference?
Learn how context engineering differs from prompt engineering, why both matter for AI agents, and how structured content improves AI responses.

How to Write Specs for AI Coding Agents (With a Real Example)
Learn how to write specs for AI coding agents with a practical spec.md example covering requirements, constraints, edge cases, and acceptance criteria.