#!/usr/bin/env node
/**
* Magento Coding Standards MCP Server - CLI Entry Point
*
* Supports: Claude Code, Claude Desktop, Cursor IDE, VS Code Copilot,
* Gemini CLI, Continue.dev, Augment Code
*/
const args = process.argv.slice(2);
if (args.includes('--help') || args.includes('-h')) {
console.log(`
Magento Coding Standards MCP Server v1.2.0
An MCP server providing Magento 2 coding standards knowledge for AI-assisted development.
Usage:
magento-coding-standard-mcp Start the MCP server (stdio transport)
magento-coding-standard-mcp --help Show this help message
magento-coding-standard-mcp --version Show version
Tools provided:
get_magento_pattern Get the correct Magento 2 way to accomplish a task
validate_code Validate code against Magento coding standards
check_security Security-focused code validation
explain_rule Get detailed explanation of a coding rule
list_rules List rules with filtering (category, severity, search)
get_rules_summary Get summary of all rules by category
manage_theme Manage theme-specific coding standards (hyva, luma, breeze, porto, custom)
Supported platforms:
- Claude Code: claude mcp add magento-coding-standard -- npx magento-coding-standard-mcp
- Claude Desktop: Add to claude_desktop_config.json
- Cursor IDE: Add to .cursor/mcp.json
- VS Code Copilot: Add to .vscode/mcp.json
- Gemini CLI: Add to .gemini/settings.json
- Continue.dev: Add to .continue/config.json
- Augment Code: Add to augment settings
See: https://github.com/Midhun-edv/magento-coding-standard-mcp for full configuration examples.
`);
process.exit(0);
}
if (args.includes('--version') || args.includes('-v')) {
console.log('1.2.0');
process.exit(0);
}
// Start the MCP server
import('./index.js').catch((error) => {
console.error('Failed to start Magento Coding Standards MCP Server:');
console.error(error.message || error);
console.error('');
console.error('Troubleshooting:');
console.error(' 1. Ensure Node.js >= 18 is installed');
console.error(' 2. Run: npm install (in the project directory)');
console.error(' 3. Run: npm run build');
process.exit(1);
});