---
title: "CanAI technical reference: MCP toolset and templates"
canonical: "https://mamak.openminds.my/canai/technical/"
updated: "2026-10-13T06:05:13Z"
---

# CanAI technical reference

Templates, the MCP toolset and the hooks, for builders who want the full inventory. The plugin is free and you bring your own agent.

FreeWPCanAI 2.5.0[Setup guide](https://mamak.openminds.my/canai/setup/)[Get CanAI free](https://mamak.openminds.my/canai/#get)

## What CanAI builds

Pages render as Twig-templated, semantic HTML, with no shortcodes or nested page-builder markup. Styling is Tailwind and light interactivity is Alpine.js, with Lucide icons available out of the box.

- **Compiled, cached CSS.** Tailwind output is built and cached per page, so it isn't compiled on every request.
- **An editor in wp-admin.** HTML, CSS and JS with a preview, for hand-tuning what the agent wrote. "Edit with WPCanAI" sits in the admin bar on any front-end page.

## Templates and layouts

Layouts, headers, footers and components are template objects organised by taxonomy, so nothing is copied from page to page.

- **Layout delegation.** A page can hand its outer chrome to a shared layout, so a header or footer change reaches every page that delegates.
- **Archives and special pages.** Templates for category, tag, author, search and 404, beyond single posts and pages.
- **WooCommerce.** Slots for the shop, single product, product category, product loop, cart, checkout and My Account pages, including orders, order-pay, downloads, addresses and payment methods.

## The MCP toolset

The agent gets more than 35 operations that mirror the wp-admin screens (61 on a site with the multilingual tools turned on), so the agent and the admin are two doors into the same features. A selection, by job:

| Tool | What it does |
|---|---|
| `wpcanai-list-pages` | Lists CanAI pages with their format, layout and size. |
| `wpcanai-create-page` | Creates a CanAI page with a slug, title and layout. |
| `wpcanai-read-meta` | Reads a page's or template's HTML, CSS, JS, layout and context. |
| `wpcanai-write-meta` | Compiles and saves Twig, Tailwind and Alpine markup in one step. |
| `wpcanai-replace-in-meta` | Finds and replaces inside a page without resending the whole file. |
| `wpcanai-create-template` | Registers a reusable partial or a site-wide layout. |
| `wpcanai-sideload-url` | Pulls an image from a URL into the media library. |
| `wpcanai-write-menu` | Builds and reorders navigation menus. |
| `wpcanai-read-settings` | Reads the theme, Tailwind setup and site preferences. |
| `wpcanai-purge-cache` | Clears the page and edge cache. |
| `wpcanai-diagnostics` | Checks the install and reports problems. |
| `wpcanai-export` | Exports every CanAI page and template, for cloning or backup. |

## Version history

Every change the agent makes is logged. You can list snapshots and past operations, inspect a snapshot, restore a whole snapshot or a single operation, and pin a safe point to come back to before a big change.

Example request to your agent

```
Pin the current state with CanAI, then redesign the home page hero.
If I don't like it, restore the pinned snapshot.
```

## Multilingual sites

When a translation layer is active, the agent can read and write per-language settings, translations, global strings, media mapping, and post and term overrides.

## Hooks

These parts are filters, so a developer can change them:

- which template types exist on the site;
- which WooCommerce hooks are available inside templates;
- which WordPress options the agent may read or write;
- how the page-context data passed into templates is assembled.

## Connection and access

Agents connect over MCP's HTTP transport to your site's CanAI endpoint. The connection link carries a private key, which acts as the credential:

Endpoint shape

```
https://your-site.com/wp-json/mcp/wpcanai/<span class="ph">your-private-key</span>
```

Anyone with the link has the agent's full access, so keep it out of shared files and repositories. The options the agent can touch are limited by an allowlist in **CanAI → AI Client → Guardrails**.

## Requirements

- WordPress 7.0 or later and PHP 8.2 or later.
- An administrator account on the site.
- An AI agent that can connect to a remote MCP server over HTTP, such as Claude Code or Cursor.
- WooCommerce, only if you want the shop templates.
