Mysql logo

Mysql

Connects AI assistants to MySQL or MariaDB for schema inspection, SQL queries, and controlled data changes.

Install Mysql

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

No confirmed install command yet

We only publish a config when the install details come from the project itself — its README, its docs, or a verified owner. We haven’t found those for mysql, and we’d rather show nothing than a guess you’d paste into your client.

Open setup steps on GitHub

Overview

The mysql MCP server connects AI assistants to MySQL or MariaDB through MCP over standard input/output. It supports schema inspection, SQL execution, and structured insert, update, and delete operations, with pooled connections and retry handling. Queries default to read-only, while destructive operations require an explicit startup flag. Use it when an agent needs controlled access to one or more MySQL databases.

Use cases

  • Inspect table schemas before writing queries
  • Run read-only reports against MySQL data
  • Query different databases in one session
  • Insert, update, or delete rows when explicitly enabled

Key features

  • MySQL and MariaDB connectivity
  • Schema and constraint inspection
  • Read-only SQL by default
  • Optional database selection per query
  • Pooled connections with retry handling
  • Controlled insert, update, and delete operations

Tools5

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

Self-reported~9 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 Today

Recent health check succeeded.

6/6 checks healthy over the last 36d

Adoption & maintenance

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

GitHub stars1Stargazers on the source repository.
Last commit9d agoMost recent push to the default branch.
Tools exposed5Callable tools this server registers over MCP.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

How Mysql works

What mysql MCP server does

The mysql MCP server gives an MCP-compatible AI client access to a MySQL or MariaDB database. It can inspect table structure, execute SQL, and perform structured data changes. Schema inspection returns columns, types, nullability, defaults, keys, indexes, and constraints for one table or all tables.

The server supports both a default database selected at startup and a per-query database value. This is useful for sessions that need to work with several databases without relying on connection state or fully qualified table names.

How it works

The mysql MCP server runs as a Rust binary and communicates through JSON-RPC 2.0 over stdio. A client starts the process with connection arguments such as host, port, username, password, and database. The implementation uses connection pooling and retry handling for database connections.

SQL execution is read-only by default: SELECT statements are permitted while dangerous query keywords are blocked. INSERT, UPDATE, and DELETE operations become available when the process is started with --allow-dangerous-queries. Structured data tools accept table names, column-value objects, and, for updates or deletes, conditions used to form the WHERE clause.

Each query can optionally identify its database. If omitted, the server uses the database supplied at startup. Supplying the value on individual requests avoids hidden session state and allows separate queries in the same client session to target different databases.

Setup and configuration

Build the project with Rust 1.70 or newer using cargo build --release. The resulting executable is target/release/mcp-server-mysql. The database must be MySQL 5.7 or newer, or MariaDB 10.2 or newer, and the process needs access to that database.

Start the binary with the required username and database name. Host defaults to localhost, port defaults to 3306, and the password is optional with an empty default. Claude Desktop can launch the process by listing the executable under mcpServers and passing these values in its args array.

Tools and capabilities

The documented operations include:

  • Inspect one table or request schemas for all tables.
  • Run SQL with an optional database override.
  • Insert a row from a column-value object.
  • Update rows using values and conditions.
  • Delete rows using conditions.

Insert returns the last insert ID. Update and delete return the number of affected rows. Delete requests should include conditions to avoid removing every row in a table.

Limitations and notes

The server is intended for MySQL and MariaDB, not a general-purpose SQL database connector. Destructive SQL is disabled unless explicitly enabled at startup, but enabling it gives the client permission to issue INSERT, UPDATE, and DELETE operations, so database credentials and client access should be controlled accordingly.

The per-query database parameter applies to SQL requests; it does not preserve a USE database command as shared state across later pooled connections. Choose a default database at startup for single-database work, or provide the database explicitly for requests that target multiple databases.

Reviews

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

Frequently Asked Questions about Mysql

mysql is an MCP server that connects AI assistants to MySQL and MariaDB databases over stdio. Its main tools inspect table schemas, execute SQL queries, insert rows, update rows with conditions, and delete rows with conditions. SELECT access is enabled by default, while destructive operations require an explicit startup option.

Build it from source with Rust 1.70 or newer using `cargo build --release`. The executable is created at `target/release/mcp-server-mysql`; start it with a database host, username, and database name, then configure the binary as an MCP server in the client.

Add the binary to Claude Desktop's `mcpServers` configuration and pass connection values such as `--host`, `--port`, `--username`, `--password`, and `--database` in `args`. Restart Claude Desktop after saving the configuration.

Start the process with `--allow-dangerous-queries`. Without that flag, the server allows SELECT queries by default and blocks dangerous query keywords. Update and delete requests should include conditions to limit affected rows.

Pass the optional `database` value with each SQL query that should use a database other than the startup default. This lets separate requests target different databases without depending on persistent `USE` state or fully qualified table names.

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 AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/mysql?style=directory)](https://allmcps.com/mcp/mysql)
HTML Embed
<a href="https://allmcps.com/mcp/mysql"><img src="https://allmcps.com/api/badge/mysql?style=directory" alt="Mysql on AllMCPs" /></a>