MySQL AIops logo

MySQL AIops

Governed MySQL and MariaDB diagnostics, RCA, and guarded DBA operations through 35 audited MCP tools.

Install MySQL AIops

Pick your client, then add it in one click or paste the config.

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "mysql-aiops": {
      "command": "uvx",
      "args": [
        "--from",
        "mysql-aiops",
        "mysql-aiops-mcp"
      ],
      "env": {
        "MYSQL_AIOPS_MASTER_PASSWORD": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

Automated check passed— started and listed 35 tools correctly ().

Overview

MySQL AIops MCP server connects AI agents to MySQL 8.x and MariaDB 10.6+ through PyMySQL, information_schema, and performance_schema. It provides audited read and write tools for query, lock, replication, fragmentation, session, index, table, and server operations, including four evidence-based RCA analyses. Every call is recorded locally, while writes require dry-run previews and capture reversible before-state where possible. Reach for it when an agent needs governed DBA investigation or controlled operational changes against a configured database.

Use cases

  • Investigate the worst statement digest with cited slow-query evidence
  • Trace root blockers and deadlock chains from live lock metadata
  • Diagnose replica lag from thread state, errors, and delay settings
  • Preview and audit index, table, session, and global-variable changes

Key features

  • 35 MCP tools covering 26 reads and 9 writes
  • Slow-query, lock-wait, replication-lag, and fragmentation RCA
  • Encrypted credential storage with Fernet and scrypt
  • Audit rows for every MCP and CLI call
  • Dry-run previews and before-state-based undo records
  • Automatic MySQL and MariaDB flavor detection

Tools35

What MySQL AIops lets your agent do. Expand a tool for its parameters.

Verified live~5.8k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

22/24 checks healthy over the last 111d

What it can do

From the 35 tools this server returned when we ran it; 35 declare their own safety hints.

Runs commands · 1Can delete or modify data · 9Handles credentials · 2Read-only tools · 26
Network at startup2 connections
Files written at startup12

Observed 2026-11-05 in an isolated sandbox. A description of reach, not a security audit.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 6d ago via OSV.dev · mysql-aiops (PyPI)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

Last commit1mo agoMost recent push to the default branch.
Availability100%Our rolling endpoint + install checks that succeeded.
Install checkPassedOur sandbox started it and listed its tools.
Tools exposed35Callable tools this server registers over MCP.
Directory activity4 viewsConfig copies, upvotes, and views on AllMCPs.

How MySQL AIops works

What MySQL AIops does

MySQL AIops exposes MySQL and MariaDB DBA operations through an MCP server and a companion CLI. Its main use is evidence-based investigation: slow-query, lock-wait and deadlock, replication-lag, and table-fragmentation analyses collect database measurements and turn them into cited causes and suggested actions.

The project targets MySQL 8.0 and 8.4, plus MariaDB 10.6 and later. It detects the database flavor from version() and selects flavor-specific statements, including the appropriate replication-status and lock-wait sources.

How it works

The server connects with PyMySQL and reads database metadata and runtime instrumentation from information_schema and performance_schema. Flagship analyses can either process injected records for offline or pure analysis, or retrieve live data from a configured target. Slow-query analysis uses statement digest metrics and can include an EXPLAIN FORMAT=JSON plan. Lock analysis builds a wait-for tree and identifies the root blocker, while also parsing the last deadlock from InnoDB status. Replication analysis evaluates thread state, lag, and error fields. Fragmentation analysis ranks tables by reclaimable data_free.

All MCP and CLI calls pass through the bundled governance harness and create an audit row in ~/.mysql-aiops/audit.db. Audit records include outcome summaries and descriptive risk tiers such as none, confirm, and review. The risk tier is informational; it does not approve or block an operation.

Writes require a committed pending audit row before the database platform is contacted. Read and preview operations can continue with a warning if audit storage is unavailable.

Setup and configuration

Install the package with uv tool install mysql-aiops or pipx install mysql-aiops, then run mysql-aiops init to add a target and save its password. Credentials are stored in ~/.mysql-aiops/secrets.enc, encrypted with Fernet and scrypt rather than written as plaintext. mysql-aiops doctor checks configuration, credentials, connectivity, detected flavor, and performance-schema readiness.

Run the standalone MCP process with mysql-aiops-mcp. For noninteractive use, set MYSQL_AIOPS_MASTER_PASSWORD; otherwise the CLI can request the master password interactively. The server uses stdio, so it can be added to an MCP client configuration such as Claude Desktop. Claude Code and OpenClaw integrations are also documented as bundled installation options.

Tools and capabilities

The MCP surface contains 35 tools: 26 reads and 9 writes. Read coverage includes server metadata, variables, status, databases, engines, connections, sessions, long-running queries, transactions, lock waits, top queries, query plans, index usage, table sizes and status, replication, binlog state, the four RCA analyses, and undo inspection.

Write tools can kill sessions or queries, create or drop indexes, optimize or analyze tables, change global variables, reset query statistics, and apply recorded undo operations. Each write accepts a dry_run preview. CLI state-changing operations also support --dry-run and double confirmation.

Identifiers that cannot be bound as query parameters are checked against a strict character set and quoted with backticks; values use bound parameters. Mutations retrieve the real before-state and record an inverse when one exists. Dropped indexes can be recreated from their SHOW CREATE TABLE definition, and global-variable changes can restore the previous value.

Limitations and notes

Slow-query tools and slow_query_rca require performance_schema=ON. A read account should have SELECT on performance_schema, plus PROCESS and REPLICATION CLIENT. Permission enforcement remains the responsibility of MySQL or MariaDB: use an account with only the privileges appropriate to the intended operation.

kill_session, kill_query, optimize_table, analyze_table, and reset_query_stats are treated as irreversible by the undo system, although their prior state is recorded for audit. MySQL 5.7 and older releases are outside the targeted support scope. Cloud-managed MySQL may support wire-compatible reads, but provider restrictions on operations such as KILL and SET GLOBAL apply and are untested.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about MySQL AIops

MySQL AIops is an MCP server that connects AI agents to MySQL 8.x and MariaDB 10.6+ through PyMySQL. Its main tools inspect server activity, queries, locks, indexes, tables, replication, and fragmentation, provide four RCA analyses, and perform audited DBA writes with dry-run support and undo records where reversibility is available.

Install it with `uv tool install mysql-aiops` or `pipx install mysql-aiops`, initialize a target with `mysql-aiops init`, and start `mysql-aiops-mcp`. Run `mysql-aiops doctor` to verify credentials, connectivity, database flavor, and performance-schema readiness before configuring the stdio server in an MCP client.

MySQL AIops stores the account password in `~/.mysql-aiops/secrets.enc`, encrypted with Fernet and scrypt. Run `mysql-aiops init` to create the store and configure a target. For noninteractive MCP or CI use, provide the master password through `MYSQL_AIOPS_MASTER_PASSWORD`; the CLI can prompt interactively instead.

Yes, MySQL AIops targets MariaDB 10.6 and later, including the 11.x series. It detects whether the connection is MySQL or MariaDB from `version()` and selects flavor-specific statements, such as `SHOW SLAVE STATUS` and MariaDB's lock-wait information schema.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewMySQL AIops AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/mysql-aiops?style=directory)](https://allmcps.com/mcp/mysql-aiops)
HTML Embed
<a href="https://allmcps.com/mcp/mysql-aiops"><img src="https://allmcps.com/api/badge/mysql-aiops?style=directory" alt="MySQL AIops on AllMCPs" /></a>