Extend the existing ClusterControl MCP server to support complete Magento 2 demo instance provisioning across all required infrastructure services.
- Web Server: NGINX (restart, reload, status)
- Web Server: Apache (start, restart, reload, status)
- PHP-FPM: Comprehensive management (restart, reload, status, version management)
- Authentication: Personal Access Token system
- Architecture: Clean TypeScript implementation with MCP protocol compliance
- Database: MySQL/MariaDB service management
- Cache: Redis service management
- Queue: RabbitMQ service management
- Search: Elasticsearch/OpenSearch service management
- Orchestration: High-level Magento 2 setup workflows
Goal: Map available MaxCluster API endpoints for database, cache, queue, and search services Success Criteria: Documented API endpoints and capabilities for each service Status: Not Started
- Extract and analyze cluster-control phar file structure
- Identify Laravel commands for MySQL/MariaDB operations
- Identify Laravel commands for Redis operations
- Identify Laravel commands for RabbitMQ operations
- Identify Laravel commands for Elasticsearch/OpenSearch operations
- Document API endpoint patterns for each service
- Create API capabilities matrix (what's supported vs. what's needed)
Based on existing implementation, expected endpoints:
/v1/clusters/{id}/servers/{id}/managed/mysql/*/v1/clusters/{id}/servers/{id}/managed/redis/*/v1/clusters/{id}/servers/{id}/managed/rabbitmq/*/v1/clusters/{id}/servers/{id}/managed/elasticsearch/*
MYSQL_API_ENDPOINTS.md- Documented MySQL API operationsREDIS_API_ENDPOINTS.md- Documented Redis API operationsRABBITMQ_API_ENDPOINTS.md- Documented RabbitMQ API operationsELASTICSEARCH_API_ENDPOINTS.md- Documented Elasticsearch API operations
Goal: Implement complete database management for Magento 2 Success Criteria: Can manage databases, users, and service lifecycle Status: Not Started
- Endpoint:
GET /managed/mysql - Purpose: Get MySQL version, status, connection info
- Returns: Version, running state, uptime, max_connections, current connections
- Priority: HIGH
- Endpoint:
POST /managed/mysql/actions/restart - Purpose: Restart MySQL service
- Warning: Will drop all active connections
- Priority: HIGH
- Endpoint:
POST /managed/mysql/actions/reload - Purpose: Reload MySQL configuration (FLUSH PRIVILEGES)
- Priority: MEDIUM
- Endpoint:
POST /managed/mysql/databases - Purpose: Create database + user + grant privileges (all-in-one)
- Parameters: database_name, username, password, permissions (optional)
- Returns: Database created, user created, connection string
- Priority: CRITICAL
- Endpoint:
GET /managed/mysql/databases - Purpose: List all databases
- Returns: Array of database names with sizes
- Priority: MEDIUM
- Endpoint:
DELETE /managed/mysql/databases/{name} - Purpose: Delete database
- Warning: DESTRUCTIVE operation, require confirmation
- Priority: MEDIUM
- Endpoint:
POST /managed/mysql/databases/{name}/import - Purpose: Import SQL dump file (for demo data)
- Parameters: database_name, dump_file_path or dump_content
- Priority: HIGH (for demo setup)
- Add
DatabaseOperationSchemaextendingClusterOperationSchema - Add
handleMysql*method group - Add MySQL endpoint constants to
constants.ts - Add database-specific error handling
- Test database creation with various character sets (utf8mb4)
- Test user creation with different permission levels
- Test import with large SQL dumps
- Test connection validation
Goal: Implement Redis management for Magento 2 caching Success Criteria: Can control Redis service and manage cache operations Status: Not Started
- Endpoint:
GET /managed/redis - Purpose: Get Redis version, memory usage, key statistics
- Returns: Version, uptime, memory_used, keys_count, connected_clients
- Priority: HIGH
- Endpoint:
POST /managed/redis/actions/restart - Purpose: Restart Redis service
- Warning: Will clear cache if persistence disabled
- Priority: HIGH
- Endpoint:
POST /managed/redis/actions/flush - Purpose: Flush all Redis caches
- Parameters: database (optional, default all databases)
- Priority: HIGH (for demo reset)
- Endpoint:
GET /managed/redis/info - Purpose: Get detailed Redis INFO output
- Returns: Comprehensive Redis statistics
- Priority: MEDIUM
- Endpoint:
POST /managed/redis/config - Purpose: Set Redis configuration (maxmemory, eviction policy)
- Parameters: config_key, config_value
- Priority: MEDIUM
Typical Magento 2 uses Redis for:
- Default cache: Database 0
- Page cache: Database 1
- Session storage: Database 2
Should support configuration of multiple Redis instances or databases.
- Add
RedisOperationSchema - Add
handleRedis*method group - Add Redis endpoint constants
- Add cache-specific error handling
Goal: Implement RabbitMQ management for Magento 2 async operations Success Criteria: Can manage vhosts, users, queues, and service lifecycle Status: Not Started
- Endpoint:
GET /managed/rabbitmq - Purpose: Get RabbitMQ version, node health, queue counts
- Returns: Version, node_status, total_queues, total_messages
- Priority: HIGH
- Endpoint:
POST /managed/rabbitmq/actions/restart - Purpose: Restart RabbitMQ service
- Priority: HIGH
- Endpoint: Composite operation (multiple API calls)
- Purpose: Create vhost + user + permissions for Magento
- Parameters: vhost_name, username, password
- Operations:
- Create vhost
- Create user
- Set permissions (configure, write, read all)
- Returns: Connection URL (amqp://username:password@host:5672/vhost)
- Priority: CRITICAL
- Endpoint:
GET /managed/rabbitmq/queues - Purpose: List all queues with message counts
- Returns: Array of queues with statistics
- Priority: MEDIUM
- Endpoint:
POST /managed/rabbitmq/queues/{name}/purge - Purpose: Remove all messages from queue
- Priority: MEDIUM
- Endpoint:
DELETE /managed/rabbitmq/queues/{name} - Purpose: Delete queue
- Priority: LOW
- Add
RabbitmqOperationSchema - Add
handleRabbitmq*method group - Add RabbitMQ endpoint constants
- Add queue-specific error handling
- Add multi-step transaction support (for setup_magento)
Goal: Implement search engine management for Magento 2 catalog Success Criteria: Can manage indices, check cluster health, control service Status: Not Started
- Endpoint:
GET /managed/elasticsearch - Purpose: Get cluster health, version, node count
- Returns: Version, cluster_status (green/yellow/red), nodes, indices_count
- Priority: HIGH
- Endpoint:
POST /managed/elasticsearch/actions/restart - Purpose: Restart Elasticsearch service
- Priority: HIGH
- Endpoint:
GET /managed/elasticsearch/cluster/health - Purpose: Detailed cluster health check
- Returns: Status, node count, shard allocation, disk usage
- Priority: MEDIUM
- Endpoint:
GET /managed/elasticsearch/indices - Purpose: List all indices with sizes and document counts
- Returns: Array of indices with statistics
- Priority: MEDIUM
- Endpoint:
DELETE /managed/elasticsearch/indices/{name} - Purpose: Delete index (for demo reset)
- Parameters: index_name or pattern (e.g., "magento2_*")
- Priority: MEDIUM
- Endpoint:
POST /managed/elasticsearch/indices - Purpose: Create index with mappings
- Parameters: index_name, settings, mappings (optional)
- Priority: LOW (Magento creates indices automatically)
Typical Magento 2 indices:
magento2_product_*magento2_category_*magento2_cms_*
- Add
ElasticsearchOperationSchema - Add
handleElasticsearch*method group - Add Elasticsearch endpoint constants
- Add cluster health monitoring
- Support both Elasticsearch and OpenSearch
Goal: Provide simplified workflows for common Magento 2 operations Success Criteria: Can setup complete Magento 2 environment with one command Status: Not Started
- Purpose: Verify all services are ready for Magento 2
- Operations:
- Check MySQL status and version (β₯8.0 or MariaDB β₯10.4)
- Check Redis status
- Check RabbitMQ status
- Check Elasticsearch status (version 7.x or 8.x)
- Check PHP version (β₯8.1)
- Check NGINX/Apache status
- Returns: Health report with pass/fail for each service
- Priority: HIGH
- Purpose: One-shot setup of all services for Magento 2
- Parameters:
- database_name
- database_user
- database_password
- rabbitmq_vhost
- rabbitmq_user
- rabbitmq_password
- Operations (in order):
- Create MySQL database + user + grant
- Configure Redis (set eviction policy)
- Setup RabbitMQ vhost + user + permissions
- Verify Elasticsearch cluster health
- Ensure PHP-FPM is running
- Ensure NGINX/Apache is running
- Returns: Connection details for all services
- Error Handling: Rollback on failure (delete created resources)
- Priority: CRITICAL
- Purpose: Clean slate for demo environment
- Operations:
- Drop and recreate database
- Flush all Redis caches
- Purge all RabbitMQ queues
- Delete all Magento indices from Elasticsearch
- Warning: DESTRUCTIVE operation
- Priority: HIGH
- Purpose: Get all connection strings/details for Magento configuration
- Returns:
- MySQL connection: host, port, database, user, password
- Redis connection: host, port, databases (0, 1, 2)
- RabbitMQ connection: AMQP URL
- Elasticsearch connection: host, port, protocol
- Priority: MEDIUM
- Create
OrchestrationServiceclass - Implement transaction/rollback support
- Add progress reporting for long operations
- Add dry-run mode (validate without executing)
- Add dependency resolution (ensure correct service order)
- Track all operations performed
- On failure, rollback in reverse order
- Provide detailed error context
- Suggest next steps for recovery
mcp-server/src/
βββ index.ts # Main MCP server (existing)
βββ types/
β βββ index.ts # Core types (existing)
β βββ database.ts # NEW: MySQL types
β βββ redis.ts # NEW: Redis types
β βββ rabbitmq.ts # NEW: RabbitMQ types
β βββ elasticsearch.ts # NEW: Elasticsearch types
βββ utils/
β βββ constants.ts # Configuration constants (existing)
β βββ validation.ts # Input validation (existing)
β βββ intelligent-operations.ts # NLP parsing (existing)
β βββ service-health.ts # NEW: Service health checks
β βββ orchestration.ts # NEW: Multi-service workflows
βββ services/ # NEW: Service-specific handlers
β βββ mysql-service.ts # MySQL/MariaDB operations
β βββ redis-service.ts # Redis operations
β βββ rabbitmq-service.ts # RabbitMQ operations
β βββ elasticsearch-service.ts # Elasticsearch operations
β βββ magento-orchestrator.ts # High-level Magento workflows
βββ config/
βββ server-mappings.ts # Server mappings (existing)
// Database operations
const DatabaseOperationSchema = ClusterOperationSchema.extend({
database_name: z.string().regex(/^[a-zA-Z0-9_]+$/),
username: z.string().regex(/^[a-zA-Z0-9_]+$/),
password: z.string().min(8),
});
// Redis operations
const RedisOperationSchema = ClusterOperationSchema.extend({
database: z.number().min(0).max(15).optional(),
});
// RabbitMQ operations
const RabbitmqOperationSchema = ClusterOperationSchema.extend({
vhost: z.string(),
username: z.string(),
password: z.string().min(8),
});
// Elasticsearch operations
const ElasticsearchOperationSchema = ClusterOperationSchema.extend({
index_name: z.string().optional(),
});
// Magento orchestration
const MagentoSetupSchema = ClusterOperationSchema.extend({
database_name: z.string(),
database_user: z.string(),
database_password: z.string(),
rabbitmq_vhost: z.string().default('/magento'),
rabbitmq_user: z.string(),
rabbitmq_password: z.string(),
});export const DATABASE_ENDPOINTS = {
STATUS: (clusterId: number, serverId: number) =>
`/v1/clusters/${clusterId}/servers/${serverId}/managed/mysql`,
RESTART: (clusterId: number, serverId: number) =>
`/v1/clusters/${clusterId}/servers/${serverId}/managed/mysql/actions/restart`,
DATABASES: (clusterId: number, serverId: number) =>
`/v1/clusters/${clusterId}/servers/${serverId}/managed/mysql/databases`,
// ... more endpoints
};
export const MAGENTO_REQUIREMENTS = {
PHP_MIN_VERSION: '8.1',
MYSQL_MIN_VERSION: '8.0',
MARIADB_MIN_VERSION: '10.4',
ELASTICSEARCH_VERSIONS: ['7.17', '8.4', '8.5', '8.7'],
OPENSEARCH_VERSIONS: ['1.2', '2.4', '2.5'],
};-
MYSQL_OPERATIONS.md
- Database service management
- User and permission management
- Backup and restore procedures
- Troubleshooting common issues
-
REDIS_OPERATIONS.md
- Cache service management
- Memory optimization
- Eviction policies for Magento
- Performance monitoring
-
RABBITMQ_OPERATIONS.md
- Queue service management
- Vhost and user setup
- Queue monitoring and purging
- Magento queue consumers
-
ELASTICSEARCH_OPERATIONS.md
- Search service management
- Index lifecycle management
- Cluster health monitoring
- Magento reindexing support
-
MAGENTO2_SETUP_GUIDE.md
- Complete step-by-step setup
- Service configuration examples
- Environment variables
- Troubleshooting guide
- Performance tuning recommendations
-
API_REFERENCE.md
- Complete tool listing
- Parameter documentation
- Example requests and responses
- Error codes and messages
-
README.md
- Update tool listing with new services
- Add Magento 2 quick start section
- Update examples
- Add service compatibility matrix
-
PROJECT_SUMMARY.md
- Update architecture diagrams
- Document new components
- Update success metrics
- Verify phar extraction works
- Confirm API endpoint patterns
- Test authentication with each service endpoint
- Test each tool handler independently
- Mock API responses
- Verify error handling
- Validate input schemas
- Test service startup sequences
- Test orchestration workflows
- Test rollback mechanisms
- Test multi-service dependencies
- Test complete Magento 2 setup
- Test demo reset workflow
- Test error recovery
- Test with actual MaxCluster API
- All services can be started/stopped
- Database creation works with Magento requirements
- Redis cache operations work
- RabbitMQ vhost/user creation works
- Elasticsearch indices can be managed
- Complete Magento 2 environment can be provisioned
- Error handling provides clear messages
- Rollback works on failures
- Documentation matches implementation
- β Can start/stop/restart all Magento 2 required services
- β Can create and configure MySQL database for Magento 2
- β Can configure Redis for Magento caching
- β Can setup RabbitMQ with proper vhost and permissions
- β Can manage Elasticsearch indices
- β Can provision complete Magento 2 environment with single command
- β Can reset environment to clean state
- β All tools follow existing MCP patterns
- β Comprehensive error handling
- β Input validation for all parameters
- β Type-safe TypeScript implementation
- β Zero breaking changes to existing tools
- β Performance: Most operations complete in <5 seconds
- β Security: No credential leakage in logs or errors
- β Complete API reference for all tools
- β Step-by-step Magento 2 setup guide
- β Service-specific operation guides
- β Troubleshooting guides
- β Examples for common scenarios
- β Clear, actionable error messages
- β Progress indicators for long operations
- β Confirmation for destructive operations
- β Connection strings provided after setup
- β Health check reports easy to understand
Risk: API may not expose all required operations Impact: Cannot implement some tools Mitigation:
- Discover API capabilities first (Stage 1)
- Document limitations clearly
- Provide alternative approaches where possible
Risk: Services must start in specific order Impact: Orchestration failures Mitigation:
- Implement dependency resolution
- Add retry logic with exponential backoff
- Provide clear error messages about dependencies
Risk: Passwords and tokens in API calls Impact: Security vulnerability Mitigation:
- Use HTTPS exclusively
- Never log credentials
- Support credential management best practices
- Validate credential strength
Risk: Updates break existing tools Impact: Users lose functionality Mitigation:
- Comprehensive testing before releases
- Version compatibility matrix
- Deprecation warnings, not removals
- Keep existing tools working
Risk: Multi-service setup too complex Impact: Hard to debug failures Mitigation:
- Detailed logging at each step
- Atomic operations where possible
- Rollback support
- Dry-run mode for validation
- Phar analysis: 1 day
- API endpoint mapping: 1 day
- Documentation: 1 day
- Implementation: 2 days
- Testing: 1 day
- Documentation: 1 day
- Implementation: 1.5 days
- Testing: 0.5 days
- Documentation: 1 day
- Implementation: 2 days
- Testing: 1 day
- Documentation: 1 day
- Implementation: 1.5 days
- Testing: 0.5 days
- Documentation: 1 day
- Implementation: 2 days
- Testing: 2 days
- Documentation: 1 day
Buffer: Add 20% for unexpected issues = 20-27 days total
- β Zod schemas for validation
- β
setupClusterConfigfor auth - β
getServerIdfor server resolution - β
executeServiceActionfor common operations - β
extractApiErrorInfofor error handling - β Consistent error messages from constants
- π Reduce code duplication in handlers
- π Extract common service patterns
- π Add service factory pattern
- π Improve error context in failures
- π Add retry logic for transient failures
- β¨ Transaction/rollback support
- β¨ Health check utilities
- β¨ Service dependency resolution
- β¨ Progress reporting for long operations
- β¨ Dry-run mode for validation
- PHP memory limit: 2GB+ recommended
- MySQL: utf8mb4 charset, innodb engine
- Redis: maxmemory-policy allkeys-lru
- Elasticsearch: Single-node setup OK for demo
- RabbitMQ: Default exchange sufficient
- Server types: srv-, db-, cache-, search-, queue-*
- Cluster hierarchy: Cluster β Server β Service
- API base: https://api.maxcluster.de/v1
- Authentication: Bearer token (PAT)
- Varnish cache management
- SSL certificate management
- Backup scheduling
- Performance monitoring
- Auto-scaling configuration
- Multi-region support
A stage is complete when:
- All tools are implemented and tested
- Error handling covers all failure scenarios
- Documentation is complete and reviewed
- Manual testing passes with real API
- Code reviewed and approved
- No breaking changes to existing functionality
- Performance is acceptable (<5s for most operations)
- Security review passed (no credential leakage)
The entire project is complete when:
- All 6 stages are done
- End-to-end Magento 2 setup works
- All documentation is published
- Examples are tested and working
- README is updated
- Project is ready for production use
Next Step: Begin Stage 1 - Discovery & API Analysis by extracting and analyzing the cluster-control phar file.