Using CMS AI Agent with Craft CMS

Everything you need for Craft CMS, in the order you will actually do it. If you are stuck, the last section has the real error messages and what each one means.

Switch these on first

  • Craft 4 or newer. Craft 3 had the GraphQL API only in its Pro edition and reached the end of its life in 2024.
  • Any edition, including Solo. The GraphQL API is part of Craft itself in Craft 4 and Craft 5 — mutations and all. There is no plugin of ours to install and nothing to buy.
  • Access to the Craft control panel, because everything below happens there and nowhere else.

Connecting your website

  1. In the Craft control panel, go to GraphQL → Schemas and create a schema. Call it Craft AI Agent so you can recognise it later.
  2. Tick the site itself. This is the one most people miss: Craft refuses every single request with "Schema doesn't have access to the site" until the schema names your site, even when every section in it is ticked.
  3. Tick the sections it may read. Then scroll to Mutations and tick the ones it may write — those boxes start empty. A schema with everything readable and nothing writable is the easy mistake, and it fails quietly: the save operations simply are not there, so writing is not refused so much as unavailable.
  4. While you are there, tick your asset volumes and category groups under Mutations too, if you want images and categories handled.
  5. Go to GraphQL → Tokens, create a token against that schema, and paste it into CMS AI Agent.
1Make a schemaGraphQLSchemasTokens2Read is not writeQueriesBlog — readMutations (start empty)Blog — write3Make a tokenGraphQLTokensSchema: Craft AI AgentAccess token
What those screens look like. Drawn rather than photographed, so they stay true when your CMS is redesigned.

What you can ask for on Craft CMS

  • Read content

    Looking at what is already on the website: the list of pages and posts, who wrote each one, when it last changed, whether it is published, and the full text of any one of them.

    "Which pages have not been touched in over a year?"

  • Create content

    Adding something that was not there before: a new page, a new post, a new entry of whatever kind your website uses. It arrives as a draft, with a title, the body text and a short summary, ready for you to read before anyone else can.

    "Add a page about our new opening hours and leave it as a draft."

  • Edit content

    Changing something that is already there: the title, the body text, the summary. You are told exactly which items were touched, and your website keeps its own history of what they said before.

    "Change the phone number on the Contact page to the new one."

  • Publish content

    Moving something between draft, published and private. This is the step that decides whether the public can see a page, which is why it is a thing you ask for on purpose rather than something that happens on the way past.

    "Publish the draft about the Saturday market."

  • Schedule content

    Setting a date and a time in the future for something to appear, so a post written on a Tuesday afternoon goes live on Monday morning with nobody at a keyboard.

    "Set the Christmas opening hours post to go live on the first of December."

  • Manage images and files

    Putting images and files onto the website and filling in the text that belongs with them: the title, the caption, and the alt text that a screen reader speaks and a search engine reads in place of the picture.

    "Put last week's photos into the gallery and write alt text for each one."

  • Manage categories and tags

    Organising content so people can find it: which category a post sits in, which tags it carries, and creating a new category or tag where there is a real need for one.

    "Put all the recipe posts into the Recipes category."

  • Custom content types

    Few websites hold only pages and posts. A property site has properties, a restaurant has dishes, a school has courses. This is working with those, in their own fields, instead of forcing everything to be a blog post.

    "Add a new dish to the menu: the name, the description and the price."

  • Site information

    The plain facts about the website: what it is called, what software and which version it runs, how many pages and posts it holds, which languages it is written in, and when it last changed.

    "How many pages does my website have, and when was each one last updated?"

What it will not do on Craft CMS

Craft CMS has no way to do this, so this agent does not offer it. What it would have meant:

  • Edit SEO information

    The text that does not appear on the page but decides how the page looks in a search result and when somebody shares it: the SEO title, the description under it, and the alt text on images.

  • Manage menus

    The menus a visitor clicks: adding an item, renaming one, putting them in a different order, moving one underneath another.

  • Bulk changes

    The same change across many items at once. Nothing happens straight away: you are shown the whole list first, with the value as it is now beside the value proposed for it, and it runs only after you have said yes. It can be stopped partway and it can be undone.

  • Manage redirects

    Sending an old address to a new one, so a link somebody saved or a result still sitting in Google lands on the right page instead of an error. It can also list everything that is already being sent somewhere else.

  • Administrative information

    What is installed, what has an update waiting, and who has an account on the website. Reads only: it cannot install, update, activate or remove a plugin or theme, change a setting, or add or change a user.

Worth knowing about Craft CMS

  • The schema decides everything, not the token. If something cannot be done, the answer is almost always a box that is not ticked — and we check for the write operations when you connect, so you are told then rather than discovering it later in front of a customer.
  • Craft installs with no sections, no entry types, no categories and no fields: everything on your site was invented by whoever built it. So nothing here is assumed — we ask your site what it is and read the answer.
  • Because your content model is yours, there is a short setup step where you say which of your fields is the title and which is the body. Craft can list its fields; it cannot know which one you think of as the article.
  • Craft has no SEO fields, no menus and no redirects of its own — those are plugins, each storing things its own way — and nothing in its schema reports plugins, versions or user roles. None of that is claimed here.

When something goes wrong

The failures people actually meet, with the exact words CMS AI Agent will show you. The message is in English wherever you are, because that is what the software says.

The token is refused, or it connects and then cannot see any of your entries.

What you will see

Craft did not accept that token, or its schema does not allow reading entries. Check the token, and that its schema has the sections you want ticked.

What to do

Both are usually the schema rather than the token. In GraphQL → Schemas, open the schema the token was made against and check two things: that your site is ticked, and that the sections you want are ticked under Queries. A schema with neither produces exactly this.

Reading works perfectly, and nothing can be created or changed.

What you will see

This Craft will not let CMS AI Agent set whether the entry is enabled, which is the only way to publish or unpublish one. Nothing has been changed.

What to do

This is the Mutations column, and it is the single most common thing to miss on Craft. Open your schema, scroll past Queries to Mutations, and tick the same sections there. Those boxes start empty on a new schema, so a schema that looks complete usually is not.

The site clearly works in a browser, but we are turned away.

What you will see

A security plugin or firewall on the site blocked the request.

What to do

Something in front of Craft is refusing the request — a firewall, a security rule at the host, or Cloudflare. Allow POST requests to /actions/graphql/api from outside, then try again.

An entry you can see in Craft is reported as missing.

What you will see

That entry is not on the site.

What to do

Almost always a section that is not in the schema, or an entry on a different site in a multi-site Craft. Tick the section, and check which site the entry belongs to.

More about Craft CMS AI Agent