Labsco
MCP SERVER

WordPress Block MCP

by GravityKit

Edit WordPress a block at a time — change one heading without rewriting the page, and keep the Gutenberg markers intact.

CMS & Blog PublishingVerified
Summary
Solves the thing that makes agents dangerous in WordPress: editing without rewriting, and without breaking the block markers.

Because each block has a reference that outlives its neighbours shifting, an agent can read the page once and then chain inserts, updates and deletes across several turns without re-fetching. Two safety properties matter as much as the editing: every write lands as a revision you can revert by id, and concurrent writers are caught rather than silently overwriting each other.

What it is

A WordPress plugin plus a local server that exposes Gutenberg content as an addressable block tree, where every block carries a stable reference that survives its siblings moving.

What you get
  • A post's blocks read as structure, with each block fetchable on its own by stable reference or index
  • Single-block updates that leave the surrounding markup untouched, and attributes kept in sync with the HTML — change a heading's level and the tag changes with it
  • Batch edits applied atomically: several independent blocks in one revision, with a stale reference aborting the whole batch before anything is written
  • Insertion anchored to a specific block, deletion by reference, an atomic range replacement, and a full-page rewrite when restructuring is really the job
  • Structural operations on nested trees — update attributes or HTML, replace, remove, wrap in a group
  • Undo that actually undoes: every write creates a WordPress revision, and a revert tool takes the revision id the write returned
  • Patterns as first-class objects: list them by preference, read one, extract a repeated section into a new pattern, and insert it either synced or detached
  • Posts created and updated, terms listed for categories and tags, URLs resolved to post ids, and media uploaded to the library
  • Site-level inventory: block and pattern usage counts, registered block types with their tier and replacement, binding sources, and a scan that classifies each block as static, dynamic or dual
  • Theme templates and template parts listed, read and replaced, with a reset that drops a database override back to the theme file
  • Yoast SEO fields read and written per post, or across many posts in one call, when Yoast is active
Requirements

WordPress 6.0 or newer with Application Passwords enabled and served over HTTPS, PHP 7.4+, and the gk-block-mcp plugin installed and activated on the site. Node.js 20 or newer on your machine; the server runs from npm as @gravitykit/block-mcp with WORDPRESS_URL, WORDPRESS_USER and WORDPRESS_APP_PASSWORD. Custom post types must expose themselves to REST to be writable. What agents may write is set on the site: a server-side tier policy hard-rejects legacy blocks and suggests replacements, and inner HTML is filtered on every write.

Setup effort

One command plus a key — npx -y @gravitykit/block-mcp, then supply credentials