DEV Community

Cover image for A Full Craft CMS Page in Two Prompts with MCP
Bohdan Feniuk
Bohdan Feniuk

Posted on Originally published at b10k.nl

A Full Craft CMS Page in Two Prompts with MCP

Two prompts, 2 minutes 53 seconds, and a seven-block About Us page was live.

We connected Claude Code to a Craft CMS site through Craft’s new MCP server and asked it to build a page. It picked the blocks, filled them in, created the page and checked that it loads. Nobody opened the control panel.

The About Us page the agent built: a dark Hero, a Section Intro, a Timeline, a Stats Bar, a Team Grid, a dark Pull Quote and a CTA Split
The page as it went live. Velo Studio is our demo site, a made-up cycling studio.

See Component Guide for Craft CMS →

What MCP is, in one paragraph

MCP (Model Context Protocol) is a standard way for an AI agent to talk to an app. Since version 5.12, Craft has its own MCP server. Switch it on, connect an agent such as Claude Code, and the agent can read your sections, entry types and fields, and create entries — with the same permissions as the user who signed in.

The two prompts

The first prompt was a question:

Do you see any blocks can be used for pages?

Seven seconds later the agent answered with a list of 30 blocks, the ones marked as ready for editors. That list didn’t come from Craft. Craft would have shown the agent every entry type on the site, finished or not. The list came from Component Guide, which adds it to what Craft’s MCP server tells the agent (more on that below).

The second prompt pointed back at that list:

Create the About Us page with those blocks

“With those blocks” is the important part. Ask an agent only to create an About Us page, and it will make one its own way: a new single with a few fields it thinks a page needs. That’s a page, but not one built from your blocks, and not one your editors can work with the way they work with every other page.

So the agent took the list as its menu: choose the blocks that suit an About Us page, fill them in, and put the page on the site. It chose seven of the 30.

The site had no section for a page like this. So the agent created one first — a Pages section with a Page entry type — and then built the page in it.

How it went, by the clock:

  • 0:00 Prompt 1: “Do you see any blocks can be used for pages?”
  • 0:07 The answer: the 30 blocks ready for editors.
  • 1:31 Prompt 2: “Create the About Us page with those blocks”
  • 2:18 The agent has created a Pages section and a Page entry type: the site had nowhere to put the page.
  • 2:44 The entry is saved with seven blocks.
  • 2:53 The live page is checked: it loads, and all seven blocks render.

From the second prompt to a checked, live page took 82 seconds. The agent made 11 calls to the MCP server on the way.

The page

Seven blocks, top to bottom:

  1. Hero, dark: “A workshop built by riders, for riders”, with the photo the home page already uses.
  2. Section Intro: “Comfort first, speed follows”.
  3. Timeline: from a garage in 2016 to today.
  4. Stats Bar: bike fittings, years, team size, rating.
  5. Team Grid: four people.
  6. Pull Quote, dark: a line from a co-founder.
  7. CTA Split: “Book a fitting” and “Contact us”.

The agent also read the home page and the Hero’s examples before writing, so the new text sounds like the rest of the site.

What Component Guide adds to Craft’s MCP server

On its own, Craft’s MCP server describes the content model: which entry types exist and which fields they have. That’s enough to save an entry. It isn’t enough to build a good page. A field list doesn’t say that Stats Bar is a row of big numbers, that a block is still a draft, or what a well-filled Hero looks like.

Component Guide knows those things, because a developer has already written them down. Next to each block template sits a story file with example content for the block:

'Dark': {
    description: 'Same content on the dark theme, for pages that open into a dark section.',
    args: {
        theme: 'dark',
        eyebrow: 'Velo Studio',
        heading: 'Ride better, not just harder',
        buttonLabel: 'Book a fitting',
        ...
    },
},
Enter fullscreen mode Exit fullscreen mode

The developer uses these files to see every block in the control panel, and editors use them to pick blocks from a gallery. Since Craft 5.12, the plugin hands the same knowledge to the agent, in three ways:

  • Which blocks to use. When the agent connects, Craft gives it a set of instructions. Component Guide adds the blocks that are ready for editors: marked stable, with examples, and matched to an entry type. On this site that’s 30 of 31 — the list the agent showed after the first prompt. With client review on, the list also says which examples the client approved.
  • What goes in them. The tool component-guide.stories returns a block’s examples. The agent starts from content that already works for that block, not from an empty list of fields. In this run it read the Hero’s examples and the home page before writing, so the new text sounds like the rest of the site.
  • What they look like. The tool component-guide.render renders any block from the site’s own templates, with any values, and returns the HTML — or the error the template throws. Nothing is saved. An agent can check a block before it puts it on a page.

There’s a fourth, for developers: Craft’s own content-model check (content-model.audit) now also lists examples that use a field the entry type doesn’t have, and fields no template reads.

All of this comes from files the project already has. There is nothing to configure for MCP: the tools appear for everyone who has access to the guide.

What a person still has to do

The page was live in three minutes. It wasn’t finished.

  • The text is made up. The team names, the years, the 2,500 fittings and the quote are placeholders the agent wrote — and its report said so. On a real site, every one needs replacing.
  • Some links go nowhere. The buttons point to #, and “Meet the team” points to #team, an anchor the Team Grid doesn’t have.
  • Navigation. Nothing in the header links to the new page yet.
  • Draft, not live. We published straight away because it’s a demo. On a client site, ask the agent for a draft.
  • Config changes. The new section and entry type landed in project config, as YAML files to review and commit like any other change.

The three minutes replaced the assembly: choosing blocks, creating the section, filling every field with something sensible. They didn’t replace knowing what’s true about the business.

Set it up

With MCP switched on in Craft (Settings → MCP → Authenticated), connecting Claude Code is one command:

claude mcp add --transport http velo https://your-site.test/admin/mcp/auth
Enter fullscreen mode Exit fullscreen mode

Then run /mcp in Claude Code, pick the server, and approve access on Craft’s consent page in the browser.

Two things cost us a few minutes on a fresh install:

  • Signing keys. The endpoint returned a server error (500) until we ran php craft oauth/generate-keys. The keys are saved in storage/, so every environment needs them once.
  • The URL. Use the authorization endpoint, /admin/mcp/auth, not /admin/mcp. Craft tells clients that this is the address to sign in to, and Claude Code refused the other one.

Try it yourself

You need three things: Craft 5.12 or later with MCP switched on, an MCP client such as Claude Code, and blocks with stories.

Component Guide Lite is free on any site, MCP tools included. The demo runs Pro, which also gives the agent the field values to fill a new block with, and the client’s approvals. Craft documents the server itself in its MCP docs.

Then ask the agent which of your blocks it can use for pages.


Originally published on b10k.nl. I'm Bohdan, a freelance Craft CMS developer in the Netherlands. The tool in this article is Component Guide.

Top comments (0)