-
Notifications
You must be signed in to change notification settings - Fork 2
Tools
MySQL MCP is a production-ready integration engineered for AI agents. It minimizes LLM token consumption by up to 90% via sandboxed Code Mode. It scales reliably through built-in connection pooling. It secures database access using strict OAuth 2.1 validation.
| Tool | Description |
|---|---|
mysql_read_query |
Execute SELECT with parameter binding |
mysql_write_query |
Execute INSERT/UPDATE/DELETE |
mysql_list_tables |
List tables with metadata |
mysql_describe_table |
Get column definitions |
mysql_create_table |
CREATE TABLE with engine/charset |
mysql_drop_table |
DROP TABLE with IF EXISTS |
mysql_create_index |
CREATE INDEX (BTREE, HASH, FULLTEXT) |
mysql_get_indexes |
SHOW INDEX FROM table |
mysql_enable_versioning |
Enable OCC on a table |
mysql_disable_versioning |
Disable OCC on a table |
mysql_check_version |
Get current _version of a row |
mysql_conditional_update |
Update row conditionally based on version. v3.2.0: aliases for data and conditions |
| Tool | Description |
|---|---|
mysql_list_schemas |
List databases/schemas |
mysql_create_schema |
CREATE DATABASE |
mysql_drop_schema |
DROP DATABASE |
mysql_list_views |
List views in schema |
mysql_create_view |
CREATE OR REPLACE VIEW |
mysql_drop_view |
DROP VIEW |
mysql_list_stored_procedures |
List stored procedures |
mysql_list_functions |
List stored functions |
mysql_list_triggers |
List triggers |
mysql_list_constraints |
List foreign keys and checks |
mysql_list_events |
List scheduled events |
| Tool | Description |
|---|---|
mysql_transaction_begin |
START TRANSACTION with isolation level |
mysql_transaction_commit |
COMMIT |
mysql_transaction_rollback |
ROLLBACK |
mysql_transaction_savepoint |
SAVEPOINT name |
mysql_transaction_release |
RELEASE SAVEPOINT |
mysql_transaction_rollback_to |
ROLLBACK TO SAVEPOINT |
mysql_transaction_execute |
Execute statements atomically |
| Tool | Description |
|---|---|
mysql_json_extract |
JSON_EXTRACT with path |
mysql_json_set |
JSON_SET to modify values |
mysql_json_insert |
JSON_INSERT (no overwrite) |
mysql_json_replace |
JSON_REPLACE (only existing) |
mysql_json_remove |
JSON_REMOVE paths |
mysql_json_contains |
JSON_CONTAINS for filtering |
mysql_json_keys |
JSON_KEYS to list object keys |
mysql_json_array_append |
JSON_ARRAY_APPEND |
mysql_json_get |
Simple JSON value extraction |
mysql_json_update |
Update JSON field by path |
mysql_json_search |
Search JSON for string value |
mysql_json_validate |
Validate JSON structure |
mysql_json_merge |
JSON_MERGE_PATCH / PRESERVE |
mysql_json_diff |
Compare two JSON documents |
mysql_json_normalize |
Normalize keys and formats |
mysql_json_stats |
Calculate depth, keys count, size |
mysql_json_index_suggest |
Suggest generated columns for indexing |
Treat MySQL like a NoSQL document database (MySQL 5.7+).
| Tool | Description |
|---|---|
mysql_doc_list_collections |
List JSON collections |
mysql_doc_create_collection |
Create new collection |
mysql_doc_drop_collection |
Drop collection |
mysql_doc_find |
Find documents (NoSQL-style criteria) |
mysql_doc_add |
Add documents to collection |
mysql_doc_modify |
Modify documents matching criteria |
mysql_doc_remove |
Remove documents matching criteria |
mysql_doc_create_index |
Create index on JSON path |
mysql_doc_collection_info |
Get collection stats. v3.2.0: alias handling for collectionName |
| Tool | Description |
|---|---|
mysql_regexp_match |
REGEXP pattern matching |
mysql_like_search |
LIKE with wildcards |
mysql_soundex |
SOUNDEX phonetic matching |
mysql_substring |
SUBSTRING extraction |
mysql_concat |
String concatenation |
mysql_collation_convert |
Character set conversion |
| Tool | Description |
|---|---|
mysql_fulltext_create |
Create FULLTEXT index |
mysql_fulltext_drop |
Drop FULLTEXT index |
mysql_fulltext_search |
MATCH...AGAINST natural language. v2.2.0: maxLength parameter |
mysql_fulltext_boolean |
Boolean mode search. v2.2.0: maxLength parameter |
mysql_fulltext_expand |
WITH QUERY EXPANSION. v2.2.0: maxLength parameter |
| Tool | Description |
|---|---|
mysql_spatial_create_column |
Add POINT/POLYGON column with SRID |
mysql_spatial_create_index |
Create SPATIAL index |
mysql_spatial_point |
Create POINT from coords |
mysql_spatial_polygon |
Create POLYGON from points |
mysql_spatial_distance |
ST_Distance (Cartesian) |
mysql_spatial_distance_sphere |
ST_Distance_Sphere (Earth) |
mysql_spatial_contains |
ST_Contains check |
mysql_spatial_within |
ST_Within check |
mysql_spatial_intersection |
Get geometry intersection |
mysql_spatial_buffer |
Create buffer around geometry |
mysql_spatial_transform |
Transform SRID (CS conversion) |
mysql_spatial_geojson |
Import/Export GeoJSON |
| Tool | Description |
|---|---|
mysql_stats_descriptive |
Mean, median, stddev, variance |
mysql_stats_percentiles |
Calculate percentiles (p50, p90, p99) |
mysql_stats_correlation |
Pearson correlation coefficient |
mysql_stats_distribution |
Frequency distribution |
mysql_stats_time_series |
Time-bucketed aggregation |
mysql_stats_regression |
Simple linear regression |
mysql_stats_sampling |
Random row sampling |
mysql_stats_histogram |
Generate histogram buckets |
mysql_stats_row_number |
ROW_NUMBER() window function |
mysql_stats_rank |
RANK()/DENSE_RANK() window function |
mysql_stats_lag_lead |
LAG()/LEAD() window function |
mysql_stats_running_total |
Running total window function |
mysql_stats_moving_avg |
Moving average window function |
mysql_stats_ntile |
NTILE() window function |
mysql_stats_hypothesis |
T-Test/Chi-Square hypothesis testing |
mysql_stats_outliers |
Z-Score/IQR outlier detection |
mysql_stats_top_n |
Top N items per category |
mysql_stats_distinct |
Count distinct values |
mysql_stats_frequency |
Value frequency and mode |
mysql_stats_summary |
Comprehensive numeric summary |
| Tool | Description |
|---|---|
mysql_explain |
EXPLAIN query execution plan. v2.2.0: JSON/TREE/TRADITIONAL formats |
mysql_explain_analyze |
EXPLAIN ANALYZE (MySQL 8.0) |
mysql_slow_queries |
Query slow query log |
mysql_query_stats |
Performance schema stats |
mysql_index_usage |
Index usage statistics |
mysql_table_stats |
Table statistics. v2.2.0: Fast existence check |
mysql_buffer_pool_stats |
InnoDB buffer pool info |
mysql_thread_stats |
Thread activity stats |
mysql_detect_query_anomalies |
Detect unusual query execution patterns |
mysql_detect_bloat_risk |
Identify tables with high risk of fragmentation |
mysql_detect_connection_spike |
Detect connection pool anomalies |
| Tool | Description |
|---|---|
mysql_index_recommendation |
Suggest missing indexes. v2.2.0: queries, includeRedundant, includeUnindexed params. v3.2.0: allow database-wide index audit |
mysql_query_rewrite |
Query optimization hints |
mysql_force_index |
Generate FORCE INDEX hints |
mysql_optimizer_trace |
View optimizer decisions. v2.2.0: summary mode |
| Tool | Description |
|---|---|
mysql_optimize_table |
OPTIMIZE TABLE |
mysql_analyze_table |
ANALYZE TABLE statistics |
mysql_check_table |
CHECK TABLE integrity |
mysql_repair_table |
REPAIR TABLE (MyISAM) |
mysql_flush_tables |
FLUSH TABLES |
mysql_kill_query |
KILL connection/query |
mysql_append_insight |
Append insight to log. Feeds the mysql://insights resource |
mysql_server_config |
Manage server configs. v3.2.0: action required, audit default limit fixed |
mysql_audit_search |
Search and filter system audit logs. v3.2.0: requires at least one filter |
| Tool | Description |
|---|---|
mysql_security_audit |
Audit user privileges and settings |
mysql_security_firewall_status |
Firewall status (Enterprise/MariaDB) |
mysql_security_firewall_rules |
List firewall rules |
mysql_security_mask_data |
Mask PII data patterns. v3.2.0: alias validation at MCP boundary |
mysql_security_password_validate |
Check password strength policy |
mysql_security_ssl_status |
SSL/TLS connection status |
mysql_security_user_privileges |
List privileges for user. v2.2.0: summary mode |
mysql_security_sensitive_tables |
Scan for sensitive table names |
mysql_security_encryption_status |
TDE/Encryption-at-rest status |
MySQL 8.0+ Role Management
| Tool | Description |
|---|---|
mysql_role_list |
List defined roles |
mysql_role_create |
CREATE ROLE |
mysql_role_drop |
DROP ROLE |
mysql_role_grants |
SHOW GRANTS FOR role |
mysql_role_grant |
GRANT privileges TO role |
mysql_role_assign |
GRANT role TO user |
mysql_role_revoke |
REVOKE role FROM user |
mysql_user_roles |
List active roles for user |
| Tool | Description |
|---|---|
mysql_show_processlist |
SHOW PROCESSLIST |
mysql_show_status |
SHOW STATUS variables |
mysql_show_variables |
SHOW VARIABLES |
mysql_innodb_status |
SHOW ENGINE INNODB STATUS. v2.2.0: summary mode |
mysql_replication_status |
SHOW SLAVE STATUS |
mysql_pool_stats |
Connection pool statistics |
mysql_server_health |
Server health check |
| Tool | Description |
|---|---|
mysql_sys_user_summary |
Resource usage by user. v3.2.0: strict validation and aliases |
mysql_sys_io_summary |
I/O usage by thread/file |
mysql_sys_statement_summary |
Statement analysis |
mysql_sys_wait_summary |
Wait events analysis |
mysql_sys_innodb_lock_waits |
Blocked transactions info |
mysql_sys_schema_stats |
Table/index sizes and bloat |
mysql_sys_host_summary |
Metrics by source host. v3.2.0: strict validation and aliases |
mysql_sys_memory_summary |
Memory usage breakdown |
| Tool | Description |
|---|---|
mysql_export_table |
Export table to SQL/CSV. v2.2.0: limit parameter (default: 5) |
mysql_import_data |
LOAD DATA INFILE |
mysql_create_dump |
mysqldump command generation |
mysql_restore_dump |
Restore from dump |
mysql_audit_list_backups |
List available snapshots |
mysql_audit_restore_backup |
Restore a snapshot |
mysql_audit_diff_backup |
Diff a snapshot |
| Tool | Description |
|---|---|
mysql_master_status |
SHOW MASTER STATUS |
mysql_slave_status |
SHOW SLAVE STATUS |
mysql_binlog_events |
SHOW BINLOG EVENTS |
mysql_gtid_status |
GTID_EXECUTED status |
mysql_replication_lag |
Calculate replication lag |
Group Replication / InnoDB Cluster
| Tool | Description |
|---|---|
mysql_gr_status |
Group Replication status |
mysql_gr_members |
List cluster members |
mysql_gr_primary |
Get/Set primary member |
mysql_gr_transactions |
Check distributed transactions |
mysql_gr_flow_control |
Tuning flow control |
mysql_cluster_status |
InnoDB Cluster overall status. v2.2.0: summary mode |
mysql_cluster_instances |
List instance details. v2.2.0: offline node reporting |
mysql_cluster_topology |
View cluster topology map. v2.2.0: offline instance visibility |
mysql_cluster_router_status |
Connected Routers. v2.2.0: summary mode |
mysql_cluster_switchover |
Validates switchover readiness |
| Tool | Description |
|---|---|
mysql_partition_info |
Partition information |
mysql_add_partition |
ADD PARTITION |
mysql_drop_partition |
DROP PARTITION |
mysql_reorganize_partition |
REORGANIZE PARTITION |
MySQL Event Scheduler
| Tool | Description |
|---|---|
mysql_event_create |
CREATE EVENT |
mysql_event_alter |
ALTER EVENT |
mysql_event_drop |
DROP EVENT |
mysql_event_list |
SHOW EVENTS |
mysql_event_status |
Check event last run/status |
mysql_scheduler_status |
Check if scheduler is ON/OFF |
Note: Requires MySQL Router 8.0.17+ with REST API enabled. For InnoDB Cluster deployments, the cluster must be running for REST API authentication. See MySQL-Router.
| Tool | Description |
|---|---|
mysql_router_status |
Get Router process status and version. Params: summary, limit, compact
|
mysql_router_routes |
List all configured routes. Params: summary, limit, compact
|
mysql_router_route_status |
Get status of a specific route. Params: routeName, summary, limit, compact
|
mysql_router_route_health |
Check health/liveness of a route. Params: routeName, summary, limit, compact
|
mysql_router_route_connections |
List active connections on route. Params: routeName, summary, limit, compact
|
mysql_router_route_destinations |
List backend MySQL server destinations. Params: routeName, summary, limit, compact
|
mysql_router_route_blocked_hosts |
List blocked IP addresses for a route. Params: routeName, summary, limit, compact
|
mysql_router_metadata_status |
InnoDB Cluster metadata cache status metadataName (typically bootstrap), summary, limit, compact
|
mysql_router_pool_status |
Connection pool statistics poolName, summary, limit, compact
|
Note: Requires access to ProxySQL admin interface. See ProxySQL.
| Tool | Description |
|---|---|
proxysql_status |
Get ProxySQL version, uptime, and runtime stats. v3.0.2: summary mode |
proxysql_servers |
List configured backend MySQL servers |
proxysql_query_rules |
List query routing rules |
proxysql_query_digest |
Get query digest statistics (top queries) |
proxysql_connection_pool |
Get connection pool statistics per server |
proxysql_users |
List configured MySQL users |
proxysql_global_variables |
Get global variables (mysql-* and admin-*). v3.0.2: limit, like params; credential redaction |
proxysql_runtime_status |
Get runtime configuration status. v3.0.2: summary mode; credential redaction |
proxysql_memory_stats |
Get memory usage metrics. v3.0.2: Added count field |
proxysql_commands |
Execute LOAD/SAVE admin commands |
proxysql_process_list |
Get active sessions |
Note: Requires MySQL Shell 8.0+ installed. See MySQL-Shell.
| Tool | Description |
|---|---|
mysqlsh_version |
Get MySQL Shell version and installation status. Params: summary, limit, compact
|
mysqlsh_check_upgrade |
Check server upgrade compatibility. Params: targetVersion, summary, limit, compact
|
mysqlsh_export_table |
Export table to file (CSV, TSV). Params: schema, table, file, summary, limit, compact
|
mysqlsh_import_table |
Parallel table import. v2.1.0: updateServerSettings auto-enables local_infile. Params: file, schema, table, updateServerSettings, summary, limit, compact
|
mysqlsh_import_json |
Import JSON documents to collection or table. Params: file, schema, collection, summary, limit, compact
|
mysqlsh_dump_instance |
Dump entire MySQL instance. Params: outputDir, ddlOnly, summary, limit, compact
|
mysqlsh_dump_schemas |
Dump selected schemas. v2.1.0: ddlOnly dumps only DDL. Params: schemas, outputDir, ddlOnly, summary, limit, compact
|
mysqlsh_dump_tables |
Dump specific tables. v2.1.0: all controls trigger inclusion. Params: schema, tables, outputDir, all, summary, limit, compact
|
mysqlsh_load_dump |
Load MySQL Shell dump. v2.1.0: updateServerSettings auto-enables local_infile. Params: dumpDir, updateServerSettings, summary, limit, compact
|
mysqlsh_run_script |
Execute JS/Python/SQL script via MySQL Shell. Params: code, language, summary, limit, compact
|
Vector embeddings, KNN search, and hybrid search (MySQL 9.0+)
| Tool | Description |
|---|---|
mysql_vector_store |
Store a single vector embedding |
mysql_vector_batch_store |
Bulk insert vector embeddings |
mysql_vector_delete |
Delete a vector by primary key |
mysql_vector_get |
Retrieve a vector by primary key |
mysql_vector_search |
Top-k nearest neighbors (KNN) search |
mysql_vector_range_search |
Find all vectors within a distance threshold |
mysql_vector_hybrid_search |
Combine vector distance with FULLTEXT relevance using Reciprocal Rank Fusion. v3.1.0: metric, rrfK, select, filter parameters |
mysql_vector_info |
View table vector columns and dimensions |
mysql_vector_create_index |
Create HNSW vector index (MySQL 9.1+) |
mysql_vector_optimize |
Optimize vector index statistics |
mysql_vector_stats |
Get vector dimension, count, and distance statistics |
We provide pre-flight analysis, relationship mapping, and constraint validation tools to ensure safe schema modifications.
| Tool | Description |
|---|---|
mysql_dependency_graph |
Generate a deep relationship graph of tables based on foreign keys |
mysql_topological_sort |
Determine exact creation/deletion order for foreign key constraints |
mysql_cascade_simulator |
Simulate cascading deletes/updates without actual data modification |
mysql_schema_snapshot |
Capture the state of the schema definition at a given point in time |
mysql_constraint_analysis |
Detect circular dependencies, missing indexes, and overlapping constraints |
mysql_migration_risks |
Run pre-flight checks on DDL to identify downtime or locking risks |
We built an integrated schema versioning and deployment tracker directly into the MCP server.
| Tool | Description |
|---|---|
mysql_migration_init |
Set up migration tracking tables in the database |
mysql_migration_record |
Manually record an out-of-band migration to the history |
mysql_migration_apply |
Apply a single forward migration step |
mysql_migration_rollback |
Revert a recently applied migration |
mysql_migration_history |
View applied migrations history |
mysql_migration_status |
Check the current state of applied vs. pending migrations |
Execute JavaScript in a worker-thread sandbox with access to all MySQL tools. Read Code-Mode for API documentation.
| Tool | Description |
|---|---|
mysql_execute_code |
Execute code with access to all mysql.* APIs. 70-90% token savings |
- Tool-Filtering - Reduce tool count for IDE limits
- Configuration - MCP client configuration
We generate this documentation automatically.
Unlock autonomous database orchestration with an enterprise-grade MySQL MCP server. Featuring blazing-fast sandboxed Code Mode, uncompromising schema enforcement, and seamless ecosystem integrations to power secure, intelligent AI workflows.
- Installation
- Configuration
- Architecture
- HTTP Transport
- Tool Filtering
- Code Mode
- Tools
- Prompts
- Resources
- Observability & Telemetry