# mysql_mcp_server

> mysql_mcp_server is an open-source MCP server for databases. MCP server giving AI assistants safe, structured read and query access to MySQL databases. It is available on CLI, API, Self-hosted, Linux, macOS, Windows and VS Code.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, API, Self-hosted, Linux, macOS, Windows, VS Code
- **Website:** https://designcomputer.com
- **Repository:** https://github.com/designcomputer/mysql_mcp_server
- **GitHub stars:** 1,423
- **License:** MIT
- **Categories:** [databases](https://ai-powered.com/categories/databases)
- **Listing updated:** 2026-12-01

## About

The server sits between an AI client and a MySQL instance, letting the assistant list tables, inspect schemas, sample rows and run SQL through a defined set of tools rather than a raw connection. Connection details are supplied through environment variables, and it can work across several databases on one server when no single database is pinned.

It runs over standard input/output for local clients such as Claude Desktop, Claude Code and VS Code, or over Streamable HTTP/SSE for remote deployments. SSL/TLS and SSH tunnelling are supported for reaching databases on private networks, and passwords and SSH keys are masked in logs.

The project suits developers and data analysts who want an assistant to explore a MySQL schema and answer questions about its data. Because the SSE mode has no built-in authentication, the documentation recommends a dedicated low-privilege database user and a reverse proxy when exposing it beyond localhost.

## Features

- **Table and schema discovery:** Lists tables as resources and returns column names, types, nullability, defaults and comments.
- **SQL query execution:** Runs SELECT, SHOW, DESCRIBE and DML statements, with DML flagged as destructive.
- **Table data sampling:** Fetches a small sample of rows so an assistant can understand data formats quickly.
- **Multi-database mode:** Works across all user databases when no default database is set, using database.table names.
- **SSH tunnelling and TLS:** Connects to databases behind jump hosts and supports SSL modes up to certificate identity verification.
- **Prewritten exploration prompts:** Provides guided prompts for exploring a whole database or analysing a single table.

## Good for

- Letting an AI assistant explore an unfamiliar MySQL schema and summarise what it contains
- Asking natural-language questions of production or analytics tables in Claude Desktop or VS Code
- Sampling table contents to check data formats before writing queries
- Running self-hosted MCP access to a database over SSE for a small team

## Tools

From the tool list in its README, going by the names, 1 of 3 tools changes data. From the server's own tool labels and tool names; not verified by us.

- `execute_sql` (name suggests: changes): Executes standard SQL queries, with DML flagged as destructive.
- `get_schema_info` (name suggests: reads): Returns column metadata for a table or database structure.
- `get_table_sample` (name suggests: reads): Fetches a sample of rows from a table, up to 20.

## FAQ

### Which transport modes does mysql_mcp_server support?

It supports standard input/output for local clients and Streamable HTTP (SSE) for remote or self-hosted deployments.

### Can mysql_mcp_server run multi-statement SQL queries?

No. Only single SQL statements are supported in execute_sql, and multi-statement queries such as USE followed by SELECT are rejected.

### Does the SSE mode require authentication?

No built-in authentication is included, so the documentation recommends placing it behind a reverse proxy that enforces credentials when it is exposed beyond localhost.

### How is the license?

The project is released under the MIT License.

### Is mysql_mcp_server free?

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

### What are the best alternatives to mysql_mcp_server?

The closest alternatives to mysql_mcp_server are mcp-server-mysql, mcp-mysql-server, mysql_mcp_server_pro, mysql-mcp-server and mcp-alchemy.

## Where this comes from

- Description: written from the project's README and the project's website.

## Alternatives

- [mcp-server-mysql](https://ai-powered.com/mcp/mcp-server-mysql): mcp-server-mysql is an open-source MCP server for databases.
- [mcp-mysql-server](https://ai-powered.com/mcp/mcp-mysql-server): mcp-mysql-server is an open-source MCP server for databases.
- [mysql_mcp_server_pro](https://ai-powered.com/mcp/mysql-mcp-server-pro): mysql_mcp_server_pro is an open-source MCP server for databases.
- [mysql-mcp-server](https://ai-powered.com/mcp/mysql-mcp-server-3): mysql-mcp-server is an open-source MCP server for databases.
- [mcp-alchemy](https://ai-powered.com/mcp/mcp-alchemy): mcp-alchemy is an open-source MCP server for databases.
- [sql-query-mcp](https://ai-powered.com/mcp/sql-query-mcp): sql-query-mcp is an open-source MCP server for databases.
- [MySQL Ops MCP](https://ai-powered.com/mcp/mysql-ops-mcp): MySQL Ops MCP is an open-source MCP server for databases.
- [Mysql](https://ai-powered.com/mcp/mysql): Mysql is an open-source MCP server for databases.

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