magebitcom / magento2-mcp-cms-tools

magebitcom/magento2-mcp-cms-tools

CMS-domain MCP tools for Magebit_Mcp (read + write over CMS pages and blocks)

magento2-module Compatibility: 2.4.7-2.4.9 Code Quality: Fail Tests: N/A Security: Pass MIT

Magento2 MCP - CMS Tools

This is a sub-module for the Magento2 MCP module


CMS-domain MCP tools for Magebit_Mcp. Reads and writes against CMS pages
and blocks.

Each tool is a thin wrapper over a Magento service contract
(PageRepositoryInterface, BlockRepositoryInterface,
GetPageByIdentifierInterface, GetBlockByIdentifierInterface) and composes
its read response from field resolvers that 3rd-party modules can extend.

Install

composer require magebitcom/magento2-mcp-cms-tools
bin/magento module:enable Magebit_McpCmsTools
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:flush

Ships with Magebit_Mcp as its only Magebit dependency. If you only want
the base MCP transport (no CMS tools), install Magebit_Mcp alone; this
module is designed to be optional.

Tool catalog

Read tools

Tool What it does
cms.page.list Paginated CMS-page search; filter by identifier (exact / glob / array), title substring, is_active, store_id, website_id (expanded to store-view ids), creation_time range, update_time range.
cms.page.get Single CMS page by numeric id or identifier (+ optional store_id for identifier lookup).
cms.block.list Paginated CMS-block search with the same filter vocabulary as pages.
cms.block.get Single CMS block by numeric id or identifier.

Write tools

All writes require the global magebit_mcp/general/allow_writes flag and
the token's own allow_writes flag to be 1. Every write sets
requires_confirmation so MCP clients (Claude Desktop, etc.) prompt before
firing.

Tool Confirm? Delegates to Underlying ACL
cms.page.create yes PageRepositoryInterface::save() Magento_Cms::save
cms.page.update yes PageRepositoryInterface::save() (PATCH) Magento_Cms::save
cms.page.delete yes PageRepositoryInterface::delete() Magento_Cms::page_delete
cms.block.create yes BlockRepositoryInterface::save() Magento_Cms::block
cms.block.update yes BlockRepositoryInterface::save() (PATCH) Magento_Cms::block
cms.block.delete yes BlockRepositoryInterface::delete() Magento_Cms::block

Every write tool also implements Magebit\Mcp\Api\UnderlyingAclAwareInterface
so the handler blocks calls from admins who wouldn't be allowed to perform
the same action in the admin UI.

Identifier lookups and store scope

cms.page.get, cms.page.update, cms.page.delete (and the block siblings)
accept either id (numeric primary key) or identifier (the admin URL
key). Identifier lookups require a store scope:

  • Omit store_id → defaults to 0 ("All Store Views"), which is the scope
    CMS pages and blocks created from the admin UI default to. This is what
    most identifier-only lookups want.
  • Pass store_id: <N> → look the entity up under store view N.

Pages / blocks assigned to a specific store view are invisible from other
stores by design.

Extending

See docs/EXTENDING.md for:

  • adding a new field to any tool response via PageFieldResolverInterface
    / BlockFieldResolverInterface;
  • adding a new filter to cms.page.list / cms.block.list via
    PageFilterTranslatorInterface / BlockFilterTranslatorInterface;
  • the ACL layering rules for custom write tools.

License

Released under the MIT License.


magebit (1)

Have questions or need help? Contact us at [email protected]

No changelog yet

The vendor hasn't published a changelog. Tagged releases appear in the Versions tab.

Versions
Version Stability QA Status Compatibility Released
v1.0.0 stable Fail Magento 2.4.7-2.4.9 Details 2026-05-26 11:57:02
v0.0.1 stable Not tested Not yet tested Details 2026-05-06 09:35:26

Requires 3

Package Constraint
magebitcom/magento2-mcp-module *
magento/framework ^103.0
php >=8.1

Compatibility

Each Magento release line is installed on its supported PHP versions, then the module is built (DI compilation + static-content deploy) and its unit and integration suites are run. The matrix shows the lines and PHP versions the module is confirmed to install and run on. Code-quality results further down (phpstan, phpcs, …) are reported separately and never affect compatibility.

Compatibility matrix (Magento × PHP)
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 Pass Pass
2.4.8 Pass Pass
2.4.9 Pass Pass

Code Quality

Advisory checks against the module's source. Static analysis runs once across the whole module; PHPStan re-runs per Magento + PHP version because resolvable symbols differ between releases. These NEVER affect the Compatibility badge — a phpcs finding can't make a module incompatible.

Static analysis

Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.

Static analysis results
Tool Status Findings Summary
PHPCS Warning 16 16 warnings (ruleset: Magento2) — 16 auto-fixable with phpcbf
PHPMD Warning 6 6 rule violations (CyclomaticComplexity:2, NPathComplexity:2, ExcessiveClassComplexity:1, TooManyPublicMethods:1)
Cpd Warning 2 2 duplicated chunks spanning 75 total lines (min-lines=5, min-tokens=70)
Composer validate Info 1 valid; 1 advisory note (composer validate --strict)

PHPStan

Type-checks the module's PHP against a real Magento install at the configured gate level. Re-runs per Magento and PHP version because resolvable symbols differ between releases. Cell → details modal.

PHPStan results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 11 11
2.4.8 12 12
2.4.9 12 12

Tests

Unit and integration suites, run for each applicable Magento and PHP version. A test failure speaks to the module's behaviour, not its compatibility with a Magento line, so it is reported here separately and never reddens the compatibility matrix.

Unit tests

Unit tests results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 N/A N/A
2.4.8 N/A N/A
2.4.9 N/A N/A

Integration tests

Integration tests results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 N/A N/A
2.4.8 N/A N/A
2.4.9 N/A N/A

Security

Security checks run directly against the module: an audit of its declared dependencies for known vulnerabilities (composer audit) and a scan of its source for malware and web-shell signatures. Each runs once. A malware detection fails the version outright.

Security results
Tool Status Findings Summary
Composer audit Pass 0
Malware scan Pass 0
License
MIT

More from magebitcom

View vendor
Make it pay

Turn an existing module into recurring revenue.

If you already maintain a Magento 2 module on GitHub or GitLab, listing it on Packagento takes about five minutes. We mirror your tags, handle distribution signing, and route paid licenses through Stripe Connect, so you can keep shipping the way you already do.