LocalHero Org

LH MCP Block Transformer

Plugin

  • Type: Plugin

Converts HTML or Markdown content into native Gutenberg block markup, and back, using the automattic/blocks-engine-php-transformer library. Exposed as MCP abilities so AI-authored content can be written as real, editable Gutenberg blocks instead of opaque HTML.

Internal developer/content tooling — not migration-critical, not independently useful outside LocalHero’s own MCP surface, so this entry is kept private.

Abilities

  • lh-mcp-block-transformer/convert-to-blocks – HTML or Markdown → serialized block markup, with fallback diagnostics for anything that didn’t match a specific block.
  • lh-mcp-block-transformer/convert-from-blocks – the mirror: existing block markup → HTML or Markdown, for reading an existing block-based post before revising it.
  • lh-mcp-block-transformer/get-pattern-guide – static reference data describing the HTML/CSS shapes that reliably trigger richer blocks (cover, columns, media-text, buttons), so content can be authored to hit them intentionally rather than falling back to a generic wrapper.

Architecture note

Both convert-to-blocks and convert-from-blocks route through the same FormatBridge::convertResult() call, which is symmetric across the html/markdown/blocks adapters — markdown input just cannot express the CSS shapes that trigger the richer block patterns, since it has no way to declare inline styles.