Skip to main content
Glama
magento-sql-mcp-server

magento-sql-mcp-server

Magento SQL MCP Server

npm version License: MIT Node.js

An MCP (Model Context Protocol) server that provides AI assistants with read-only access to a Magento 2 / Adobe Commerce MySQL database. It auto-detects local DDEV environments, connects to Adobe Commerce Cloud via CLI tunnels, and ships 50+ tools for orders, catalog, customers, CMS, config, indexers, and diagnostics.

Complementary MCP: Documentation MCPs (see Related MCPs) cover official Adobe Commerce docs. This package covers your live database.


Features

  • 50+ read-only tools for orders, products, customers, CMS, config, EAV, MSI, B2B, staging, cron, and indexers

  • Read-only by design — blocks INSERT/UPDATE/DELETE/DDL; masks password, token, and credit-card columns

  • Multi-environment profiles — local DDEV, Adobe Commerce Cloud (staging/production), direct remote DB, SSH tunnel

  • Zero-config local dev — reads app/etc/env.php, auto-detects DDEV MySQL port (cached 120s)

  • Commerce-aware — detects staging (updated_in), MSI, B2B; EAV joins use row_id on Commerce

  • CMS helpers — get_cms_page, audit_cms_page_blocks

  • Parameter aliases — query to sql, path to pathPattern, entity_type to entity_type_code

  • Per-call profile override — pass profile: "staging" on any tool without restarting MCP

  • MCP standards — Zod schemas, structured output, tool annotations, server instructions

  • Resources and prompts — table reference, EAV cheatsheet, order-debug and MSI-troubleshoot workflows

  • Dual transport — stdio (default) and optional HTTP for LibreChat / remote hosts


Related MCP server: Magento MCP Server

Quick setup for Cursor

Prerequisites

Requirement

Notes

Node.js 18+

node --version

Magento project

Must contain app/etc/env.php

DDEV

Optional; auto-detected for local profiles

Adobe Commerce Cloud CLI

Required for Cloud staging/production tunnels

  1. Open Cursor → Settings → MCP → Add new MCP server

  2. Configure:

Field

Value

Name

magento-sql

Type

command

Command

npx -y magento-sql-mcp-server

  1. Set environment variables:

Variable

Required

Example

MAGENTO_ROOT

Yes

/absolute/path/to/magento

MAGENTO_SQL_PROFILE

No

local (defaults to auto-detect)

  1. Restart Cursor. Verify with: Call get_connection_status

Option B: Project config (.cursor/mcp.json)

Create in your Magento project root:

{
  "mcpServers": {
    "magento-sql": {
      "command": "npx",
      "args": ["-y", "magento-sql-mcp-server"],
      "env": {
        "MAGENTO_ROOT": "/absolute/path/to/magento",
        "MAGENTO_SQL_PROFILE": "local"
      }
    }
  }
}

Run from source (development):

{
  "mcpServers": {
    "magento-sql": {
      "command": "node",
      "args": ["/absolute/path/to/magento-sql-mcp-server/dist/index.js"],
      "env": {
        "MAGENTO_ROOT": "/absolute/path/to/magento",
        "MAGENTO_SQL_PROFILE": "local"
      }
    }
  }
}

Option C: Init profile scaffold

npx magento-sql-mcp-server --init

Creates .cursor/magento-sql-mcp.json from examples/magento-sql-mcp.example.json.

Profiles named default, local, or dev auto-fallback to DDEV/env.php detection without a config file.


Setup for other tools

Claude Desktop

OS

Config path

macOS

~/Library/Application Support/Claude/claude_desktop_config.json

Windows

%APPDATA%\Claude\claude_desktop_config.json

Linux

~/.config/Claude/claude_desktop_config.json

Use the same mcpServers JSON as Cursor.

VS Code / GitHub Copilot

.vscode/mcp.json — same env vars; use "servers" key instead of "mcpServers".

Windsurf

~/.codeium/windsurf/mcp_config.json — same structure as Claude Desktop.


Connection profiles

Profile file

Create .cursor/magento-sql-mcp.json in your Magento project (see examples/magento-sql-mcp.example.json):

{
  "defaultProfile": "local",
  "profiles": {
    "local": { "mode": "auto" },
    "staging": {
      "mode": "direct",
      "database": {
        "host": "127.0.0.1",
        "port": 30000,
        "dbname": "your_project_stg",
        "username": "your_project_stg",
        "password": "${MAGENTO_STAGING_DB_PASSWORD}"
      }
    },
    "production": {
      "mode": "direct",
      "database": {
        "host": "127.0.0.1",
        "port": 30000,
        "dbname": "your_project_id",
        "username": "your_project_id",
        "password": "${MAGENTO_PRODUCTION_DB_PASSWORD}"
      }
    }
  }
}

Set passwords in MCP env (never commit credentials):

"env": {
  "MAGENTO_STAGING_DB_PASSWORD": "from-tunnel-info",
  "MAGENTO_PRODUCTION_DB_PASSWORD": "from-tunnel-info",
  "MAGENTO_SQL_PROFILE": "local"
}

Global shared profiles: ~/.config/magento-sql-mcp/config.json

Connection modes

Mode

Use case

auto

Local dev: reads env.php, detects DDEV port

env-php

Same as auto

direct

Connect to host:port (Cloud tunnel on 127.0.0.1:30000, VPN, allowlisted IP)

ssh-tunnel

MCP opens SSH port forward (non-Cloud hosts with standard SSH keys)

Config values support ${ENV_VAR} references for secrets.

Per-tool override: pass profile on any tool call without changing MAGENTO_SQL_PROFILE.


Adobe Commerce Cloud setup

Cloud MySQL runs on database.internal:3306 inside the environment. It is not reachable from the public internet. Use an SSH tunnel (same approach as DBeaver with SSH enabled).

Laptop                    Cloud environment
127.0.0.1:30000  --SSH--> database.internal:3306

Step 1: Install and authenticate Cloud CLI

Documentation: Adobe Commerce Cloud CLI

magento-cloud login
magento-cloud auth:info
magento-cloud project:list
magento-cloud environments -p YOUR_PROJECT_ID

Non-interactive auth: magento-cloud auth:api-token-login or export MAGENTO_CLOUD_CLI_TOKEN=...

Step 2: Open tunnel

# Staging
magento-cloud tunnel:open -p YOUR_PROJECT_ID -e staging

# Production
magento-cloud tunnel:open -p YOUR_PROJECT_ID -e production

Example output:

SSH tunnel opened to database at: mysql://user:pass@127.0.0.1:30000/dbname?compression=1

Default ports (single environment open):

Port

Service

30000

MySQL (primary)

30001

MySQL slave / MBI

30002+

OpenSearch, Valkey, etc.

Note: Staging and production both use port 30000. Close the current tunnel before opening another:

magento-cloud tunnel:close
magento-cloud tunnel:open -p YOUR_PROJECT_ID -e staging

Step 3: Get credentials

magento-cloud tunnel:info -p YOUR_PROJECT_ID -e staging
magento-cloud tunnel:info -P database

On the remote container (SSH):

echo $MAGENTO_CLOUD_RELATIONSHIPS | base64 -d | json_pp

CLI reference: Cloud CLI reference

Step 4: Configure MCP profiles

Cloud profiles use direct mode to 127.0.0.1:30000. The tunnel must remain open while MCP is connected.

Add .cursor/mcp.json and .cursor/magento-sql-mcp.json to .gitignore.

Step 5: Switch environments

Target

Steps

Local

tunnel:close → MAGENTO_SQL_PROFILE=local → reload MCP

Staging

tunnel:open -e staging → MAGENTO_SQL_PROFILE=staging or profile: "staging" per tool

Production

tunnel:open -e production → MAGENTO_SQL_PROFILE=production

Step 6: Verify connection

magento-cloud tunnels

MCP tools:

  • get_connection_status (with profile: "staging" or "production")

  • detect_magento_environment

Check

Staging

Production

Database name

Often *_stg suffix

Usually project ID

Cloud URL

mcstaging.yourdomain.com

mcprod.yourdomain.com

Order volume (7d)

Typically low

Active traffic

magento-cloud url -p YOUR_PROJECT_ID -e staging

Step 7: Close tunnel

magento-cloud tunnel:close

Cloud config URLs vs storefront URLs

core_config_data base URLs (web/unsecure/base_url, web/secure/base_url) on staging often still show the production domain (DB cloned from production). Actual storefront URLs are set by Cloud routes and Fastly.

Timezone-aware order queries

Store timezone: general/locale/timezone in core_config_data. Order created_at is stored in UTC. Convert store-local date ranges to UTC before querying sales_order. Use get_magento_config with pathPattern: "general/locale/%" to read the timezone.


Tools

Call list_available_tools for the full catalog with edition tags (OSS / MSI / B2B / Commerce).

Connection and environment

Tool

Description

list_connection_profiles

List configured DB profiles

get_connection_status

Test connectivity, host, database, latency

detect_magento_environment

Detect OSS vs Commerce, MSI, B2B, staging columns

run_database_health_check

Snapshot: connection, indexers, crons, queue backlog

SQL and schema

Tool

Parameters

Description

execute_select_query

sql or query, limit?, profile?

Read-only SELECT/SHOW/DESCRIBE/EXPLAIN (auto LIMIT 100)

validate_select_query

sql or query

Validate SQL safety without executing

explain_select_query

sql or query

EXPLAIN plan for a SELECT

list_tables

pattern?

List tables (optional SQL LIKE pattern)

describe_table

table

Column definitions from INFORMATION_SCHEMA

search_columns

pattern

Find tables containing a column name

get_table_indexes

table

Index details

get_foreign_keys

table

Foreign key relationships

count_table_rows

table

Row count for one table

get_largest_tables

limit?

Top tables by storage size

Catalog and products

Tool

Tag

Description

find_product_by_sku

OSS

Product entity + stock + websites

get_product_attributes

OSS

Name, price, status, visibility, url_key

get_configurable_children

OSS

Configurable to simple child SKUs

get_product_categories

OSS

Category assignments with names

get_eav_attribute

OSS

Attribute metadata + join hints

get_catalog_rule_price

OSS

Indexed catalog rule price

get_msi_stock_status

MSI

Physical qty, reservations, salable qty

get_staging_upcoming_updates

Commerce

Future staging campaigns for a SKU

Sales and customers

Tool

Description

find_order_by_increment_id

Order header + line items

find_customer_by_email

Exact email only + order stats

find_customers_by_name

Firstname/lastname LIKE search

find_active_quote_by_email

Most recent active cart

get_active_quote_items

Quote line items with parent-child nesting

get_order_shipment_tracks

Shipment tracking numbers

get_order_tax_breakdown

Tax rates applied to an order

get_b2b_negotiable_quotes

B2B negotiable quotes (optional company_id)

Operations, CMS, and config

Tool

Description

get_magento_config

core_config_data with value_status + scope inheritance

get_cms_page

CMS page by identifier + embedded block IDs

get_cms_block

CMS block by identifier or block_id

audit_cms_page_blocks

Active/inactive audit of blocks in a page

get_indexer_status

indexer_state + mview_state

get_cron_schedule

Recent cron entries

get_failed_cron_jobs

Failed/stuck crons (24h)

get_db_queue_backlog

Queue backlog (sampled on large DBs)

get_store_hierarchy

Websites, store groups, store views

get_module_versions

Installed module versions

get_url_rewrite

URL rewrite lookup

audit_plaintext_secrets

Flag plaintext secrets in config

get_heavy_log_tables

Oversized log/visitor tables

list_available_tools

Meta-tool: categorized tool catalog

Edition-specific tools return a clear error if required tables are missing.


Resources

URI

Description

magento://schema/common-tables

Common Magento tables by domain

magento://schema/groups

Table group index (JSON)

magento://schema/group/{slug}

Tables in a group (catalog, sales, customer, eav, msi, ...)

magento://schema/eav-cheatsheet

EAV entity types, attribute codes, value tables

magento://help/tools

Full tool catalog markdown

magento://server/info

Server version and capabilities

magento://connection/status

Live connection status (JSON)


Prompts

Prompt

Arguments

Description

order-debug

increment_id

Investigate order, items, addresses, status history

catalog-product-check

sku

Product entity, EAV, stock, URL rewrite

customer-lookup

email

Customer account, group, recent orders

config-inspector

path_pattern

Read store configuration paths

indexer-status-check

Review indexer and mview health

checkout-funnel-debug

email?

Trace quote to order conversion

msi-troubleshoot

sku

Diagnose MSI salable qty issues

b2b-company-audit

company_id

Audit B2B company and quotes

staging-campaign-viewer

sku

View upcoming staging campaigns


Usage examples

What you ask

What happens

"How many orders yesterday and total revenue?"

Timezone-aware query on sales_order

"Debug order 1000203870"

find_order_by_increment_id + line items

"What is the store timezone?"

get_magento_config on general/locale/timezone

"Check Fastly config on staging"

get_magento_config with profile: "staging"

"Audit CMS blocks on the home page"

audit_cms_page_blocks

"Is this Commerce with MSI?"

detect_magento_environment

"Why is salable qty 0 for SKU X?"

msi-troubleshoot + get_msi_stock_status

"Show indexer and failed cron status"

run_database_health_check


How it works

+-------------+     +---------------------------+     +-----------------------------+
|  AI Client  |---->|  MCP Server (stdio/HTTP)  |---->|  MySQL (read-only)          |
|  Cursor,    |<----|  50+ Tools                |<----|  Magento / Adobe Commerce   |
|  Claude,    |     |  7 Resources, 9 Prompts   |     +-----------------------------+
|  VS Code    |     +---------------------------+
+-------------+
                      |
                      +-- Profile: MAGENTO_SQL_PROFILE -> config JSON
                      +-- auto mode: env.php + DDEV port (cached 120s)
                      +-- Cloud: magento-cloud tunnel -> 127.0.0.1:30000
                      +-- Query validation: read-only only
                      +-- Auto LIMIT 100 (max 1000)
                      +-- Sensitive column masking
                      +-- Commerce staging: updated_in = 2147483647
  1. MCP host starts the server with MAGENTO_ROOT pointing at your Magento project

  2. resolveConnection() loads profile from .cursor/magento-sql-mcp.json or auto-detects

  3. For local DDEV: reads app/etc/env.php, runs ddev describe -j once (cached)

  4. Tools run validated read-only SQL or canned queries with Magento-aware joins

  5. Results return as structured JSON with Zod schemas


HTTP transport

npx magento-sql-mcp-server --http
# listens on http://localhost:3100 (override with MCP_HTTP_PORT)

LibreChat librechat.yaml:

mcpServers:
  magento-sql:
    type: streamable-http
    url: http://localhost:3100
    initTimeout: 30000

Configuration

Environment variables

Variable

Description

MAGENTO_ROOT

Magento project root (must contain app/etc/env.php)

MAGENTO_SQL_PROFILE

Active profile (default, local, staging, production)

MAGENTO_SQL_MODE

Override mode: auto, direct, ssh-tunnel, env-php

MAGENTO_SQL_HOST

DB host override

MAGENTO_SQL_PORT

DB port override

MAGENTO_SQL_DATABASE

Database name override

MAGENTO_SQL_USER

DB username override

MAGENTO_SQL_PASSWORD

DB password override

MAGENTO_STAGING_DB_PASSWORD

Staging password for profile ${...} refs

MAGENTO_PRODUCTION_DB_PASSWORD

Production password for profile ${...} refs

MAGENTO_SQL_SSH_HOST

SSH tunnel host override

MAGENTO_SQL_SSH_USER

SSH tunnel user override

MCP_HTTP_PORT

HTTP transport port (default: 3100)

Per-tool overrides: magentoRoot and profile arguments on most tools.


Troubleshooting

MCP server failed to start

  • Verify Node.js 18+: node --version

  • Test manually: npx magento-sql-mcp-server (should print "running on stdio")

  • Ensure MAGENTO_ROOT points to a directory with app/etc/env.php

Profile local not found

v2.4.0+ auto-fallbacks local/default/dev to auto-detect. Upgrade or run:

npx magento-sql-mcp-server --init

Connection refused on Cloud (port 30000)

  • Tunnel not running: magento-cloud tunnel:open -p PROJECT_ID -e staging

  • Wrong environment: magento-cloud tunnels then close and reopen

  • Tunnel dropped after reboot: re-run tunnel:open

Connected to wrong environment

Run get_connection_status and check database. Staging names often end in _stg; production matches project ID.

Missing password environment variable

Copy password from magento-cloud tunnel:info into MCP env. Do not commit it.

DDEV connection refused / wrong port

  • Ensure DDEV is running: ddev start

  • DDEV port is cached for 120s after first discovery

Tool parameter errors

Use

Instead of

sql

query

pathPattern

path

entity_type_code

entity_type

Slow queue / health check tools

On large databases, queue backlog uses sampled counts. Check sampled: true in results.

Green dot does not appear in Cursor

  • Restart Cursor

  • Refresh MCP server in settings

  • Check Output panel for errors


Security

  • All queries validated as read-only before execution

  • Auto LIMIT (default 100, max 1000) on SELECT without explicit LIMIT

  • Password, token, and credit-card columns masked in results

  • Customer/admin password hashes never exposed

  • Use read-only MySQL users for Cloud profiles when available

  • Never commit credentials; use MCP env or ${ENV_VAR} in config JSON

  • Close Cloud tunnels when finished; avoid heavy full-table scans on production


Development

Run from source

git clone https://github.com/jigarkkarangiya/magento-sql-mcp-server.git
cd magento-sql-mcp-server
npm install
npm run build
MAGENTO_ROOT=/path/to/magento npm start

Tests

npm test
MAGENTO_ROOT=/path/to/magento npm run test:live
MAGENTO_ROOT=/path/to/magento npm run test:scenarios

Project structure

magento-sql-mcp-server/
├── src/                 # MCP server source
├── scripts/             # live-tool-smoke.ts, scenario-benchmark.ts
├── tests/               # unit tests
├── examples/            # magento-sql-mcp.example.json
└── dist/                # compiled JS (npm run build)

Requirements

Requirement

Required for

Node.js 18+

All modes

PHP CLI

auto mode (reads env.php)

DDEV CLI

Optional; local auto-detect

Adobe Commerce Cloud CLI

Cloud staging/production tunnels

OpenSSH client

ssh-tunnel mode

MySQL read access

All modes


Find this MCP


Documentation MCPs for Adobe Commerce and related platforms. Install alongside this server for docs + database coverage.

Package

npm

Description

adobe-commerce-docs-mcp

npm

Merchant, admin, cloud, operations docs (Experience League)

adobe-commerce-dev-docs-mcp

npm

Developer docs (developer.adobe.com/commerce)

adobe-commerce-kb-mcp

npm

Support Knowledge Base, patches, troubleshooting

adobe-app-builder-docs-mcp

npm

App Builder, I/O Runtime, Commerce extensibility

adobe-api-mesh-docs-mcp

npm

API Mesh, GraphQL gateway

adobe-io-events-docs-mcp

npm

I/O Events, webhooks

aem-live-docs-mcp

npm

AEM / Edge Delivery Services (aem.live)

odoo-docs-mcp

npm

Odoo documentation

Combined Cursor config:

{
  "mcpServers": {
    "magento-sql": {
      "command": "npx",
      "args": ["-y", "magento-sql-mcp-server"],
      "env": {
        "MAGENTO_ROOT": "/absolute/path/to/magento",
        "MAGENTO_SQL_PROFILE": "local"
      }
    },
    "adobe-commerce-docs": {
      "command": "npx",
      "args": ["-y", "adobe-commerce-docs-mcp"]
    },
    "adobe-commerce-dev-docs": {
      "command": "npx",
      "args": ["-y", "adobe-commerce-dev-docs-mcp"]
    },
    "adobe-commerce-kb": {
      "command": "npx",
      "args": ["-y", "adobe-commerce-kb-mcp"]
    }
  }
}

All MCP packages: github.com/jigarkkarangiya?tab=repositories&q=mcp

Available Tools

44 tools
audit_cms_page_blocksAudit CMS Page BlocksA
Read-onlyIdempotent

Loads a CMS page by identifier, parses block_id references from its content, and reports each block's identifier, title, and is_active status. Returns counts of active vs inactive embedded blocks — replaces manual SQL + regex parsing.

Inputs: identifier (required), profile, magentoRoot. Returns: note, rows, sampled, rowCount, +1 more

audit_plaintext_secretsAudit Plaintext SecretsA
Read-onlyIdempotent

Flags core_config_data paths that may contain unencrypted secrets (password/key/token paths with plaintext values). Values are masked in output. Does NOT decrypt encrypted values.

Inputs: profile, magentoRoot. Returns: note, rows, sampled, rowCount, +1 more

count_table_rowsCount Table RowsA
Read-onlyIdempotent

Returns approximate or exact row count for a single table. Safer than SELECT * on large Magento tables. Use before execute_select_query to gauge table size.

Inputs: table (required), profile, magentoRoot. Returns: note, rows, sampled, rowCount, +1 more

describe_tableDescribe TableA
Read-onlyIdempotent

Returns column definitions (name, type, nullable, keys, default) for a Magento table from INFORMATION_SCHEMA. Use before writing JOINs. Use list_tables if you don't know the exact table name.

Inputs: table (required), profile, magentoRoot. Returns: note, rows, sampled, rowCount, +1 more

detect_magento_environmentDetect Magento EnvironmentA
Read-onlyIdempotent

Probes the database schema to detect OSS vs Commerce (row_id staging), MSI, and B2B availability. Run this first on an unfamiliar installation before using edition-specific tools.

Inputs: profile, magentoRoot. Returns: note, rows, sampled, rowCount, +1 more

execute_select_queryExecute SELECT QueryA
Read-onlyIdempotent

Runs a read-only SELECT/SHOW/DESCRIBE/EXPLAIN against the Magento database. Auto-appends LIMIT 100 if missing. Parameter: sql (alias: query). Sensitive columns (password, token, cc_) are masked.

Inputs: sql, limit, query, profile, +1 more. Returns: note, rows, sampled, rowCount, +1 more

explain_select_queryExplain SELECT QueryA
Read-onlyIdempotent

Runs EXPLAIN on a validated SELECT query to show the execution plan without returning row data. Use to diagnose slow queries before running them on large Magento tables.

Inputs: sql, query, profile, magentoRoot. Returns: note, rows, sampled, rowCount, +1 more

find_active_quote_by_emailFind Active Quote by EmailA
Read-onlyIdempotent

Returns the most recent active quote for a customer email. Does NOT return quote items — use get_active_quote_items with the returned quote_id.

Inputs: email (required), profile, magentoRoot. Returns: note, rows, sampled, rowCount, +1 more

find_customer_by_emailFind Customer by EmailA
Read-onlyIdempotent

Exact email lookup on customer_entity (full valid email required). Returns order count summary. For partial name search use find_customers_by_name. Password hash is never returned.

Inputs: email (required), profile, magentoRoot. Returns: note, rows, sampled, rowCount, +1 more

find_customers_by_nameFind Customers by NameA
Read-onlyIdempotent

Searches customer_entity by firstname, lastname, or full name (LIKE). firstname/lastname/email are static columns on customer_entity — not EAV. For exact email use find_customer_by_email.

Inputs: name (required), limit, profile, magentoRoot. Returns: note, rows, sampled, rowCount, +1 more

find_order_by_increment_idFind Order by Increment IDA
Read-onlyIdempotent

Looks up a sales order by increment_id and returns order header plus line items (up to 50). Faster than writing JOINs manually. For payment details use execute_select_query on sales_order_payment.

Inputs: increment_id (required), profile, magentoRoot. Returns: note, rows, sampled, rowCount, +1 more

find_product_by_skuFind Product by SKUA
Read-onlyIdempotent

Looks up catalog_product_entity by SKU. Returns entity_id, type_id, attribute_set_id, timestamps. For EAV attribute values use execute_select_query on catalog_product_entity_* tables — use get_eav_attribute first to find backend_type.

Inputs: sku (required), profile, magentoRoot. Returns: note, rows, sampled, rowCount, +1 more

get_active_quote_itemsGet Active Quote ItemsA
Read-onlyIdempotent

Returns quote_item rows for a quote_id with parent-child nesting (configurable/bundle). Does NOT return quote addresses — use execute_select_query on quote_address.

Inputs: quote_id (required), profile, magentoRoot. Returns: note, rows, sampled, rowCount, +1 more

get_b2b_negotiable_quotesGet B2B Negotiable QuotesA
Read-onlyIdempotent

Returns active negotiable quotes for a B2B company_id. Requires Adobe Commerce B2B. Does NOT return requisition lists.

Inputs: profile, company_id, magentoRoot. Returns: note, rows, sampled, rowCount, +1 more

get_catalog_rule_priceGet Catalog Rule PriceA
Read-onlyIdempotent

Returns indexed catalog rule price for a SKU on a website and customer group for today. Does NOT calculate rules live — reads catalogrule_product_price index only.

Inputs: sku (required), profile, website_id, magentoRoot, +1 more. Returns: note, rows, sampled, rowCount, +1 more

get_cms_blockGet CMS BlockA
Read-onlyIdempotent

Looks up a CMS block by identifier (e.g. 'footer_links') or numeric block_id. Returns title, is_active, timestamps. Applies Commerce staging filter when present. For blocks embedded in a page use audit_cms_page_blocks.

Inputs: profile, block_id, identifier, magentoRoot. Returns: note, rows, sampled, rowCount, +1 more

get_cms_pageGet CMS PageA
Read-onlyIdempotent

Looks up a CMS page by identifier (e.g. 'home'). Returns title, content, is_active, store assignments, and embedded block_id references parsed from content. Applies Commerce staging filter (updated_in) when present.

Inputs: identifier (required), profile, magentoRoot. Returns: note, rows, sampled, rowCount, +1 more

get_configurable_childrenGet Configurable ChildrenA
Read-onlyIdempotent

Returns simple product children linked to a configurable parent SKU via catalog_product_super_link. Does NOT return super attributes — use execute_select_query on catalog_product_super_attribute.

Inputs: sku (required), profile, magentoRoot. Returns: note, rows, sampled, rowCount, +1 more

get_connection_statusGet Connection StatusA
Read-onlyIdempotent

Tests database connectivity for the active MAGENTO_SQL_PROFILE. Returns host, database, latency, and error details if unreachable. Use before running queries on an unfamiliar environment.

Inputs: profile, magentoRoot. Returns: host, port, user, error, +5 more

get_cron_scheduleGet Cron ScheduleA
Read-onlyIdempotent

Returns recent cron_schedule entries ordered by newest first. Filter by job_code pattern optionally. Use to debug stuck, missed, or error cron jobs.

Inputs: limit, profile, magentoRoot, job_code_pattern. Returns: note, rows, sampled, rowCount, +1 more

get_db_queue_backlogGet DB Queue BacklogA
Read-onlyIdempotent

Returns message counts grouped by queue name and status from internal DB queues (when not using RabbitMQ). Does NOT consume messages.

Inputs: profile, queue_name, magentoRoot. Returns: note, rows, sampled, rowCount, +1 more

get_eav_attributeGet EAV AttributeA
Read-onlyIdempotent

Looks up an EAV attribute by entity_type_code (alias: entity_type) and attribute_code. Returns backend_type and query guidance. static backend_type → query base entity table, not EAV value tables.

Inputs: attribute_code (required), profile, entity_type, magentoRoot, +1 more. Returns: note, rows, sampled, rowCount, +1 more

get_failed_cron_jobsGet Failed Cron JobsA
Read-onlyIdempotent

Returns failed or stuck cron_schedule jobs from the last 24 hours. Does NOT fix crons — use get_cron_schedule for broader history.

Inputs: profile, magentoRoot. Returns: note, rows, sampled, rowCount, +1 more

get_foreign_keysGet Foreign KeysA
Read-onlyIdempotent

Returns foreign key relationships for a table from INFORMATION_SCHEMA. Use before writing JOINs to understand referential links. Use describe_table for column details.

Inputs: table (required), profile, magentoRoot. Returns: note, rows, sampled, rowCount, +1 more

get_heavy_log_tablesGet Heavy Log TablesA
Read-onlyIdempotent

Returns sizes of common Magento log/visitor tables. Does NOT truncate tables — planning aid for DB maintenance.

Inputs: profile, magentoRoot. Returns: note, rows, sampled, rowCount, +1 more

get_indexer_statusGet Indexer StatusA
Read-onlyIdempotent

Returns indexer_state and mview_state rows. Use to diagnose stale indexers, 'reindex required', or stuck mview consumers. Does NOT trigger reindex — CLI: bin/magento indexer:reindex.

Inputs: profile, magentoRoot. Returns: note, rows, sampled, rowCount, +1 more

get_largest_tablesGet Largest TablesA
Read-onlyIdempotent

Returns the biggest Magento tables by storage size (DATA + INDEX) from INFORMATION_SCHEMA. Use to find bloated tables before running broad SELECTs. Row counts are approximate for InnoDB.

Inputs: limit, profile, magentoRoot. Returns: note, rows, sampled, rowCount, +1 more

get_magento_configGet Magento ConfigA
Read-onlyIdempotent

Reads store configuration from core_config_data using a path LIKE pattern (pathPattern, alias: path). Returns value_status (set/empty/null) and inherited default-scope value when scoped rows are empty.

Inputs: path, profile, magentoRoot, pathPattern. Returns: note, rows, sampled, rowCount, +1 more

get_module_versionsGet Module VersionsA
Read-onlyIdempotent

Reads installed module schema/data versions from setup_module. Optionally filter by module name pattern (e.g. 'Magento_Catalog', 'Brainvire_%'). Use to verify module upgrades applied correctly.

Inputs: profile, magentoRoot, module_pattern. Returns: note, rows, sampled, rowCount, +1 more

get_msi_stock_statusGet MSI Stock StatusA
Read-onlyIdempotent

Returns MSI physical qty, reservation offset, and salable qty per source for a SKU. Requires MSI tables. For legacy stock use find_product_by_sku.

Inputs: sku (required), profile, stock_id, magentoRoot. Returns: note, rows, sampled, rowCount, +1 more

get_order_shipment_tracksGet Order Shipment TracksA
Read-onlyIdempotent

Returns shipment tracking numbers and carriers for an order increment_id. Does NOT return shipment line items.

Inputs: increment_id (required), profile, magentoRoot. Returns: note, rows, sampled, rowCount, +1 more

get_order_tax_breakdownGet Order Tax BreakdownA
Read-onlyIdempotent

Returns tax rates and amounts applied to an order by increment_id. Does NOT recalculate tax — reads persisted sales_order_tax rows.

Inputs: increment_id (required), profile, magentoRoot. Returns: note, rows, sampled, rowCount, +1 more

get_product_attributesGet Product AttributesA
Read-onlyIdempotent

Returns common EAV attributes (name, price, status, visibility, url_key) for a SKU with store scope fallback. Does NOT return all attributes — use get_eav_attribute + execute_select_query for custom attributes.

Inputs: sku (required), profile, store_id, magentoRoot. Returns: note, rows, sampled, rowCount, +1 more

get_product_categoriesGet Product CategoriesA
Read-onlyIdempotent

Returns category assignments for a product SKU with category path and name. Does NOT return full category tree — use execute_select_query on catalog_category_entity for hierarchy.

Inputs: sku (required), profile, magentoRoot. Returns: note, rows, sampled, rowCount, +1 more

get_staging_upcoming_updatesGet Staging Upcoming UpdatesA
Read-onlyIdempotent

Returns future staging campaigns affecting a product SKU. Requires Adobe Commerce Content Staging. Does NOT apply staged values.

Inputs: sku (required), profile, magentoRoot. Returns: note, rows, sampled, rowCount, +1 more

get_store_hierarchyGet Store HierarchyA
Read-onlyIdempotent

Returns the Magento store hierarchy: websites, store groups, and store views with codes and names. Use to map store_id / website_id when querying scoped data.

Inputs: profile, magentoRoot. Returns: note, rows, sampled, rowCount, +1 more

get_table_indexesGet Table IndexesA
Read-onlyIdempotent

Returns index definitions for a Magento table (SHOW INDEX). Useful for optimizing queries and understanding lookup paths. Use describe_table for column-level details.

Inputs: table (required), profile, magentoRoot. Returns: note, rows, sampled, rowCount, +1 more

get_url_rewriteGet URL RewriteA
Read-onlyIdempotent

Searches url_rewrite by request_path or target_path pattern. Returns entity_type, entity_id, store_id, redirect_type. Use to debug 404s, duplicate URLs, or redirect loops.

Inputs: path_pattern (required), profile, magentoRoot. Returns: note, rows, sampled, rowCount, +1 more

list_available_toolsList Available ToolsA
Read-onlyIdempotent

Returns the categorized catalog of all MCP tools with tags (OSS/MSI/B2B/Commerce). Use when unsure which tool fits a task.

Inputs: tag. Returns: note, rows, sampled, rowCount, +1 more

list_connection_profilesList Connection ProfilesA
Read-onlyIdempotent

Lists database connection profiles from .cursor/magento-sql-mcp.json and ~/.config/magento-sql-mcp/config.json. Shows the active profile from MAGENTO_SQL_PROFILE. Use get_connection_status to verify connectivity.

Inputs: no named parameters. Returns: profiles, magentoRoot, activeProfile, defaultProfile

list_tablesList Database TablesA
Read-onlyIdempotent

Lists Magento database tables, optionally filtered by SQL LIKE pattern (e.g. 'sales_%'). Use describe_table for column details. Use search_columns when you know a column name but not the table.

Inputs: pattern, profile, magentoRoot. Returns: note, rows, sampled, rowCount, +1 more

run_database_health_checkRun Database Health CheckA
Read-onlyIdempotent

Single-call health snapshot: connection, edition detection, indexer issues, failed crons (24h), queue backlog summary. Does NOT replace individual diagnostic tools for deep dives.

Inputs: profile, magentoRoot. Returns: note, rows, sampled, rowCount, +1 more

search_columnsSearch ColumnsA
Read-onlyIdempotent

Finds tables containing columns matching a name pattern (e.g. 'increment_id', 'sku', 'email'). Returns table name, column name, and data type. Use describe_table next for full column details.

Inputs: pattern (required), profile, magentoRoot. Returns: note, rows, sampled, rowCount, +1 more

validate_select_queryValidate SELECT QueryA
Read-onlyIdempotent

Validates SQL is read-only and safe to execute without running it. Returns normalized SQL with auto LIMIT preview for SELECT statements. Use before execute_select_query on large or unfamiliar tables.

Inputs: sql, limit, query. Returns: valid, reason, normalizedSql

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 44 tools

    Disambiguation5/5

    Every tool has a clearly defined, distinct purpose with explicit 'does NOT' notes to prevent overlap. For instance, get_indexer_status vs get_cron_schedule, get_active_quote_items vs find_active_quote_by_email, and get_largest_tables vs get_heavy_log_tables all address separate concerns. The descriptions effectively eliminate ambiguity.

    Naming Consistency5/5

    Tool names follow a highly consistent verb_noun pattern: get_ for retrieval, find_ for lookups, list_ for enumerations, describe_/search_/count_/explain_ for specific operations, and a few bespoke verbs like audit_/detect_/run_. The naming is uniform and predictable across all 44 tools, making it easy to anticipate tool behavior.

    Tool Count2/5

    With 44 tools, the surface is substantially overloaded. While Magento is a complex system, the sheer number forces agents to wade through many highly specific tools, increasing selection error risk. Typical well-scoped servers hold 3–15 tools; this exceeds the '25+' threshold for excessive count and feels heavy even for a comprehensive Magento diagnostics suite.

    Completeness4/5

    The server covers a broad range of Magento database operations: order/product/customer lookups, EAV, categories, CMS, cron, staging, B2B, MSI, queue monitoring, secrets audit, and health checks. The generic execute_select_query handles ad-hoc queries, filling most gaps. Minor missing areas like sales reports or customer group queries are not directly tooled but are reachable via raw SQL, so no dead ends exist.

    Maintenance

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to interact with MySQL databases through natural language for schema introspection, safe SQL execution, and full CRUD operations. It provides built-in tools for managing users, products, and orders while ensuring security through parameterized queries and read-only SQL checks.
      -
    • A
      license
      B
      quality
      D
      maintenance
      Enables AI assistants to manage Adobe Commerce and Magento 2 instances through business-level tools for catalog, promotions, CMS, and SEO. It features secure OAuth 1.0 authentication, safety guardrails for bulk operations, and built-in diagnostic reports for store health.
      38
      38 npm
      2
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to securely interact with MySQL databases, including listing tables, viewing schemas, and executing read-only SQL queries through natural language.
      7
      -