# mysql-mcp-server

> mysql-mcp-server is an open-source MCP server for databases. Read-only MySQL access for LLM clients via the Model Context Protocol. It is available on CLI, Self-hosted and API.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, Self-hosted, API
- **Repository:** https://github.com/dave-wind/mysql-mcp-server
- **GitHub stars:** 16
- **License:** MIT
- **Categories:** [databases](https://ai-powered.com/categories/databases)
- **Listing updated:** 2026-12-01

## About

Gives an AI assistant a safe window into a MySQL database. The server lists table structures as resources and offers a single query tool that accepts SELECT statements, so a model can explore a schema and answer questions against live data without changing anything.

Every query runs inside a READ ONLY transaction, and SQL is validated to allow only SELECT statements. Data modification and schema changes such as INSERT, UPDATE, DELETE, CREATE, ALTER and DROP are not supported. Connection details are passed as a MySQL connection URL in the client configuration file.

The package is aimed at developers and analysts who want Claude-style or other MCP-compatible assistants to query their own MySQL data. It runs locally over stdio on Node.js 18 or later and is installed through npm.

## Features

- **Read-only query enforcement:** Queries are checked to allow only SELECT statements and run inside READ ONLY transactions.
- **Schema discovery:** Table structures with column names and data types are exposed automatically as resources.
- **Single query tool:** A query tool accepts a SQL string and returns results for the connected database.
- **MCP stdio transport:** Communicates with clients over JSON-RPC on stdio following the Model Context Protocol.
- **Simple npx setup:** Runs from a single command in an MCP client config with a MySQL connection URL.

## Good for

- Letting an assistant explore an unfamiliar MySQL schema before writing queries
- Answering ad hoc business questions against a production replica without write risk
- Generating reports from live MySQL tables inside an MCP-enabled chat client
- Debugging application data by asking an LLM to run read-only lookups

## Tools

From the tool list in its README, going by the names, all 1 tool only read data. From the server's own tool labels and tool names; not verified by us.

- `query` (name suggests: reads): Execute read-only SQL queries against the connected database.

## FAQ

### Can the server modify my database?

No. It allows only SELECT statements, runs queries in READ ONLY transactions, and does not support data modification or schema changes.

### What do I need to run mysql-mcp-server?

Node.js version 18 or later and a MySQL connection URL. It is installed with npm and launched through npx in an MCP client configuration.

### Which clients can use mysql-mcp-server?

Any LLM system that supports the Model Context Protocol and communicates over stdio.

### 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, Read Only Local Mysql MCP Server and MySQL MCP Server.

## Where this comes from

- Description: written from the project's README.

## 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](https://ai-powered.com/mcp/mysql-mcp-server-4): mysql_mcp_server is an open-source MCP server for databases.
- [Read Only Local Mysql MCP Server](https://ai-powered.com/mcp/read-only-local-mysql-mcp-server): Read Only Local Mysql MCP Server is an open-source MCP server for databases.
- [MySQL MCP Server](https://ai-powered.com/mcp/mysql-mcp-server-2): MySQL MCP Server is an open-source MCP server for databases.
- [postgres_mcp](https://ai-powered.com/mcp/postgres-mcp-5): postgres_mcp is an open-source MCP server for databases.
- [go-mcp-mysql](https://ai-powered.com/mcp/go-mcp-mysql): go-mcp-mysql 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-3
