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
Own this MCP server? Claim it
What it does
- Lists with
list_databasesandlist_tables, and inspects columns withdescribe_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 toolsPublic 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
databasestringdescribe_tableShow the schema for a specific table2 params
Show the schema for a specific table
databasestringtablestringexecute_queryExecute a read-only SQL query2 params
Execute a read-only SQL query
databasestringquerystringConfiguration
MYSQL_HOSTdefault: localhostMySQL host
MYSQL_PORTdefault: 3306MySQL port
MYSQL_USERdefault: rootMySQL username
MYSQL_PASSWORDsecretMySQL password
MYSQL_DATABASE*MySQL database name
MYSQL_POOL_SIZEdefault: 5MySQL connection pool size
LOG_LEVELdefault: INFOPython logging level
MYSQL_READ_QUERY_LIMITdefault: 1000Maximum 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 TABLEoutput - 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
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 DatabasesMySQLdesigncomputer1.4K starsConnects to MySQL databases for SQL queries, schema inspection, and table sampling.
Dbmcphaymon-ai33 starsRead and write access to MySQL, MariaDB, PostgreSQL, and SQLite databases from one binary.
MCP Alchemy Serverrunekaagaard420 starsRead-only schema and query access to relational databases: SQLite, PostgreSQL, MySQL, and more.
DBHubbytebase4K starsGateway to seven SQL databases: run queries, explore schemas, and check query plans.