Bricks MCP tools
Available in EMCP 3.17.0. A Bricks page is a flat list of elements linked by parents and children. EMCP Pro gives your MCP client access to that structure, the live element catalog and native controls, so a heading remains a Bricks heading you can edit in the builder.
Requirements and setup
Section titled “Requirements and setup”- Check installed versions. Bricks 2.3.13 through 2.4.x (EMCP 3.18.0+; EMCP 3.20.0 was tested on Bricks 2.4.2). EMCP Pro is required.
- Select the builder. Open EMCP Tools → Page Builders, pick the Bricks card under 1. Standalone builder and choose Save changes in the save bar. A card marked Not detected cannot be picked and lists what it needs, such as the supported version and an EMCP Pro licence. Gutenberg stays on beside it, with any block packs you enable.
- Switch on its tools. Open EMCP Tools → Tools and select the Bricks tab, which appears once the builder is saved. Write tools start disabled. On a new EMCP install the read tools start disabled too, as every Pro tool does. Switch on the tools the task needs and choose Save changes.
- Connect and inspect. Reconnect your MCP client, then read context and schemas. Start with a draft and inspect the native editor.
Native workflow
Section titled “Native workflow”Read global classes, variables, palettes, theme styles and breakpoints before building. Existing local templates can be inspected and their content, header or footer elements edited in the correct area. Global design data is available for reference; this adapter does not change it.
Inspect the Bricks schema
Section titled “Inspect the Bricks schema”Read the exact settings accepted by the installed heading, container and image elements.
Build a native draft
Section titled “Build a native draft”Add a flat element tree with valid IDs and parent-child relationships.
Verify the native save
Section titled “Verify the native save”Read the tree and inspect desktop and mobile layouts in Bricks before publishing.
Check the root font size
Section titled “Check the root font size”Bricks sets html { font-size: 62.5% } by default, so 1rem is 10px, not 16px. A design authored for a 16px base renders at about 60% size. Since EMCP 3.20.0, bricks-get-context returns root_font_size with the value (for example 62.5%), its source (the Bricks default or the theme style that changes it) and rem_px, the pixel size of 1rem. Read it before writing rem values.
Bricks’ own Abilities API
Section titled “Bricks’ own Abilities API”Bricks 2.4 and later ship their own WordPress abilities. bricks-get-context reports them under native_abilities: whether they are available and enabled, how to enable them (an administrator turns them on in Bricks → Settings → AI), and which abilities cover what EMCP leaves out, such as color palettes, global classes and variables, theme styles, templates with conditions and popups.
Universal settings, global classes and custom CSS
Section titled “Universal settings, global classes and custom CSS”Since EMCP 3.20.0 the element write tools accept these settings, which Bricks edits in its own panels rather than through an element’s controls:
| Setting | What EMCP checks |
|---|---|
_interactions | A list of interaction objects, each with a string trigger and action. JavaScript interactions (action: "javascript" or a jsFunction) are refused as executable code, and so are attribute interactions that set an event handler (on*), srcdoc, or a javascript:, vbscript: or data: URL. |
_conditions | A list of condition groups (element display conditions). |
_cssGlobalClasses | A list of global class IDs. Each ID must already exist on the site; EMCP does not create classes. |
Other changes on save:
%root%in custom CSS. Bricks 2.4 resolves the builder’s%root%token when the builder saves and no longer resolves it on the frontend. EMCP now stores it the same way, as the element’s persisted selector:#{cssId}when the element has a custom CSS ID, otherwise#brxe-{id}, and.brxe-{id}inside a component. Bricks versions before 2.4 are left unchanged.- Checkboxes set to
falseare removed. Bricks reads checkbox controls withisset(), so a storedfalseswitched the option on (for example slider pagination). EMCP removes false checkbox values on every breakpoint and state. - Images from Bricks’ HTML converter. An image element carrying
_importImage(with no image of its own) gets it as an external image, as Bricks’ own import does.
The emcp-bricks agent skill includes an HTML-to-Bricks import guide covering how to prepare HTML and CSS for Bricks’ converter, the fixes its output needs, native widgets, Theme Style mapping and verification.
Tool reference
Section titled “Tool reference”All names use the emcp-tools/ namespace. Read the live input schema for optional fields, enums, limits and confirmation requirements; this table lists required inputs only.
| Tool | Access | Purpose | Required inputs |
|---|---|---|---|
bricks-get-context | Read | Read Bricks version, capabilities, breakpoints, the root font size, the status of Bricks’ own Abilities API and the supported editing workflow. Start here. | None |
bricks-list-elements | Read | Discover registered Bricks elements, including addons, and their nesting support. | None |
bricks-get-element-schema | Read | Read runtime Bricks controls, defaults, control groups and nestable child presets. Use exact keys and value shapes from these controls. | name |
bricks-list-pages | Read | List editable WordPress pages with their Bricks editor status; includes drafts and pages ready for conversion. | None |
bricks-get-page | Read | Read raw page/template elements, their area and content_hash. Component definitions are not expanded. | post_id |
bricks-create-page | Write | Create an empty draft page for Bricks. Returns its ID and content_hash for adding elements. | title |
bricks-set-page-elements | Write | Replace all elements in the page/template area with a validated flat tree. Requires expected_hash; use [] to clear. Components and executable-code changes are unsupported. | post_id, expected_hash, elements |
bricks-add-element | Write | Insert one native element with id/name/parent/settings and no children. Use a unique six-character lowercase ID. Query its schema first. | post_id, expected_hash, element |
bricks-update-element | Write | Merge top-level settings keys, replacing nested values in full. Preserves other settings, internal classes and tree links. unset_settings removes named keys. | post_id, expected_hash, element_id, settings |
bricks-move-element | Write | Move an element and its subtree to a parent and sibling position. Cycles and non-nestable parents are rejected. | post_id, expected_hash, element_id, parent |
bricks-remove-element | Write | Remove an element and all descendants from its page/template. Requires the current content_hash. | post_id, expected_hash, element_id |
bricks-list-templates | Read | Discover editable local Bricks templates and their types. Read/edit existing template elements with the page tools; template creation and conditions are not included. | None |
bricks-get-design-system | Read | Read existing global classes, variables, palettes, theme styles and actual breakpoints. Reference existing class IDs; this tool does not modify global data. | None |
Example request
Section titled “Example request”For a completed example with screenshots, follow Build a Bricks page with AI. It records a 98-element native draft built with EMCP Pro 3.18.0 and Bricks 2.4.1, including a mobile image-crop revision and frontend checks.
Create a draft Bricks services page using native sections, headings and buttons. Reuse the existing palette, preserve global styles, and show me the draft and mobile preview.
Read current state before editing and re-read after each save. If a hash is stale, inspect the changed document before rebuilding the request. A successful save is not proof of correct visual output: inspect the native editor and frontend.
Supported scope
Section titled “Supported scope”- Requires the active Bricks theme, EMCP Pro and Bricks selected in Page Builders.
- Component instances, executable-code changes (including JavaScript interactions), template creation and template conditions, popups and global design writes are outside this adapter. On Bricks 2.4+, use Bricks’ own abilities for those when they are enabled.
Troubleshooting
Section titled “Troubleshooting”If tools are missing, check versions, dependencies, integration selection, tool switches and user capabilities. Reconnect long-lived MCP clients after plugin updates or selection changes. If output differs after saving, inspect the native document and styles before retrying; do not bypass the adapter with direct metadata writes.
See the Bricks integration overview, builder setup guide and agent skills.
