定制 magebitcom/magento2-mcp-cms-tools 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

magebitcom/magento2-mcp-cms-tools

最新稳定版本:v0.0.1

Composer 安装命令:

composer require magebitcom/magento2-mcp-cms-tools

包简介

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

README 文档

README

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 info@magebit.com

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 9
  • 依赖项目数: 0
  • 推荐数: 1

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固