Skip to content

Project configuration and indexing

Vitalii Boiko edited this page Nov 14, 2026 · 1 revision

Project configuration and indexing

Magento integration can be configured in the IDE or through MCP, including before integration is enabled and while the IDE is indexing. These settings are available without the JetBrains PHP plugin. MCP calls return formatted text, not a JSON response schema. See MCP for connection setup and other tools.

Configure in Settings

Open Settings / Preferences > Languages & Frameworks > PHP > Frameworks > Magento 2 when PHP support is installed, or Settings / Preferences > Tools > Magento without it. Set Magento installation path, select Enable Magento integration, then apply the settings. If Magento is in a subdirectory, choose that directory rather than the IDE project root.

The same page has Exclude generated and runtime files from indexing, Additional excluded output paths, and an Effective indexing exclusions display. Additional paths in the UI are comma-separated and relative to the IDE project root. Changes made through MCP are persisted to the project settings and synchronized with the settings UI.

Configure through MCP

Use configure_magento_project with these parameters:

Parameter Purpose
action status reads the current configuration, configure changes it, and help explains the tool. The default is configure; a configure call with no configuration arguments returns status.
magentoPath Absolute path or path relative to the IDE project directory; . means the project directory.
enabled Enables or disables Magento integration. If omitted, the existing enabled state is preserved, including when a path is supplied.
excludeGeneratedFiles Controls generated/runtime indexing exclusions; the first enable defaults to on unless explicitly overridden.
projectPath Optional intended IDE project directory, checked against the active project to avoid configuring the wrong project.

Example tool arguments:

{"action":"status"}
{"action":"configure","magentoPath":"src","enabled":true}
{"action":"configure","magentoPath":"another-magento-root"}
{"action":"configure","enabled":false}

The third example changes the root but does not enable a disabled integration. To enable integration, a configured or supplied root is required. When integration will be enabled, the root must exist, be a directory, and have recognized Magento structure. Supported source and partial checkouts are accepted; status reports missing dependencies and an unknown platform version where applicable. A failed validation preserves the previous configuration. A path can be stored while integration is disabled; it is validated when enabling it. Repeating an identical configuration avoids unnecessary reindexing.

Status is read-only and reports the resolved path, integration state, installation type, dependencies, exclusion preference, and whether an index refresh is pending. After a change, check the reported pending refresh and allow indexing to finish before relying on index-dependent results.

Indexing exclusions

Indexing exclusions reduce work for the IDE; they do not delete files. They are separate from Upgrade Compatibility Tool scan exclusions. When Magento integration is enabled, exclusion of generated/runtime files is enabled by default unless explicitly disabled.

By default the following locations are relative to the configured Magento root:

  • .cache directories, including nested directories and those created later
  • var/cache, var/page_cache, and var/view_preprocessed
  • var/log, var/report, and var/session
  • generated/metadata
  • pub/static

Source paths are protected, including app/code, app/design, app/etc, vendor, lib/web, dev/tests, and generated/code. In particular, generated/code remains available for indexing. Nested .cache directories can still be excluded inside protected source trees. Existing user-owned IDE exclusions are preserved.

Additional paths use the IDE project root, not the Magento root. For example, with Magento configured as src, the default var/cache means src/var/cache, while an additional path of .runtime/build means .runtime/build at the IDE project root. An additional path of src/var/custom-output points inside the Magento root. Paths that are invalid, unsafe, or protected are skipped and reported by the preview.

Inspect and change exclusions through MCP

  • get_magento_indexing_exclusions reports the current setting, effective exclusions, skipped candidates, and pending indexing. A valid configured Magento path is needed to inspect exclusions.
  • configure_magento_indexing_exclusions accepts action (preview, apply, update, or reset), optional enabled, and optional additionalPaths (a list of project-relative paths). preview shows effective candidates, skipped paths, and additions/removals without changing settings. apply and update persist and apply the supplied settings. If enabled or additionalPaths is omitted, its existing value is preserved.
  • reset clears additional paths and removes plugin-managed exclusions, restoring the default exclusion preference. It is not a lasting opt-out: use enabled:false to disable exclusions explicitly. The normal Reset operation in the Settings dialog instead discards un-applied UI edits and reloads saved settings; it is not the MCP exclusion reset.

For example, with src configured as the Magento root, preview and then apply an additional IDE-project-relative directory:

{"action":"preview","additionalPaths":[".runtime/build"]}
{"action":"apply","additionalPaths":[".runtime/build"]}

To opt out:

{"action":"update","enabled":false}

The result reports added, removed, unchanged, or skipped paths and any pending index refresh. Wait for the refresh before judging its effect.

Clone this wiki locally