Skip to content
musaddiq-dev avatar

MySQL MCP Server

musaddiq-dev/mysql-mcp-server

Read-only MySQL access for listing databases, tables, and schemas, plus bounded SELECT queries.

CCM score
52 of 100
tools
4
auth
Secret needed
transport
STDIO
env vars
8
last updated
May 23, 2026
View on GitHub

Own this MCP server? Claim it

What it does

  • Lists with list_databases and list_tables, and inspects columns with describe_table, for schema discovery
  • Runs single SELECT statements through execute_query, with the server's safety checks and a row cap from the source
  • Connects over stdio with a MySQL user and password; a dedicated read-only user is recommended for safety
  • Designed for exploring unfamiliar databases, checking schemas, and answering data questions from an editor

Tools

4 tools

Public tool metadata for what this MCP can expose to an agent.

list_databasesList all accessible databases on the MySQL server

List all accessible databases on the MySQL server

No parameter schema in public metadata yet.

list_tablesList all tables in a specified database1 params

List all tables in a specified database

Parameters* required
databasestring
Database name (optional, uses default if not specified)
describe_tableShow the schema for a specific table2 params

Show the schema for a specific table

Parameters* required
databasestring
Database name (optional, uses default if not specified)
tablestring
Table name
execute_queryExecute a read-only SQL query2 params

Execute a read-only SQL query

Parameters* required
databasestring
Database name (optional, uses default if not specified)
querystring
SQL query (only SELECT, SHOW, DESCRIBE, and EXPLAIN statements are allowed)

Configuration

MYSQL_HOSTdefault: localhost

MySQL host

MYSQL_PORTdefault: 3306

MySQL port

MYSQL_USERdefault: root

MySQL username

MYSQL_PASSWORDsecret

MySQL password

MYSQL_DATABASE*

MySQL database name

MYSQL_POOL_SIZEdefault: 5

MySQL connection pool size

LOG_LEVELdefault: INFO

Python logging level

MYSQL_READ_QUERY_LIMITdefault: 1000

Maximum rows returned by read queries

Readme

MySQL MCP Server

A Python Model Context Protocol (MCP) server for inspecting and querying MySQL databases from MCP-compatible clients. It provides table discovery, schema inspection, read query execution, DDL lookup, query explanation, and optional write/DDL tools for controlled database administration workflows.

Features

  • List tables and describe table schemas
  • Execute SELECT queries with safety checks
  • Retrieve SHOW CREATE TABLE output
  • Explain query execution plans
  • Summarize tables and row counts
  • Optional write and DDL tools for users who intentionally run with elevated database privileges

Safety Model

mysql_execute_read_query only accepts a single statement beginning with SELECT, rejects common modifying SQL keywords and risky file-read/write forms, and caps returned rows by MYSQL_READ_QUERY_LIMIT. This is a guardrail, not a substitute for database permissions. Use a dedicated read-only MySQL user for safe exploration. The write and DDL tools can modify or destroy data if the configured database user is allowed to do so; keep them on manual approval in your MCP client.

Requirements


View the full README on GitHub

Details

Repository
github.com/musaddiq-dev/mysql-mcp-server
Category
Databases
Package
mdev-mysql-mcp-server
Transport
STDIO
Auth
Required
Registry
MCP registry, active

Questions

What can an AI agent do with the MySQL MCP Server?

The server lets an agent list the databases a MySQL server exposes, list the tables in a chosen database, show a table's schema, and run a read-only SQL query. The README also describes table DDL lookup, query explanation, and a database summary with row counts, plus optional write and DDL tools for controlled administration.

How do I install the MySQL MCP Server and what settings does it need?

Run uvx mdev-mysql-mcp-server to start it, which is the command the README recommends for published installs. You must set MYSQL_DATABASE, and you should set MYSQL_HOST, MYSQL_PORT, MYSQL_USER and MYSQL_PASSWORD to match your connection, since the server needs Python 3.11 or newer and MySQL 5.7 or 8.0.

Is the MySQL MCP Server safe to point at a production database?

The README says the read query tool is only a guardrail and not a substitute for database permissions, so it recommends a dedicated read-only MySQL user for exploration. It also warns that the write and DDL tools can modify or destroy data, so they should stay on manual approval in your MCP client.

Where does the MySQL MCP Server rank in the Databases category?

On Claude Marketplaces it sits in the top 50 of the Databases category. Other servers listed alongside it there include Dbx, MCP Toolbox for Databases, DBHub, Postgres MCP Pro and Supabase, and it stands out by focusing on MySQL inspection and bounded read queries.

Similar to MySQL MCP Server

More Databases