magento-sql-mcp-server
Provides read-only access to a Magento 2 / Adobe Commerce MySQL database, enabling AI assistants to query and diagnose data across orders, catalog, customers, CMS, store configuration, EAV, MSI, B2B, staging, cron, indexers, and more. Supports SELECT/SHOW/DESCRIBE/EXPLAIN queries with automatic limits and connection profile management for local, cloud, and remote databases.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@magento-sql-mcp-server show me orders placed in the last 7 days with their statuses"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Magento SQL MCP Server
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 userow_idon CommerceCMS helpers —
get_cms_page,audit_cms_page_blocksParameter aliases —
querytosql,pathtopathPattern,entity_typetoentity_type_codePer-call profile override — pass
profile: "staging"on any tool without restarting MCPMCP 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+ |
|
Magento project | Must contain |
DDEV | Optional; auto-detected for local profiles |
Adobe Commerce Cloud CLI | Required for Cloud staging/production tunnels |
Option A: npx (recommended)
Open Cursor → Settings → MCP → Add new MCP server
Configure:
Field | Value |
Name |
|
Type |
|
Command |
|
Set environment variables:
Variable | Required | Example |
| Yes |
|
| No |
|
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 --initCreates .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 |
|
Windows |
|
Linux |
|
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 |
| Local dev: reads |
| Same as |
| Connect to host:port (Cloud tunnel on |
| 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:3306Step 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_IDNon-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 productionExample output:
SSH tunnel opened to database at: mysql://user:pass@127.0.0.1:30000/dbname?compression=1Default 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 stagingStep 3: Get credentials
magento-cloud tunnel:info -p YOUR_PROJECT_ID -e staging
magento-cloud tunnel:info -P databaseOn the remote container (SSH):
echo $MAGENTO_CLOUD_RELATIONSHIPS | base64 -d | json_ppCLI 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 |
|
Staging |
|
Production |
|
Step 6: Verify connection
magento-cloud tunnelsMCP tools:
get_connection_status(withprofile: "staging"or"production")detect_magento_environment
Check | Staging | Production |
Database name | Often | Usually project ID |
Cloud URL |
|
|
Order volume (7d) | Typically low | Active traffic |
magento-cloud url -p YOUR_PROJECT_ID -e stagingStep 7: Close tunnel
magento-cloud tunnel:closeCloud 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 configured DB profiles |
| Test connectivity, host, database, latency |
| Detect OSS vs Commerce, MSI, B2B, staging columns |
| Snapshot: connection, indexers, crons, queue backlog |
SQL and schema
Tool | Parameters | Description |
|
| Read-only SELECT/SHOW/DESCRIBE/EXPLAIN (auto LIMIT 100) |
|
| Validate SQL safety without executing |
|
| EXPLAIN plan for a SELECT |
|
| List tables (optional SQL LIKE pattern) |
|
| Column definitions from INFORMATION_SCHEMA |
|
| Find tables containing a column name |
|
| Index details |
|
| Foreign key relationships |
|
| Row count for one table |
|
| Top tables by storage size |
Catalog and products
Tool | Tag | Description |
| OSS | Product entity + stock + websites |
| OSS | Name, price, status, visibility, url_key |
| OSS | Configurable to simple child SKUs |
| OSS | Category assignments with names |
| OSS | Attribute metadata + join hints |
| OSS | Indexed catalog rule price |
| MSI | Physical qty, reservations, salable qty |
| Commerce | Future staging campaigns for a SKU |
Sales and customers
Tool | Description |
| Order header + line items |
| Exact email only + order stats |
| Firstname/lastname LIKE search |
| Most recent active cart |
| Quote line items with parent-child nesting |
| Shipment tracking numbers |
| Tax rates applied to an order |
| B2B negotiable quotes (optional |
Operations, CMS, and config
Tool | Description |
|
|
| CMS page by identifier + embedded block IDs |
| CMS block by identifier or |
| Active/inactive audit of blocks in a page |
|
|
| Recent cron entries |
| Failed/stuck crons (24h) |
| Queue backlog (sampled on large DBs) |
| Websites, store groups, store views |
| Installed module versions |
| URL rewrite lookup |
| Flag plaintext secrets in config |
| Oversized log/visitor tables |
| Meta-tool: categorized tool catalog |
Edition-specific tools return a clear error if required tables are missing.
Resources
URI | Description |
| Common Magento tables by domain |
| Table group index (JSON) |
| Tables in a group (catalog, sales, customer, eav, msi, ...) |
| EAV entity types, attribute codes, value tables |
| Full tool catalog markdown |
| Server version and capabilities |
| Live connection status (JSON) |
Prompts
Prompt | Arguments | Description |
|
| Investigate order, items, addresses, status history |
|
| Product entity, EAV, stock, URL rewrite |
|
| Customer account, group, recent orders |
|
| Read store configuration paths |
| Review indexer and mview health | |
|
| Trace quote to order conversion |
|
| Diagnose MSI salable qty issues |
|
| Audit B2B company and quotes |
|
| View upcoming staging campaigns |
Usage examples
What you ask | What happens |
"How many orders yesterday and total revenue?" | Timezone-aware query on |
"Debug order 1000203870" |
|
"What is the store timezone?" |
|
"Check Fastly config on staging" |
|
"Audit CMS blocks on the home page" |
|
"Is this Commerce with MSI?" |
|
"Why is salable qty 0 for SKU X?" |
|
"Show indexer and failed cron status" |
|
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 = 2147483647MCP host starts the server with
MAGENTO_ROOTpointing at your Magento projectresolveConnection()loads profile from.cursor/magento-sql-mcp.jsonor auto-detectsFor local DDEV: reads
app/etc/env.php, runsddev describe -jonce (cached)Tools run validated read-only SQL or canned queries with Magento-aware joins
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: 30000Configuration
Environment variables
Variable | Description |
| Magento project root (must contain |
| Active profile ( |
| Override mode: |
| DB host override |
| DB port override |
| Database name override |
| DB username override |
| DB password override |
| Staging password for profile |
| Production password for profile |
| SSH tunnel host override |
| SSH tunnel user override |
| HTTP transport port (default: |
Per-tool overrides: magentoRoot and profile arguments on most tools.
Troubleshooting
MCP server failed to start
Verify Node.js 18+:
node --versionTest manually:
npx magento-sql-mcp-server(should print "running on stdio")Ensure
MAGENTO_ROOTpoints to a directory withapp/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 --initConnection refused on Cloud (port 30000)
Tunnel not running:
magento-cloud tunnel:open -p PROJECT_ID -e stagingWrong environment:
magento-cloud tunnelsthen close and reopenTunnel 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 startDDEV port is cached for 120s after first discovery
Tool parameter errors
Use | Instead of |
|
|
|
|
|
|
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
envor${ENV_VAR}in config JSONClose 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 startTests
npm test
MAGENTO_ROOT=/path/to/magento npm run test:live
MAGENTO_ROOT=/path/to/magento npm run test:scenariosProject 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 |
|
DDEV CLI | Optional; local auto-detect |
Adobe Commerce Cloud CLI | Cloud staging/production tunnels |
OpenSSH client |
|
MySQL read access | All modes |
Find this MCP
Registry | Link |
npm | |
GitHub |
Related MCPs
Documentation MCPs for Adobe Commerce and related platforms. Install alongside this server for docs + database coverage.
Package | npm | Description |
Merchant, admin, cloud, operations docs (Experience League) | ||
Developer docs (developer.adobe.com/commerce) | ||
Support Knowledge Base, patches, troubleshooting | ||
App Builder, I/O Runtime, Commerce extensibility | ||
API Mesh, GraphQL gateway | ||
I/O Events, webhooks | ||
AEM / Edge Delivery Services (aem.live) | ||
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 toolsaudit_cms_page_blocksAudit CMS Page BlocksARead-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 SecretsARead-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 RowsARead-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 TableARead-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 EnvironmentARead-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 QueryARead-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 QueryARead-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 EmailARead-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 EmailARead-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 NameARead-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 IDARead-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 SKUARead-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 ItemsARead-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 QuotesARead-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 PriceARead-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 BlockARead-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 PageARead-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 ChildrenARead-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 StatusARead-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 ScheduleARead-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 BacklogARead-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 AttributeARead-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 JobsARead-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 KeysARead-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 TablesARead-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 StatusARead-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 TablesARead-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 ConfigARead-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 VersionsARead-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 StatusARead-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 TracksARead-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 BreakdownARead-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 AttributesARead-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 CategoriesARead-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 UpdatesARead-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 HierarchyARead-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 IndexesARead-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 RewriteARead-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 ToolsARead-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 ProfilesARead-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 TablesARead-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 CheckARead-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 ColumnsARead-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 QueryARead-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
Scored across 44 tools
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.
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.
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.
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
Related MCP Connectors
Work with your database from AI tools: ask, export, approved changes, and scheduled jobs.
PostgreSQL, MySQL, and SQL Server in one session. 26 read-only MCP tools for AI agents.
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
Amazon Ads, Seller Central, Vendor Central and AMC data for AI agents. Read-only by default.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables 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.-
- AlicenseBqualityDmaintenanceEnables 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.3838 npm2MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to securely interact with MySQL databases, including listing tables, viewing schemas, and executing read-only SQL queries through natural language.7-
- AlicenseNot gradedqualityDmaintenanceEnables natural language queries about Magento store catalog, sales, and customer data through dynamic tools for AI assistants.MIT