performance_schema. Use it for reporting, data sync, slow-query triage, index hygiene audits, and schema-aware agents — often alongside the Postgres connector when you operate both relational engines.
Prerequisites
- A MySQL server (5.7+ or 8.x) reachable from AgentRuntime (allowlist egress IPs if behind a firewall)
Host,Port,Database,User, andPasswordfor the target schemaSELECTfor reporting workflows;INSERT/UPDATE/DELETEonly when steps callmysql_execute_sqlfor mutationsperformance_schemaenabled for diagnostic tools (mysql_list_table_stats,mysql_list_active_queries)- project_contributor access
Connect in AgentRuntime
Create a connection
Go to Connections and click New custom connection to create a database connection with your MySQL credentials:
Host— server hostname or IP (e.g.db.example.com)Port— TCP port (default3306)Database— default schema for queriesUser/Password— authentication credentials
Add mysql MCP instance
Go to MCP, click Add instance for mysql, wire your connection on Instance config, set the profile active, and save.
Test with a schema listing
Add a workflow with a single mcp_call to
mysql_list_tables with output_format: "simple". Run it to confirm connectivity before production queries.What you can build
- Daily ops digest —
mysql_list_active_queries+mysql_list_table_fragmentation→ LLM summary → Gmail or Slack alert. - Reporting pipeline —
mysql_execute_sqlSELECT on a schedule → transform rows → push to Google Sheets or a Postgres warehouse. - Index hygiene audit —
mysql_list_tables_missing_unique_indexes→ ticket creation in ClickUp or Wrike for tables without primary keys. - Approval-gated writes — human_task before
mysql_execute_sqlINSERT/UPDATE/DELETE on production tables.
Tools
| Tool | Description |
|---|---|
mysql_list_active_queries | List non-sleeping MySQL queries ordered by execution time |
mysql_list_tables_missing_unique_indexes | List tables without a primary or unique key |
mysql_list_table_fragmentation | List the most fragmented MySQL tables |
mysql_list_table_stats | List MySQL table I/O statistics from performance_schema |
mysql_execute_sql | Execute a single SQL statement against the configured MySQL database |
mysql_list_tables | List schema information for all or selected MySQL tables |
mysql_get_query_plan | Return the JSON execution plan for a SQL statement |
Example
Fetch pending orders for a daily report:lua_script step:
Configuration
| Key | Required | Default | Description |
|---|---|---|---|
mysql_host | Yes | — | MySQL server hostname or IP address |
mysql_port | No | 3306 | MySQL server TCP port |
mysql_database | Yes | — | Default database (schema) for queries |
mysql_user | Yes | — | MySQL username for authentication |
mysql_password | Yes | — | MySQL password for authentication |
mysql_query_timeout_seconds | No | 30 | Per-query timeout in seconds |
Troubleshooting
| Issue | Fix |
|---|---|
| Connection timeout | Verify host, port, firewall rules, and that the server accepts remote connections |
Access denied | Confirm user/password and that the account is allowed from AgentRuntime’s network |
| Diagnostic tools empty | Grant SELECT on performance_schema or use a monitoring-capable DB user |
| Slow queries timing out | Increase mysql_query_timeout_seconds or add indexes; use mysql_get_query_plan to investigate |
Related
- Integrations quickstart
- Postgres connector — similar SQL patterns for PostgreSQL
- Connector catalog
- Troubleshooting