# Mysql

> Mysql is an open-source MCP server for databases. MCP server giving AI assistants schema inspection and SQL access to MySQL and MariaDB. It is available on CLI, Linux and self-hosted.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, Linux, self-hosted
- **Repository:** https://github.com/codechap/mcp-server-mysql
- **MCP Registry name:** io.github.codeChap/mysql
- **Categories:** [databases](https://ai-powered.com/categories/databases)
- **Listing updated:** 2026-11-18

## About

The README says this Rust server lets an MCP client such as Claude read table schemas and run SQL against MySQL or MariaDB over JSON-RPC on stdio. Queries run through a connection pool, and each query can name its own database, so a single server instance can reach several databases without relying on session state.

By default the server is read-only and accepts only SELECT statements. Insert, update and delete tools, along with other write operations, are enabled only when the server is started with the dangerous-queries flag. Table names are restricted to alphanumeric characters and underscores, and values are sent as prepared-statement parameters.

It suits developers and data teams who want an assistant to explore a MySQL or MariaDB schema and answer questions from live data, with write access kept off unless explicitly enabled.

## Features

- **Schema inspection:** Returns column types, nullability, defaults, keys, indexes and constraints for a named table or all tables.
- **Read-only by default:** Only SELECT queries run unless the dangerous-queries flag is set at startup.
- **Per-query database selection:** A database parameter on each query chooses the target schema without a persistent USE statement.
- **Connection pooling:** Maintains a pool of up to five MySQL connections with automatic retry on transient failures.
- **Optional write tools:** Insert, update and delete tools return last insert ID or affected row counts when write access is enabled.
- **SSL/TLS support:** Supports standard MySQL SSL/TLS connections.

## Good for

- Letting an AI assistant explore an unfamiliar database schema
- Answering ad-hoc questions from production or test data with read-only queries
- Querying several databases from one assistant session
- Prototyping data updates against a development database with write mode enabled

## Tools

- `mysql`: Retrieve schema information for a table or all tables.
- `query`: Execute SQL queries, optionally against a named database.
- `insert`: Insert a row into a table when write mode is enabled.
- `update`: Update rows matching conditions when write mode is enabled.
- `delete`: Delete rows matching conditions when write mode is enabled.

## FAQ

### Does it allow writes by default?

No. The README says the server runs in read-only mode and allows only SELECT queries unless --allow-dangerous-queries is enabled.

### Which database versions are supported?

The README lists MySQL 5.7+ and MariaDB 10.2+.

### What license does it use?

The README states Apache-2.0.

### How is it installed?

The README describes building from source with Cargo or extracting a release package, then configuring the binary in an MCP client such as Claude Desktop.

### Is Mysql free?

Yes. Mysql is open source, so you can use and self-host it for free.

### What are the best alternatives to Mysql?

The closest alternatives to Mysql are AdoMcp, MCP Hydrolix, MCP Toolbox for Databases, Mongodb MCP Server and MCPDBWizard for MariaDB.

## Where this comes from

- Description: written from the project's README and its MCP Registry entry.

## Alternatives

- [AdoMcp](https://ai-powered.com/mcp/adomcp): AdoMcp is an open-source MCP server for databases.
- [MCP Hydrolix](https://ai-powered.com/mcp/mcp-hydrolix): MCP Hydrolix is an open-source MCP server for databases.
- [MCP Toolbox for Databases](https://ai-powered.com/mcp/mcp-toolbox-for-databases-2): MCP Toolbox for Databases is an open-source MCP server for databases.
- [Mongodb MCP Server](https://ai-powered.com/mcp/mongodb-mcp-server): Mongodb MCP Server is an open-source MCP server for databases.
- [MCPDBWizard for MariaDB](https://ai-powered.com/mcp/mcpdbwizard-for-mariadb): MCPDBWizard for MariaDB is a paid MCP server for databases.
- [Db Conn MCP](https://ai-powered.com/mcp/db-conn-mcp): Db Conn MCP is an MCP server for databases.

---
Source: https://ai-powered.com/mcp/mysql
