This project is not covered by Drupal’s security advisory policy.

Canvas Tools lets an AI agent, or any script, build Drupal Canvas pages, page templates and content templates through typed Tool API operations instead of the browser.

Canvas 1.x has no public API; its authoring code is @internal throughout. This module wraps that authoring behavior once, keeps all the coupling to Canvas in two services, and exposes the result as Tool API operations. Define the capability once, and every caller gets it: drush tool:run, AI agents over MCP, the AI module, or your own code. I wrote about the approach in Define the capability once; call it from anywhere.

Features

  • Drafts first. Every change goes to Canvas's auto-save store, the same drafts the Canvas editor uses. Nothing goes live until the drafts are published, and a person can review them in the editor first.
  • The whole authoring workflow. Find targets and components, create pages, place and arrange components, set props or bind them to entity fields, manage content templates and page templates, then publish or discard.
  • The same access as the editor. The tools check entity access, edit access to every field they write, and edit access to the component tree. Lists only show what the user may see. An agent can't do anything the same user couldn't do in the Canvas editor.
  • Built for agents. Every input has a typed schema, target types are advertised as an enum, lists are paged, and refusals say what to do instead.
  • Agent skills included. .agents/skills ships skills for building pages, page templates, content templates and SDC components. They teach an agent the order of operations: look before building, draft, then publish.

Post-installation

The module adds no configuration or permissions of its own. The tools use Canvas's permissions, such as edit canvas_page, administer content templates and publish auto-saves, so give the account the agent acts as the same roles a person would need.

Try it from Drush:

drush tool:run canvas_list_targets --input='{"target_type":"page"}'
drush tool:run canvas_list_components

To give an AI agent access over MCP, enable MCP Server and MCP Server Tool Bridge. Canvas Tools ships an MCP tool configuration for every operation, imported automatically when the bridge is enabled.

Projects using AI Best Practices get the skills synced into the project's .agents/skills on composer install. Otherwise, point your agent at the module's .agents/skills directory.

Additional requirements

  • Drupal 11 and PHP 8.3
  • Drupal Canvas 1.7 or later. Page templates need Canvas 1.11.
  • Tool API 1.0.0-beta9 or later

Because Canvas 1.x has no stable API, a new Canvas minor release may need a new Canvas Tools release.

Recommended modules

  • MCP Server and MCP Server Tool Bridge: expose the operations to AI agents over MCP.
  • Tool Belt: ready-made Tool API operations for content modeling, such as content types, fields and nodes. Together with Canvas Tools, an agent can model a content type and lay out its content template.
  • Tool API's tool_ai_connector submodule: exposes the operations to the AI module's agents.

Project status

Canvas Tools is in beta. It depends on Canvas internals and on Tool API, which is also in beta, so the tool contract may still change before 1.0.0. Please open a work item when an agent trips over something.

Supporting organizations: 
Development and maintainence

Project information

Releases