# freento/module-mcp

> MCP (Model Context Protocol) server for Magento 2 - All-in-one module

`composer require freento/module-mcp`

Canonical URL: https://packagento.com/freento/module-mcp

## At a glance

- **Vendor**: Freento (https://packagento.com/freento.md)
- **Latest version**: 1.2.1 — released 2026-07-14
- **Pricing**: Free
- **Package type**: Magento 2 module
- **Status**: active, accepting new buyers

## Installation

Packagento is licence-gated, so even free packages need a licence on a project before Composer can resolve them.

1. **Sign in or create an account** at https://packagento.com/customer/account/.

2. **Add the package to your account.** Open https://packagento.com/freento/module-mcp and complete the free checkout. A licence is minted automatically.

3. **Create or pick a project, then activate the licence on it.**
   - Projects represent the Magento installs you deploy to. Manage them at https://packagento.com/projects/.
   - Activate the new licence on the project you'll deploy this package to. Activation is what generates the Composer credentials scoped to that project.

4. **Add the project credentials to your Magento codebase.**

   Grab the project's public + private key from https://packagento.com/projects/ (open the project, then its Credentials tab), and add them to `auth.json`:

   ```json
   {
     "http-basic": {
       "packagento.com": {
         "username": "ppk_live_...",
         "password": "psk_live_..."
       }
     }
   }
   ```

   Add the Packagento Composer repository to `composer.json`:

   ```json
   {
     "repositories": [
       { "type": "composer", "url": "https://packagento.com" }
     ]
   }
   ```

5. **Install and apply.**

   ```bash
   composer require freento/module-mcp:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## What it does

MCP (Model Context Protocol) server for Magento 2 - All-in-one module

## README

Connect your Magento 2 store to AI assistants like Claude and ChatGPT using the Model Context Protocol (MCP).

### Table of Contents

- [Overview](#overview)
- [Requirements](#requirements)
- [Installation](#installation)
- [Configuration](#configuration)
  - [Claude Code](#claude-code)
  - [Claude Desktop](#claude-desktop)
  - [ChatGPT](#chatgpt)
- [Available Tools](#available-tools)
- [Usage Examples](#usage-examples)
- [Filtering & Operators](#filtering--operators)
- [Aggregation & Analytics](#aggregation--analytics)
- [Troubleshooting](#troubleshooting)
- [Security](#security)

### Overview

Freento MCP is a Magento 2 extension that implements the [Model Context Protocol](https://modelcontextprotocol.io/) — an open standard for connecting AI assistants to external data sources. With this extension, you can:

- Query orders, products, customers, and inventory using natural language
- Generate sales reports and analytics on the fly
- Monitor system health (PHP, MySQL, cache, search engine versions)
- Audit admin users and security settings

**How it works:**

```
┌─────────────────┐         ┌─────────────────┐         ┌─────────────────┐
│  AI Assistant   │  HTTP   │  Freento MCP    │         │   Magento 2 /   │
│  (Claude/GPT)   │ ◄─────► │  Server         │ ◄─────► │Server Resources │
└─────────────────┘ JSON-RPC└─────────────────┘         └─────────────────┘
```

The MCP server acts as a secure bridge between AI assistants and your Magento installation, providing access to various store resources including the database, configuration, and other Magento subsystems.

### Requirements

- Magento 2.4.x (Open Source or Commerce)
- PHP 8.1 or higher
- An MCP-compatible AI client (Claude Code, Claude Desktop, or ChatGPT with MCP plugin)

### Installation

#### Via Composer (Recommended)

```bash
composer require freento/module-mcp
php bin/magento module:enable Freento_Mcp
php bin/magento setup:upgrade
php bin/magento cache:flush
```

#### Manual Installation

1. Download the module and extract to `app/code/Freento/Mcp/`
2. Enable the module:

```bash
php bin/magento module:enable Freento_Mcp
php bin/magento setup:upgrade
php bin/magento cache:flush
```

#### Verify Installation

```bash
php bin/magento module:status Freento_Mcp
```

Expected output: `Module is enabled`

### Configuration

#### Step 1: Create ACL Role

1. In Magento Admin, go to **System > Freento MCP > ACL Rules**
2. Click **Add New Role**
3. Enter a name (e.g., "AI Assistant")
4. Select which tools the role can access:
   - Sales tools (orders, quotes, credit memos)
   - Catalog tools (products, stock)
   - Customer tools
   - Admin tools
   - System tools
5. **Save** the role

#### Step 2: Create OAuth Client

1. Go to **System > Freento MCP > AI MCP Clients**
2. Click **Add New Client**
3. Enter a name (e.g., "Claude Code")
4. Select the ACL Role created in Step 1
5. **Save** the client
6. Copy the **Client ID** and **Client Secret**

#### Step 3: Generate Access Token

1. Open the OAuth Client you created
2. Click **Generate OTP** — copy the one-time password (valid 24 hours)
3. Click **Generate Token** — enter the OTP when prompted
4. Copy the generated **Access Token**

#### Claude Code

Add to your project's `.mcp.json`:

```json
{
  "mcpServers": {
    "magento": {
      "type": "http",
      "url": "https://your-store.com/freento_mcp/index/index",
      "headers": {
        "Authorization": "Bearer YOUR_ACCESS_TOKEN"
      }
    }
  }
}
```

Then reconnect MCP in Claude Code:

```
/mcp
```

#### Claude Desktop

Edit your Claude Desktop config (`~/.config/claude/claude_desktop_config.json` on Linux/Mac or `%APPDATA%\Claude\claude_desktop_config.json` on Windows):

```json
{
  "mcpServers": {
    "magento": {
      "type": "http",
      "url": "https://your-store.com/freento_mcp/index/index",
      "headers": {
        "Authorization": "Bearer YOUR_ACCESS_TOKEN"
      }
    }
  }
}
```

Restart Claude Desktop to apply changes.

#### ChatGPT and Other Web Clients

For web-based AI tools that support OAuth 2.0:

1. Register your store's MCP endpoint: `https://your-store.com/freento_mcp/index/index`
2. Enter the **Client ID** and **Client Secret** from Step 2
3. When prompted to authorize, enter the **OTP** generated from the OAuth Client page
4. Complete the OAuth authorization flow

### Available Tools

Each tool supports flexible filtering, sorting, and pagination. Combined with AI, these capabilities become virtually unlimited — the AI can execute multiple queries, cross-reference data, group and aggregate results, and provide intelligent analysis.

**AI can:**
- Run multiple queries across different entities in one conversation
- Filter by any field using operators: `eq`, `neq`, `in`, `like`, `gt`, `gte`, `lt`, `lte`
- Sort and paginate results
- Aggregate with `sum`, `count`, `avg`, `min`, `max`
- Group by field or time period (day, month)
- Combine and analyze data from multiple sources

#### Sales Tools

| Tool | Description |
|------|-------------|
| `get_orders` | Query orders with filtering, pagination, and aggregation |
| `get_order_items` | Get order line items (products in orders) |
| `get_quotes` | Query shopping carts (active and abandoned) |
| `get_quote_items` | Get cart line items |
| `get_creditmemos` | Query credit memos |

#### Marketing Tools

| Tool | Description |
|------|-------------|
| `get_cart_price_rules` | Query cart price rules |
| `get_coupons` | Query coupons |

#### Catalog Tools

_(README truncated for .md surface. Full README on https://packagento.com/freento/module-mcp.)_

## Recent Versions

| Version | Released |
|---|---|
| 1.2.1 | 2026-07-14 |
| 1.2.0 | 2026-05-12 |
| 1.1.0 | 2026-03-27 |
| v1.0.0 | 2026-02-03 |

## Dependencies

### Require

| Package | Constraint |
|---|---|
| php | >=8.1 |

## Quality

Latest release (1.2.1) fails the Packagento QA pipeline. Verdicts below are per-cell (Magento line × PHP version) for the matrixed tools, and run-once for the static / security tiers.


### Compatibility

Each Magento line is installed on its supported PHP versions, then the module is built (DI compile + static-content deploy). Cells show passed / failed / untested; staircase gaps render as `–`.

| 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. Never affect the Compatibility verdict — 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.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| PHPCS | Warning | 32 | 32 warnings (ruleset: Magento2), 23 auto-fixable with phpcbf |
| PHPMD | Warning | 35 | 35 rule violations (MissingImport:24, ExcessiveClassComplexity:3, TooManyPublicMethods:3, NumberOfChildren:2, TooManyMethods:2) |
| Cpd | Pass | 0 |  |
| Composer validate | Info | 1 | valid; 1 advisory note (composer validate --strict) |

#### PHPStan

Type-checks the module against a real Magento install. Re-runs per Magento + PHP version because resolvable symbols differ between releases.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | 7 | 7 | – | – |
| 2.4.8 | – | 7 | 7 | – |
| 2.4.9 | – | – | 7 | 7 |


### Tests

Unit and integration suites run per Magento + PHP cell. Test failures speak to the module's behaviour, not its compatibility with a line, so they're reported here separately.

#### Unit Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | Pass | Pass | – | – |
| 2.4.8 | – | Pass | not tested | – |
| 2.4.9 | – | – | 3 | 3 |

#### Integration Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | Error | Error | – | – |
| 2.4.8 | – | Error | Error | – |
| 2.4.9 | – | – | Error | Error |


### Security

Dependency-advisory audit (composer audit) plus a source malware scan. A malware detection fails the version outright.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| Composer audit | Pass | 0 |  |
| Malware scan | Pass | 0 |  |

## Licence and pricing

Free. A licence is still minted on checkout and bound to your project for Composer access — no payment step.

Refundable within 14 days of first purchase via https://packagento.com/account/refunds/.

## Install via Claude Code or any MCP client

The Packagento MCP server can run the licence + project + Composer steps above in one tool call:

```
purchase_and_install_packages(
  composer_names=["freento/module-mcp"],
  project_id="proj_xxx"
)
```

This handles cart, checkout, licence minting, project activation, and writes auth.json credentials. Connect a client with `claude mcp add packagento https://mcp.packagento.com`. Full setup at https://packagento.com/docs/mcp-setup.

## Vendor

Freento is a Magento 2 vendor on Packagento. See https://packagento.com/freento.md for their full catalogue.

