Get the plugin
WP MCP/Integrations/GenerateBlocks MCP

GenerateBlocks MCP · Pro

GenerateBlocks MCP: AI editing for GenerateBlocks and GeneratePress.

A GenerateBlocks MCP server lets an AI agent build with GenerateBlocks and tune the GeneratePress theme around it. WP MCP validates every block attribute, compiles GenerateBlocks 2 styles the way the editor would, and snapshots each write.

Self-hosted · snapshot before every write · one-click undo

What it is

What a GenerateBlocks MCP server does.

GenerateBlocks is lean because it leaves little to chance at render time. It keeps a cached per-post stylesheet, and in version 2 the front end prints each block's css attribute exactly as stored. The editor compiles that css from a styles object every time a block is edited. A block written from outside the editor needs the same compile, or it renders unstyled.

That is the job of a GenerateBlocks MCP server. WP MCP compiles a GenerateBlocks 2 block's styles into the css the front end prints, refuses any value that could break out of its rule, and drops the post from the cached CSS list so the stylesheet rebuilds on the next view.

GenerateBlocks 2 compiles each block's styles into a css attribute that the front end prints, which is the step a tool must reproduce for a new block to look right. WP MCP compiles those styles the way the editor would, validates every attribute against the registered schema before it snapshots, and rebuilds the cached stylesheet after a write and after a rollback. The same pair of tools also tunes GeneratePress colors and layout, and creates GP Premium Elements.

Read and change

What WP MCP can read and change in GenerateBlocks.

It can read

  • Each GenerateBlocks block's registered attribute schema
  • Registered block patterns that use GenerateBlocks
  • GeneratePress global colors, typography and layout settings
  • GP Premium Elements, their hooks and display rules

It can change

  • Insert and update GenerateBlocks with every attribute validated first
  • Compile GenerateBlocks 2 styles into the css attribute the front end prints
  • Import a pattern in one undoable write
  • Set GeneratePress colors, typography, container width and header layout
  • Create GP Premium Elements and set their hook and display rules
block-suites-readblock-suites-writetheme-readtheme-writeadd-blockupdate-block

These are the real ability and operation names the agent calls. TheGenerateBlocks AI agent tool reference, GeneratePress AI agent tool reference and GP Premium Elements AI agent tool reference pages list the calls in detail.

Example prompts

Three things to ask first.

Add a GenerateBlocks container with a headline and a button linking to /contact.

Set the GeneratePress accent color to #c2410c and put the navigation below the header.

Create a hook Element that adds a call to action below the content on posts.

Add a GenerateBlocks container with a headline and a button linking to /contact.

add-block validates the attributes, compiles the styles into the css attribute, and snapshots the post. The cached stylesheet rebuilds on the next view.

Set the GeneratePress accent color to #c2410c and put the navigation below the header.

theme-write snapshots the generate_settings option and drops the cached dynamic CSS. Theme writes are opt-in.

Create a hook Element that adds a call to action below the content on posts.

A GP Premium Element is created with its hook and display rules, and the element post is snapshotted with all its meta.

Safety

Every GenerateBlocks write has a way back.

Block writes run through the surgical block engine with a post snapshot per call, and the cached stylesheet is rebuilt after a write and after a rollback. GeneratePress settings writes snapshot the generate_settings option and drop the cached dynamic CSS. Element writes snapshot the element post and all its meta.

Snapshot before every write

No tool that writes can skip it. The before-state is saved first, the change is applied second.

One-click undo

Restore a single change with rollback-operation or a whole agent run with rollback-session, from the agent or from wp-admin.

Schema and freshness checked

Every GenerateBlocks attribute is checked against the block's registered schema before any snapshot, and the write carries an expected_hash so a post edited since the read is refused.

Free or Pro

Part of WP MCP Pro.

The dedicated GenerateBlocks support, the GeneratePress settings pack and GP Premium Elements are all part of WP MCP Pro. There is a free path too: the free Gutenberg block tools edit any registered block, GenerateBlocks included, by raw markup, without the validation and style compiling.

WP MCP Pro starts at $49 a year for one site. See pricing for what each tier includes.

How to connect

Connect GenerateBlocks MCP in four steps.

  1. 01
    Install WP MCP

    Upload the free wpmcp plugin and activate it. It needs WordPress 6.9 or newer and PHP 8.1 or newer, and it runs entirely on your own server.

  2. 02
    Check the requirement

    GenerateBlocks for the block tools, GeneratePress for the settings pack, GP Premium with its Elements module for Elements. Theme writes are opt-in.

  3. 03
    Connect your client

    Add the site to Claude Code, Claude Desktop, Cursor or any MCP client with a WordPress application password, or the WP-CLI stdio bridge locally. OAuth 2.1 with full or read-only access is there too, once the site owner switches it on.

  4. 04
    Ask for the change

    Describe what you want done in GenerateBlocks. WP MCP snapshots the target, makes the change, and leaves a Restore button next to it in wp-admin.

Step-by-step guides: Claude,Claude Code andCursor. The docscover the safety model in full.

Frequently asked

GenerateBlocks MCP: questions, answered.

What is GenerateBlocks MCP?

It is GenerateBlocks editing for AI agents over the Model Context Protocol. WP MCP lets Claude, Cursor or any MCP client insert and update GenerateBlocks with validated attributes and compiled styles, snapshotted first.

Does it support GenerateBlocks 2?

Yes. GenerateBlocks 2 prints each block's css attribute as stored, so WP MCP compiles the styles object into that css the same way the editor does.

Is there a GeneratePress MCP too?

The same plugin covers it. A GeneratePress pack reads and sets global colors, typography and layout, and GP Premium Elements can be created and given display rules. This page covers both because most GeneratePress sites run GenerateBlocks as well.

Can it edit PHP hook Elements?

No. A GP Premium hook Element that executes PHP is read without its content and never written, and PHP execution is never switched on.

Is GenerateBlocks MCP free?

The dedicated support is Pro. The free Gutenberg tools can still edit GenerateBlocks by raw markup on a free install.

Does it work with GenerateBlocks 1 and 2?

Block writes are validated against each block's registered schema, and GenerateBlocks 2 styles are compiled into the css attribute the front end prints.

Is there a free route for GenerateBlocks?

The free Gutenberg block tools edit any registered block by raw markup, GenerateBlocks included, without schema validation or style compiling. The dedicated support is Pro.

Does GenerateBlocks MCP work with Claude, Claude Code and Cursor?

Yes. Claude Code and Cursor connect to WP MCP over HTTP with a WordPress application password, and Claude Desktop uses the desktop bundle from the WP MCP Connection screen. Clients that can only sign in with OAuth, such as the claude.ai custom connector, need OAuth switched on first with one line in wp-config.php, because it ships off. Once connected, the GenerateBlocks tools are available in every client the same way.

Point your AI agent at GenerateBlocks.