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

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

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

magebitcom/magento2-mcp-marketing-tools

Composer 安装命令:

composer require magebitcom/magento2-mcp-marketing-tools

包简介

Promotion-domain MCP tools for Magebit_Mcp (catalog rules, cart price rules, coupons)

README 文档

README

This is a sub-module for the Magento2 MCP module

Promotion-domain MCP tools for Magebit_Mcp. Reads and toggles catalog price rules and cart price rules, and manages coupon supply for cart rules — all as MCP tools.

Each tool is a thin wrapper over a Magento service contract (CatalogRuleRepositoryInterface, SalesRule\RuleRepositoryInterface, CouponRepositoryInterface, CouponManagementInterface) and composes its read responses from field resolvers that 3rd-party modules can extend.

Install

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

Tool catalog

Catalog rules (read)

Tool What it does
marketing.catalog_rule.list Paginated catalog-rule search; filter by name, is_active, customer_group_id, website_id, from_date_after, to_date_before.
marketing.catalog_rule.get Single catalog rule by id with full detail (identity, scope, schedule, conditions, action, lifecycle).

Cart rules (read)

Tool What it does
marketing.cart_rule.list Paginated cart-rule search; filter by name, is_active, coupon_type, customer_group_id, website_id, date range.
marketing.cart_rule.get Single cart rule by id including the full condition and action_condition trees as JSON.

Coupons (read)

Tool What it does
marketing.cart_rule.coupon.list Paginated coupon search; filter by rule_id, code substring, type (MANUAL/GENERATED), is_primary, created_after.
marketing.cart_rule.coupon.get Single coupon by id.

Catalog rules (write)

Write tools require the global magebit_mcp/general/allow_writes flag and the token's own allow_writes flag to be 1. Destructive operations additionally set the requires_confirmation hint so MCP clients prompt before firing.

Tool Confirm? What it does
marketing.catalog_rule.set_active no Toggles is_active on the rule; storefront prices update on the next catalogrule_rule reindex.
marketing.catalog_rule.delete yes Permanently deletes a catalog rule.
marketing.catalog_rule.apply_all yes Invalidates catalogrule_rule so the next reindex pass rebuilds the catalogrule_product_* aggregation tables. Heavy on realtime indexers — run off-peak.

Cart rules (write)

Tool Confirm? What it does
marketing.cart_rule.set_active no Toggles is_active on the rule. Disabling immediately stops it applying to new carts; existing orders are unaffected.
marketing.cart_rule.delete yes Permanently deletes a cart rule and cascade-deletes its coupons via FK. Existing orders are unaffected.

Coupons (write)

Tool Confirm? What it does
marketing.cart_rule.coupon.generate yes Bulk-generates coupon codes for a cart rule. The rule must have coupon_type = SPECIFIC_COUPON and use_auto_generation = true.
marketing.cart_rule.coupon.delete yes Bulk-deletes coupons by id list or code list. Existing orders that previously used a deleted code are unaffected.

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.

Extending

See docs/EXTENDING.md for:

  • adding a new field to any tool response via *FieldResolverInterface;
  • adding a new filter to a list tool via *FilterTranslatorInterface;
  • 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

magebitcom/magento2-mcp-marketing-tools 适用场景与选型建议

magebitcom/magento2-mcp-marketing-tools 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 346 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 05 月 06 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 magebitcom/magento2-mcp-marketing-tools 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 magebitcom/magento2-mcp-marketing-tools 我们能提供哪些服务?
定制开发 / 二次开发

基于 magebitcom/magento2-mcp-marketing-tools 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

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