# mysql [Health: Active]

**Category:** 🗄️ Databases  
**Repository:** https://github.com/codeChap/mcp-server-mysql  
**GitHub Stars:** 1  
**Views:** 1  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/mysql

## Description
MCP server for MySQL/MariaDB — pooled async queries with destructive-query safety

## Tools
Capabilities this server exposes over MCP:

- **table_name**
- **query**
- **database**
- **data**
- **conditions**

## Claude Desktop Quick Installation
No confirmed install details yet, so no config is published. Follow the setup steps in the repository above.

## Documentation

## 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.

_Full upstream README: https://allmcps.com/mcp/mysql/readme_

