Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| MYSQL_SSL | No | Enable SSL/TLS connection | false |
| MYSQL_URI | Yes | MySQL connection URI (required). Format: mysql://user:password@host:3306/database | |
| MYSQL_SSL_CA | No | Path to CA certificate file | |
| MYSQL_SSL_KEY | No | Path to client private key file | |
| MYSQL_SSL_CERT | No | Path to client certificate file | |
| MYSQL_POOL_SIZE | No | Connection pool size | 5 |
| MYSQL_SSL_VERIFY_CERT | No | Verify server certificate | true |
| MYSQL_SSL_VERIFY_IDENTITY | No | Verify server hostname matches certificate | false |
Schema
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| optimize_slow_query | Analyze and optimize a slow SQL query |
| health_check | Perform a comprehensive MySQL health check |
| index_review | Review indexes for a database schema |
| performance_audit | Full performance audit of MySQL server |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| MySQL Best Practices | Best practices for MySQL performance tuning |
| Index Guidelines | Guidelines for MySQL index optimization |
| Configuration Guide | MySQL configuration optimization guide |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| get_slow_queries | Retrieve slow queries from MySQL performance_schema. Returns the top N slowest queries with detailed statistics:
Requires performance_schema to be enabled (default in MySQL 5.6+). For older versions, use the slow query log instead. Note: This tool excludes queries against MySQL system schemas (mysql, information_schema, performance_schema, sys) to focus on user/application query performance. |
| analyze_query | Analyze a MySQL query's execution plan using EXPLAIN. Provides detailed analysis of:
Supports EXPLAIN FORMAT=JSON for MySQL 5.6+ for detailed cost analysis. Use EXPLAIN ANALYZE (MySQL 8.0.18+) for actual execution statistics. WARNING: With analyze=true, the query is actually executed! |
| get_table_stats | Get detailed statistics for MySQL user tables. Returns information about:
Helps identify tables that may need:
Note: This tool only analyzes user/custom tables and excludes MySQL system tables (mysql, information_schema, performance_schema, sys). |
| get_index_recommendations | Get AI-powered index recommendations for MySQL user tables. Analyzes query patterns from performance_schema to recommend indexes:
Note: This tool only analyzes user/custom tables and excludes MySQL system tables (mysql, information_schema, performance_schema, sys). Based on MySQL performance_schema statistics and query patterns. Similar to MySQLTuner's index analysis but with more detailed recommendations. |
| find_unused_indexes | Find unused and duplicate indexes in MySQL user tables. Identifies:
Removing unused indexes can:
Note: This tool only analyzes user/custom tables and excludes MySQL system tables (mysql, information_schema, performance_schema, sys). Based on information_schema and performance_schema statistics. |
| get_index_stats | Get detailed index statistics for MySQL user tables. Returns:
Helps identify:
Note: This tool only analyzes user/custom tables and excludes MySQL system tables (mysql, information_schema, performance_schema, sys). |
| check_database_health | Perform a comprehensive MySQL database health check. Analyzes multiple aspects of MySQL health:
Returns a health score with detailed breakdown and recommendations. Based on MySQLTuner analysis concepts. |
| get_active_queries | Get currently active queries in MySQL. Shows:
Useful for:
|
| review_settings | Review MySQL configuration settings and get recommendations. Analyzes key performance-related settings:
Compares against best practices and system resources. |
| analyze_wait_events | Analyze MySQL wait events to identify bottlenecks. Wait events indicate what processes are waiting for:
This helps identify:
|
| get_innodb_status | Analyze InnoDB engine status from SHOW ENGINE INNODB STATUS. Parses and analyzes:
Based on MySQLTuner's InnoDB analysis patterns. Provides actionable recommendations for InnoDB optimization. |
| analyze_buffer_pool | Detailed analysis of InnoDB buffer pool usage. Analyzes:
Note: When analyzing by schema/table, this tool only shows user/custom tables and excludes MySQL system tables (mysql, information_schema, performance_schema, sys). Uses sys schema views for detailed breakdown when available. |
| analyze_innodb_transactions | Analyze InnoDB transactions and locking. Identifies:
Helps identify transaction-related performance issues. |
| analyze_statements | Analyze SQL statements from performance_schema/sys schema. Provides comprehensive analysis of:
Based on MySQLTuner's performance schema analysis. Requires performance_schema enabled. Note: This tool excludes queries against MySQL system schemas (mysql, information_schema, performance_schema, sys) to focus on user/application query analysis. |
| get_statements_with_temp_tables | Get statements that create temporary tables. Temporary tables can cause performance issues when:
Identifies queries that should be optimized. Note: This tool excludes queries against MySQL system schemas (mysql, information_schema, performance_schema, sys) to focus on user/application query analysis. |
| get_statements_with_sorting | Get statements that perform sorting operations. Identifies queries with:
High file sort ratios indicate need for index optimization or sort_buffer_size increase. Note: This tool excludes queries against MySQL system schemas (mysql, information_schema, performance_schema, sys) to focus on user/application query analysis. |
| get_statements_with_full_scans | Get statements that perform full table scans. Full table scans can severely impact performance on large tables. Identifies queries that:
These queries are prime candidates for index optimization. Note: This tool excludes queries against MySQL system schemas (mysql, information_schema, performance_schema, sys) to focus on user/application query analysis. |
| get_statements_with_errors | Get statements that produce errors or warnings. Identifies queries with:
Helps identify problematic application queries. Note: This tool excludes queries against MySQL system schemas (mysql, information_schema, performance_schema, sys) to focus on user/application query analysis. |
| calculate_memory_usage | Calculate MySQL memory usage and provide recommendations. Analyzes:
Based on MySQLTuner's memory calculation methodology. Helps identify memory-related configuration issues. |
| get_memory_by_host | Get memory usage breakdown by host or user. Uses sys schema or performance_schema to show:
Requires performance_schema memory instrumentation enabled. |
| get_table_memory_usage | Analyze memory usage for user tables and caches. Shows:
Note: Buffer pool breakdown by table only shows user/custom tables and excludes MySQL system tables (mysql, information_schema, performance_schema, sys). Helps optimize table caching parameters. |
| analyze_storage_engines | Analyze storage engine usage and statistics for user tables. Provides:
Note: This tool only analyzes user/custom tables and excludes MySQL system tables (mysql, information_schema, performance_schema, sys) by default. Based on MySQLTuner's engine analysis patterns. |
| get_fragmented_tables | Find user tables with significant fragmentation. Fragmentation occurs when:
Note: This tool only analyzes user/custom tables and excludes MySQL system tables (mysql, information_schema, performance_schema, sys) by default. High fragmentation wastes disk space and can slow queries. |
| analyze_auto_increment | Analyze auto-increment columns for potential overflow. Checks:
Note: This tool only analyzes user/custom tables and excludes MySQL system tables (mysql, information_schema, performance_schema, sys) by default. Based on MySQLTuner's auto-increment analysis. |
| get_replication_status | Get MySQL replication status and health. Analyzes:
Works with both MySQL and MariaDB terminology. |
| get_galera_status | Get Galera cluster status for MariaDB/Percona XtraDB Cluster. Analyzes:
Only applicable to Galera-enabled MySQL variants. |
| get_group_replication_status | Get MySQL Group Replication status. Analyzes:
Only applicable to MySQL with Group Replication enabled. |
| analyze_security | Perform comprehensive MySQL security analysis. Checks:
Based on MySQLTuner's security_recommendations() function. |
| analyze_user_privileges | Analyze privileges for a specific user or all users. Shows:
Helps identify excessive or missing privileges. |
| check_audit_log | Check MySQL audit log configuration and status. Analyzes:
Supports MySQL Enterprise Audit, MariaDB Audit Plugin, and Percona Audit Log Plugin. |