magento-sql-mcp-server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| prompts | {
"listChanged": true
} |
| resources | {
"listChanged": true
} |
| completions | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_connection_profilesA | 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. |
| get_connection_statusA | 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. |
| validate_select_queryA | 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. |
| execute_select_queryA | 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. |
| list_tablesA | 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. |
| describe_tableA | 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. |
| search_columnsA | 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. |
| get_table_indexesA | Returns index definitions for a Magento table (SHOW INDEX). Useful for optimizing queries and understanding lookup paths. Use describe_table for column-level details. |
| count_table_rowsA | 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. |
| get_magento_configA | 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. |
| find_order_by_increment_idA | 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. |
| find_product_by_skuA | 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. |
| find_customer_by_emailA | 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. |
| find_customers_by_nameA | 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. |
| get_indexer_statusA | 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. |
| get_cron_scheduleA | Returns recent cron_schedule entries ordered by newest first. Filter by job_code pattern optionally. Use to debug stuck, missed, or error cron jobs. |
| explain_select_queryA | 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. |
| get_largest_tablesA | 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. |
| get_store_hierarchyA | 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. |
| get_eav_attributeA | 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. |
| get_url_rewriteA | 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. |
| get_module_versionsA | 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. |
| get_foreign_keysA | Returns foreign key relationships for a table from INFORMATION_SCHEMA. Use before writing JOINs to understand referential links. Use describe_table for column details. |
| get_cms_pageA | 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. |
| get_cms_blockA | 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. |
| audit_cms_page_blocksA | 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. |
| detect_magento_environmentA | 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. |
| get_configurable_childrenA | 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. |
| get_msi_stock_statusA | 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. |
| get_product_categoriesA | 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. |
| get_active_quote_itemsA | 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. |
| get_b2b_negotiable_quotesA | Returns active negotiable quotes for a B2B company_id. Requires Adobe Commerce B2B. Does NOT return requisition lists. |
| get_catalog_rule_priceA | 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. |
| get_order_shipment_tracksA | Returns shipment tracking numbers and carriers for an order increment_id. Does NOT return shipment line items. |
| get_staging_upcoming_updatesA | Returns future staging campaigns affecting a product SKU. Requires Adobe Commerce Content Staging. Does NOT apply staged values. |
| get_db_queue_backlogA | Returns message counts grouped by queue name and status from internal DB queues (when not using RabbitMQ). Does NOT consume messages. |
| get_order_tax_breakdownA | Returns tax rates and amounts applied to an order by increment_id. Does NOT recalculate tax — reads persisted sales_order_tax rows. |
| get_product_attributesA | 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. |
| find_active_quote_by_emailA | 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. |
| get_failed_cron_jobsA | Returns failed or stuck cron_schedule jobs from the last 24 hours. Does NOT fix crons — use get_cron_schedule for broader history. |
| audit_plaintext_secretsA | 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. |
| get_heavy_log_tablesA | Returns sizes of common Magento log/visitor tables. Does NOT truncate tables — planning aid for DB maintenance. |
| run_database_health_checkA | Single-call health snapshot: connection, edition detection, indexer issues, failed crons (24h), queue backlog summary. Does NOT replace individual diagnostic tools for deep dives. |
| list_available_toolsA | Returns the categorized catalog of all MCP tools with tags (OSS/MSI/B2B/Commerce). Use when unsure which tool fits a task. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| order-debug | Investigate a sales order by increment_id across order, items, addresses, and status history. |
| catalog-product-check | Inspect a product by SKU across entity, EAV attributes, stock, and URL rewrite. |
| customer-lookup | Find a customer by email and summarize account, group, and recent activity. |
| config-inspector | Read Magento store configuration paths from core_config_data. |
| indexer-status-check | Review Magento indexer and mview state for stale or invalid indexers. |
| checkout-funnel-debug | Trace active quote through cart, addresses, shipping rates, and order conversion. |
| msi-troubleshoot | Diagnose salable qty issues using MSI sources, reservations, and legacy stock comparison. |
| b2b-company-audit | Review company profile, structure, negotiable quotes, and credit settings. |
| staging-campaign-viewer | Inspect upcoming Content Staging campaigns for a product SKU (Commerce only). |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| common-tables | Reference guide of frequently used Magento 2 tables grouped by domain (catalog, sales, customer, config). |
| table-groups | List of available Magento table group slugs for magento://schema/group/{slug}. |
| tool-catalog | Categorized index of all MCP tools — use when navigating 40+ tools. |
| server-info | MCP server version, capabilities, and documentation links. |
| eav-cheatsheet | Magento EAV attribute reference — entity type IDs, common attribute codes, backend types, and value table patterns. |
| connection-status | Live database connection status for the active MAGENTO_SQL_PROFILE. |
| Catalog | Products, categories, attributes, inventory |
| Sales & Orders | Orders, quotes, invoices, shipments, payments |
| Customers | Customer accounts, addresses, groups |
| Configuration & System | Store config, modules, cache, indexers |
| CMS & Content | Pages, blocks, widgets |
| URL Rewrites & SEO | URL rewrites, search terms |
| EAV Infrastructure | Entity types, attributes, sets, and option values |
| Multi-Source Inventory (MSI) | Sources, stocks, reservations, salable qty |
| Indexers & Mviews | Indexer state, materialized views, changelog tables |
| B2B Commerce | Companies, negotiable quotes, shared catalogs (Commerce B2B only) |
| Price & Catalog Rules | Cart rules, catalog rules, indexed rule prices |
| Message Queues | Internal DB queue fallback when RabbitMQ is not used |
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jigarkkarangiya/magento-sql-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server