Download the PHP package yu-dev/module-mcp-server without Composer

On this page you can find all versions of the php package yu-dev/module-mcp-server. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package module-mcp-server

Magento MCP Server

Packagist Version PHP Version Magento License

An MCP (Model Context Protocol) server implemented as a Magento 2 module. It exposes store operations as typed, access-controlled MCP tools over the Streamable HTTP transport, so MCP clients (claude.ai Connectors, Claude Desktop, etc.) can read and manage the store from a chat session.

What the AI can do with it

Example phrases that resolve to tool calls:

Catalog & content (anonymous)

Business insights (admin login required)

Store management (admin login + write switch)

Prompts (one-click workflows)

Requirements

Installation

Composer (recommended)

Manual (app/code)

Copy the module to app/code/Yu/McpServer (e.g. git clone into that path), then run the same bin/magento commands as above.

Smoke test:

Configuration

Stores → Configuration → Advanced → MCP Server:

Setting Default Effect
Enable Public (Anonymous) Tools Yes Anonymous tools/call on ACL-free tools. Off = every tool call requires an authenticated admin; tools/list stays open for OAuth discovery
Enable Write Tools No Master switch for all WriteToolInterface tools. Off = hidden from tools/list, rejected at tools/call
Log Full Request/Response Bodies No Debug-level dump of raw JSON-RPC payloads to var/log/mcp.log. May contain personal data — enable only while debugging

Connecting a client

Add https://your-store.com/mcp as a custom connector (claude.ai: Settings → Connectors; Claude Desktop: Settings → Connectors → Add custom connector). The flow is automatic:

  1. The client reads the discovery documents (/.well-known/oauth-protected-resource, /.well-known/oauth-authorization-server) and registers itself via Dynamic Client Registration (RFC 7591).
  2. Public tools answer immediately. The first call to a restricted tool returns HTTP 401 + WWW-Authenticate with a resource_metadata pointer, which triggers the client's OAuth flow.
  3. The user's browser lands on a login form backed by Magento's own admin authentication (\Magento\Backend\Model\Auth — lockout and 2FA apply). The issued token carries that admin's ACL permissions.

Protocol

Single endpoint POST /mcp, JSON-RPC 2.0, MCP Streamable HTTP transport. Batch requests supported. GET /mcp opens an empty SSE stream (some clients probe with GET before registering).

Method Notes
initialize Version negotiation: echoes the client's protocolVersion if supported (2025-11-25 / 2025-06-18 / 2025-03-26 / 2024-11-05), otherwise answers with the newest. Capabilities: tools, prompts
notifications/initialized Notification, no response body (HTTP 202)
tools/list All registered tools with JSON Schema arguments. Not filtered by identity — restricted tools must stay discoverable so clients can hit the 401 that starts the login flow. Write tools are hidden while the write switch is off
tools/call ACL enforcement happens here. Tool business-logic errors come back as result.isError = true, never as JSON-RPC errors
prompts/list / prompts/get Prompt templates with declared arguments
ping Health check

Error semantics: anonymous call to a restricted tool → HTTP 401 (+ WWW-Authenticate); authenticated but missing the ACL resource → JSON-RPC error -32002 (Forbidden) in a 200 response; over the anonymous rate limit → HTTP 429 + Retry-After.

Tools

40 tools, one class each in a domain subfolder of Model/Tools/ (Product/, Order/, Review/, ...), registered via DI in etc/di.xml. Tool names are domain-first ({domain}_{action}), so a sorted tools/list groups by domain and the name prefix matches the class's subfolder. Access is declared per tool through getRequiredAclResource(): null = public, otherwise the Magento ACL resource the caller's admin role must hold.

Public (anonymous, rate-limited)

Tool Purpose
product_search Search by name/SKU
product_get Full product card by SKU
product_check_stock Qty + in-stock flag for up to 50 SKUs
category_tree Category tree
category_products Products of a category
promotion_list Active cart rules (coupon codes never exposed)
review_list_for_product Approved reviews of a product
cms_page_get / cms_block_get Active CMS content by identifier
store_info Currencies, locale, active shipping/payment methods (code + title only), public contacts

Public tools return the customer view: disabled products are indistinguishable from nonexistent ones. An authenticated admin holding Magento_Catalog::products gets the admin view through the same tools — disabled products included and marked with status (ContextAwareToolInterface).

Read, ACL-gated

Tool ACL resource
order_get Magento_Sales::sales
order_list_by_customer Magento_Sales::sales
order_list Magento_Sales::sales
sales_summary Magento_Sales::sales
cart_list_abandoned Magento_Reports::abandoned
product_low_stock Magento_Catalog::products
review_list Magento_Review::reviews_all
customer_search Magento_Customer::manage
product_sales_velocity Magento_Sales::sales
sales_bestsellers Magento_Sales::sales
sales_by_category Magento_Sales::sales
sales_compare_periods Magento_Sales::sales
sales_payment_stats Magento_Sales::sales
sales_shipping_stats Magento_Sales::sales
search_terms_report Magento_Reports::report_search
catalog_health_report Magento_Catalog::products
cms_page_list Magento_Cms::page
cms_block_list Magento_Cms::block
system_health Magento_Backend::system

The sales tools aggregate over collection rows in PHP with documented scan limits (a truncated: true flag appears when a period exceeds them). system_health is read-only by design: it reports invalid indexers, failed/stuck cron jobs and disabled/invalidated caches, but fixing them stays admin work.

Write, ACL-gated + write switch

Tool ACL resource Limits
product_create Magento_Catalog::products Simple products; created disabled unless explicitly enabled
product_update Magento_Catalog::products name, price, special_price (incl. removal), descriptions, status. No SKU/category/image changes
product_update_stock Magento_Catalog::products Status + qty only, batch by SKU, all-or-nothing
category_create Magento_Catalog::categories Duplicate sibling name = error, never an implicit update
cms_page_create / cms_block_create Magento_Cms::save / Magento_Cms::block Created inactive by default
cms_page_update / cms_block_update Magento_Cms::save / Magento_Cms::block Content/title/active flag; identifier immutable; content can't be emptied
review_moderate Magento_Review::reviews_all Status-only (approve/reject), batch, all-or-nothing. Review text/rating never editable
category_update Magento_Catalog::categories name, description, active flag, menu visibility, meta fields. No URL key changes or parent moves; root categories rejected
product_duplicate Magento_Catalog::products Simple products; the copy is always created disabled with zero stock

There are no delete tools of any kind, by design. Every successful write call is audit-logged (var/log/mcp.log, info level, no customer personal data).

Prompts

Prompt Arguments Purpose
morning_report period (optional, default yesterday) Renders instructions that walk the model through sales_summary, order_list (processing), review_list (pending, sentiment judged from text), cart_list_abandoned, product_low_stock, and format a digest. Explicitly forbids calling review_moderate without the owner's confirmation
store_checkup period (optional, default last 30 days) Full health inspection: system_health, catalog_health_report, search_terms_report (zero-result demand), pending review_list, product_low_stock + product_sales_velocity restock ranking — summarized into a "Fix now / This week / Backlog" action plan. Diagnose-only: forbids all write calls during the checkup
recover_carts days (optional, default 7, 1-30) Abandoned-cart triage (chase now / batch reminder / skip) plus a personalised recovery email draft per cart worth chasing. Drafts only — nothing is sent, and the model may not invent discounts on its own
restock_advisor horizon_days (optional, default 30, 7-90) Purchase plan: product_low_stock + per-SKU product_sales_velocity, ranked by estimated days until stockout, with reorder quantities sized to cover the horizon. Read-only — forbids product_update_stock; the table goes to the supplier, not back into Magento
review_moderate_queue created_from (optional, YYYY-MM-DD) Walks the pending review queue with an approve / reject / needs-owner verdict per review (sentiment judged from the text, not the stars), then applies via review_moderate — only after the owner's explicit confirmation, max 20 ids per call
product_content_writer limit (optional, default 5, 1-10) Drafts the descriptions catalog_health_report found missing and applies them via product_update strictly one product per confirmation. Meta descriptions are drafted but handed to the owner — the update tool deliberately can't write meta fields
zero_result_rescue Storefront searches that returned nothing → probes the catalog for synonyms/translations/typos with product_search → classifies each term as a naming gap (with the exact word to add to which SKU), an assortment gap (with demand numbers) or noise. Read-only worklist
sales_dashboard period (optional, default last 30 days) Interactive dashboard rendered as charts: KPI row (revenue / orders / average order value), a trend bucketed by day/week/month via repeated sales_summary calls, revenue by category, bestsellers, payment & shipping mix, plus takeaways. Falls back to markdown tables in clients without artifact support
sales_trends period, compare_to (optional, default last 30 days vs the same-length period immediately before) Two-period comparison: KPI cards with percentage deltas (computed server-side by sales_compare_periods, never re-derived by the model), a current-vs-baseline chart per currency, and the bestseller movers between the two periods
product_performance period, top (optional, default last 30 days / 10, 1-15) Product charts: top sellers by revenue AND by quantity (the mismatches are the interesting ones), each enriched with product_sales_velocity; highlights bestsellers with under 14 days of stock cover. Read-only

Security

Logging

Dedicated channel var/log/mcp.log (method, tool name, duration, success/failure; write audit records). Payload bodies are logged only at debug level behind the config flag.

Development

Adding a tool: implement ToolInterface (or WriteToolInterface / ContextAwareToolInterface) as one class in Model/Tools/, register it in etc/di.xml under ToolRegistry's tools argument, add a unit test. Rules: DI only (no ObjectManager), data access through repositories/collections (no raw SQL), tools never see JSON-RPC — they return arrays or throw exceptions.


All versions of module-mcp-server with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
magento/framework Version ^103.0.4
magento/module-authorization Version ^100.4.4
magento/module-backend Version ^102.0.4
magento/module-catalog Version ^104.0.4
magento/module-catalog-inventory Version ^100.4.4
magento/module-cms Version ^104.0.4
magento/module-cron Version ^100.4.4
magento/module-customer Version ^103.0.4
magento/module-indexer Version ^100.4.4
magento/module-quote Version ^101.2.4
magento/module-reports Version ^100.4.4
magento/module-review Version ^100.4.4
magento/module-sales Version ^103.0.4
magento/module-sales-rule Version ^101.2.4
magento/module-search Version ^101.1.4
magento/module-store Version ^101.1.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package yu-dev/module-mcp-server contains the following files

Loading the files please wait ...