Skip to content
vitaliy edited this page Jul 6, 2026 · 8 revisions

Model Context Protocol (MCP)

The Magento PhpStorm plugin can expose Magento-specific IDE tools through JetBrains MCP.

The screenshots below use Codex as the example MCP client. The same Magento MCP server can also be used from other MCP-compatible agents and clients, such as Junie, Claude Code, Cursor, and similar tools.

Non-PHP JetBrains IDEs are supported with limited Magento MCP capabilities. PHP-independent tools such as get_magento_root_path and describe_magento_cli_environment are available there, while PHP-backed scaffold and inspection tools require a PHP-capable IDE.

Before starting, make sure your IDE already includes both Settings | Tools | MCP Server and Settings | Tools | AI Assistant | Model Context Protocol (MCP).

1. Enable the IDE MCP server

Open Settings | Tools | MCP Server, enable Enable MCP Server, and confirm the warning dialog.

2. Check exposed Magento tools

Open Settings | Tools | MCP Server | Exposed Tools and verify that MagentoMcpToolset is enabled.

3. Copy the MCP client config

In Settings | Tools | MCP Server, find the Codex client entry, open the Auto-Configure menu, and click Copy Config.

Codex is used here as the example because the IDE can prepare the client configuration for it automatically.

4. Add the server to the MCP client

Open Settings | Tools | AI Assistant | Model Context Protocol (MCP), add a new HTTP MCP server, and paste the copied JSON configuration.

Leave Automatically enable new and changed MCP servers enabled, then click OK.

If you use another MCP client such as Junie, Claude Code, or Cursor, use the same copied server configuration in that client instead of the Codex-specific screen shown here.

5. Verify in chat

If the changes are not applied immediately, restart the client. Then ask the assistant whether Magento tools are available in the current session.

You should see Magento-specific capabilities such as module generation, EAV attribute generation, layout and DI lookups, and Magento CLI environment helpers.

Available Magento MCP features

The Magento MCP integration exposes project lookup, code generation, CLI environment discovery, and bundled agent skills.

Feature availability depends on the IDE. PhpStorm and other PHP-capable IDEs expose the full Magento MCP toolset. Non-PHP IDEs expose only PHP-independent tools.

Magento CLI environment discovery

The describe_magento_cli_environment tool helps the agent detect project-local Magento CLI wrappers before running commands. This is especially useful in setups that expose wrapper scripts such as bin/magento, bin/php, bin/composer, or bin/n98-magerun2.

The tool checks configured wrapper candidates directly on the filesystem and reports only wrapper scripts that currently exist.

Project lookup and navigation

The magento_inspect tool helps an agent answer Magento-specific questions about the current project with a compact three-step flow:

  1. Call magento_inspect with mode help to list query types.
  2. Call mode detailed_schema with one queryType to load only the parameters for that query.
  3. Call mode query with queryType and parametersJson to run the inspection.

Supported query types:

  • module
  • di_config
  • plugins_for_method
  • observers_for_event
  • layout_entities
  • ui_component
  • acl_or_menu

Project and code generation

The magento_scaffold tool can inspect the opened project and generate common Magento scaffolding directly in it with the same three-step flow:

  1. Call magento_scaffold with mode help to list scaffold types.
  2. Call mode detailed_schema with one scaffoldType to load only the parameters for that scaffold.
  3. Call mode render with scaffoldType and parametersJson to create the files.

Supported scaffold types:

  • module
  • plugin
  • observer
  • entity_crud
  • controller
  • cli_command
  • block
  • view_model
  • product_eav_attribute
  • category_eav_attribute
  • customer_eav_attribute

The get_magento_root_path tool remains available when an agent needs the configured Magento root path for a shell command or another tool.

Bundled agent skills

Magento settings include an Agent skills section with buttons for installing or updating bundled skills:

  • magento-scaffold for code generation workflows.
  • magento-inspect for project lookup and analysis workflows.

Skills can be installed into the project skill folder or supported agent-specific skill folders, then customized for project-specific prompts, commands, and delivery conventions.

Clone this wiki locally