AI access and automation
Enable authenticated draft-first page editing through WordPress Abilities, MCP, and WP-CLI.
Watch the video
Chapters and transcript Captions are included.
Kindly Edit can expose a site's editable pages and validated client design to an authenticated developer tool through WordPress's Abilities
API, the WordPress MCP Adapter, or wp kindly. Access is off by default. Changes always go to an unpublished Kindly Edit
draft first; checking and publishing are separate calls.
Turn it on safely#
In WordPress, go to Settings → Kindly Edit → AI tools, tick Let AI tools read and change pages and the client design, and choose
Save. A managed site can instead set define( 'CANTATA_EDIT_AI', true ); in wp-config.php; the constant takes
precedence over the setting.
Use a dedicated WordPress Application Password for the tool. Its account must be allowed Developer mode and be able to edit each requested page. Publishing additionally requires permission to publish the page. Revoke the Application Password when it is no longer needed, and never put it in a repository, screenshot, shared script, or chat transcript.
Abilities#
Read:
cantata-edit/list-pagescantata-edit/get-pagecantata-edit/list-sections-availablecantata-edit/check-pagecantata-edit/get-historycantata-edit/get-client-designcantata-edit/validate-client-design
Change:
cantata-edit/edit-pageapplies up to 100 structured operations together and saves a draft.cantata-edit/save-draftsaves whole-page HTML after the editor's sanitizer.cantata-edit/discard-draftdiscards only the unpublished draft.cantata-edit/publish-pagechecks and explicitly publishes the saved draft.cantata-edit/restore-versionputs a History version back live and keeps a current draft aside.cantata-edit/save-client-design-draftvalidates and saves brand, layout, assets, component rules, style-guide content and advanced CSS without changing the public site.cantata-edit/publish-client-designexplicitly makes that design draft public.cantata-edit/discard-client-design-draftremoves only the unpublished design draft.
The client design abilities edit the same document as Kindly Edit > Theme (Theme settings, 0.9.15 and later), where an administrator changes it by hand. That screen does not need AI access turned on; the AI tools still do.
Every change sends back the rev returned by get-page. A stale revision is refused with HTTP 409, as is a fresh
editing lock held by somebody else. The client should read the page again rather than forcing either condition.
The structured edit-page operations are set_text, set_link, set_picture, add_section, move_section,
remove_section, set_style, add_item, remove_item, and set_anchor. IDs such as s2.i1.f0 are valid only for
the revision in which they were returned.
By default (path_mode: "revision") every id in a batch means the element it named in that revision, however earlier
operations in the same batch moved, inserted or removed things around it. After remove_section on s1, s2 is still
the section that was read as s2; a moved section keeps its id; changing a heading's level keeps its id. An id inside
something removed earlier in the batch is refused and the whole batch is not saved. New sections and items added in a
batch have no id until the page is read again. Set path_mode to "sequential" (--path-mode=sequential in WP-CLI)
to resolve each operation against the page as it stands after the operations before it, which lets one batch address
content it has just inserted. Any other value is refused. add_section positions must name a section.
REST and MCP#
WordPress 6.9 or newer exposes the abilities through its core Abilities API. List them at:
GET /wp-json/wp-abilities/v1/abilities
Run a read-only ability with GET parameters under input:
GET /wp-json/wp-abilities/v1/abilities/cantata-edit/get-page/run?input[page_id]=17&input[format]=outline
Changing abilities use POST with a JSON body whose input contains the arguments:
POST /wp-json/wp-abilities/v1/abilities/cantata-edit/edit-page/run
Content-Type: application/json
{"input":{"page_id":17,"rev":"…","ops":[{"op":"set_text","id":"s1.f0","text":"New heading"}]}}
The separate official WordPress MCP Adapter exposes these through its default server at
/wp-json/mcp/mcp-adapter-default-server. Current adapter releases provide three meta-tools: discover abilities,
inspect an ability, and execute an ability. Kindly Edit's abilities appear in discovery and run through the execute
tool. Kindly Edit does not bundle the adapter; install it separately and authenticate with the dedicated Application
Password.
WP-CLI#
Always choose the account with --user=<login>:
wp kindly pages --user=editor
wp kindly get 17 --format=outline --user=editor
wp kindly edit 17 --rev=<rev> --ops=changes.json --user=editor
wp kindly edit 17 --rev=<rev> --ops=changes.json --path-mode=sequential --user=editor
wp kindly check 17 --user=editor
wp kindly publish 17 --rev=<rev> --user=editor
wp kindly history 17 --user=editor
wp kindly design get --user=editor
wp kindly design validate client-design.json --user=editor
wp kindly design draft client-design.json --rev=<rev> --user=editor
wp kindly design publish --rev=<rev> --user=editor
--ops accepts a JSON array, a file containing that array, or - for standard input. Design validate/draft accepts a JSON document, filename, or standard input. Commands output JSON. A stale
revision exits with code 2 so automation can re-read and retry deliberately. Design commands require an administrator and an active Kindly Edit Framework theme.
Audit trail and limits#
The draft records the signed-in user and the Application Password's name, or WP-CLI. After publishing, History
shows that route beside the version. Recent AI activity in the settings lists requests made through the AI abilities; changes made with WP-CLI do not appear there, so check the page's History for those. Page markup is limited to 1 MB, structured edits to 100 operations, and page
list results to 100. The structured page operations do not delete pages. Separate explicit element-code and element-PHP operations support shared parts with their own capability checks; see the element code references.