Magento 2 Development MCP Server for AI agents - provides cache management, module tools, and system diagnostics
npm install @elgentos/magento2-dev-mcpA Model Context Protocol (MCP) server for Magento 2 development, designed to integrate with AI agents like Claude, Cursor, Continue.dev, and Augment Code.
No installation required! Use directly with npx:
``bash`
npx @elgentos/magento2-dev-mcp
`bash`
npm install @elgentos/magento2-dev-mcp
1. Add to your AI agent's MCP configuration:
`json`
{
"mcpServers": {
"magento2-dev": {
"command": "npx",
"args": ["@elgentos/magento2-dev-mcp"],
"cwd": "/path/to/your/magento2/project"
}
}
}
2. Restart your AI agent to load the MCP server
3. Start using Magento 2 development tools through your AI agent!
See AI Platform Configuration Examples for platform-specific setup instructions.
get-di-preferences - Get Magento 2 dependency injection preferences list
Parameters:
- scope (optional): The scope to get DI preferences forglobal
- Options: , adminhtml, frontend, crontab, webapi_rest, webapi_soap, graphql, doc, adminglobal
- Default:
Available Scopes:
- global - Global scope (default)adminhtml
- - Admin areafrontend
- - Frontend/storefront areacrontab
- - Cron job execution contextwebapi_rest
- - REST API contextwebapi_soap
- - SOAP API contextgraphql
- - GraphQL API contextdoc
- - Documentation contextadmin
- - Admin context (alternative to adminhtml)
dev-module-list - List all Magento 2 modules and their status
Parameters:
- format (optional): Output format (table, json, csv) - Default: tableenabled
- (optional): Show only enabled modulesdisabled
- (optional): Show only disabled modules
dev-module-observer-list - List all Magento 2 module observers
Parameters:
- format (optional): Output format (table, json, csv) - Default: tableevent
- (optional): Filter by specific event name
dev-theme-list - List all available Magento 2 themes
Parameters:
- format (optional): Output format (table, json, csv) - Default: table
dev-module-create - Create and register a new Magento 2 module
Parameters:
- vendorNamespace (required): Namespace (your company prefix)moduleName
- (required): Name of your moduleminimal
- (optional): Create only module fileaddBlocks
- (optional): Add blocksaddHelpers
- (optional): Add helpersaddModels
- (optional): Add modelsaddSetup
- (optional): Add SQL setupaddAll
- (optional): Add blocks, helpers and modelsenable
- (optional): Enable module after creationmodman
- (optional): Create all files in folder with a modman fileaddReadme
- (optional): Add a readme.md file to generated moduleaddComposer
- (optional): Add a composer.json file to generated moduleaddStrictTypes
- (optional): Add strict_types declaration to generated PHP filesauthorName
- (optional): Author for readme.md or composer.jsonauthorEmail
- (optional): Author email for readme.md or composer.jsondescription
- (optional): Description for readme.md or composer.json
Example Usage:
`json`
{
"name": "dev-module-create",
"arguments": {
"vendorNamespace": "MyCompany",
"moduleName": "CustomModule",
"addAll": true,
"enable": true,
"addReadme": true,
"addComposer": true,
"authorName": "John Doe",
"authorEmail": "john@example.com",
"description": "A custom Magento 2 module"
}
}
sys-info - Get Magento 2 system information
Parameters:
- format (optional): Output format (table, json, csv) - Default: table
sys-check - Check Magento 2 system requirements and configuration
Parameters: None
Cache Management Tools - Complete cache management suite
Available Tools:
- cache-clean - Clear specific or all cachescache-flush
- - Flush specific or all cachescache-enable
- - Enable specific cache typescache-disable
- - Disable specific cache typescache-status
- - Check cache statuscache-view
- - Inspect cache entries
See Cache Types Reference for details.
config-show - View Magento 2 system configuration values
Parameters:
- path (optional): Configuration path to showscope
- (optional): Configuration scope (default, website, store)scopeId
- (optional): Scope ID (website ID or store ID)
config-set - Set Magento 2 system configuration values
Parameters:
- path (required): Configuration path to setvalue
- (required): Value to setscope
- (optional): Configuration scopescopeId
- (optional): Scope IDencrypt
- (optional): Encrypt the value
config-store-get / config-store-set - Store-specific configuration management tools
Store-specific configuration management for getting and setting configuration values at the store level.
db-query - Execute SQL queries directly on Magento 2 database
Parameters:
- query (required): SQL query to executeformat
- (optional): Output format (table, json, csv) - Default: table
setup-upgrade - Run Magento 2 setup upgrade to update database schema and data
Parameters:
- keepGenerated (optional): Keep generated files during upgrade
setup-di-compile - Compile Magento 2 dependency injection configuration
Parameters: None
setup-db-status - Check database status to see if setup:upgrade is needed
Parameters: None
setup-static-content-deploy - Deploy Magento 2 static content and assets
Parameters:
- languages (optional): Languages to deploythemes
- (optional): Themes to deployjobs
- (optional): Number of parallel jobsforce
- (optional): Force deployment
sys-store-list - List all Magento 2 stores, websites, and store views
Parameters:
- format (optional): Output format (table, json, csv) - Default: table
sys-store-config-base-url-list - List all base URLs for Magento 2 stores
Parameters:
- format (optional): Output format (table, json, csv) - Default: table
sys-url-list - Get all Magento 2 URLs
Parameters:
- format (optional): Output format (table, json, csv) - Default: tablestoreId
- (optional): Store ID to filter URLs
sys-website-list - List all Magento 2 websites
Parameters:
- format (optional): Output format (table, json, csv) - Default: table
sys-cron-list - List all Magento 2 cron jobs and their configuration
Parameters:
- format (optional): Output format (table, json, csv) - Default: table
sys-cron-run - Run Magento 2 cron jobs
Parameters:
- job (optional): Specific cron job to rungroup
- (optional): Cron group to run
- Node.js 18.x or higher (required by MCP SDK)
- n98-magerun2 installed and accessible via PATH
- Valid Magento 2 installation in the working directory
- AI agent that supports MCP (Model Context Protocol)
To publish this package to npm:
1. Build the project:
`bash`
npm run build
2. Login to npm:
`bash`
npm login
3. Publish:
`bash`
npm publish --access public
1. Clone and install dependencies:
`bash`
git clone https://github.com/elgentos/magento2-dev-mcp.git
cd magento2-dev-mcp
npm install
2. Build:
`bash`
npm run build
3. Test locally:
`bash``
npm start
1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Add tests if applicable
5. Submit a pull request
MIT License - see LICENSE file for details.