mage-os-lab/magento2-lsp
Language Server (LSP) and MCP server for Magento 2 - provides go-to-definition, references, and rename across PHP, XML, and layout files.
Platform-specific configuration:
{
"mcpServers": {
"magento2-lsp": {
"command": "npx",
"args": [
"-y",
"magento2-lsp"
]
}
}
}Add the config above to .claude/settings.json under the mcpServers key.
Magento 2 tooling for editors and AI agents. This package includes two servers that share the same index and understanding of Magento's configuration system:
Both are installed from the same repo but configured separately - the LSP in your editor, the MCP in your AI agent. They can be used together or independently.
Agents write the code, but you still review it - and jumping between XML and PHP with a keystroke beats grepping through config files. AI agents need the opposite: not navigation, but the *merged* result of Magento's multi-module configuration that no single file contains.
Works alongside Intelephense or Phpactor - this LSP handles the Magento-specific connections that generic PHP tooling can't see.
di.xml, events.xml, system.xml, and layout XML - linking them to the PHP classes, templates, and config paths they reference.beforeSave plugin to the method it wraps, and see plugin counts directly in your editor via code lenses.scopeConfig->getValue('payment/account/active') in PHP straight to the <field> declaration in system.xml, and find all PHP files using a config path.Loading reviews...