
MySQL MCP Server
Connects Claude to MySQL databases over a read-only connection by default, exposing tools to list tables, describe schemas, run SELECT queries with row limits, and fetch execution plans. The safety model blocks common write patterns and caps results, but optional write and DDL tools are available if you configure elevated privileges and manual approval. Built for schema exploration and safe querying during development. You configure it with standard MySQL connection parameters and a read-only user, then call tools like mysql_describe_table or mysql_execute_read_query from any MCP client. Requires Python 3.11+ and MySQL 5.7 or newer. Install with uvx mdev-mysql-mcp-server and pass credentials through environment variables in your client config.
- tools
- 4
- auth
- Secret needed
- transport
- STDIO
- env vars
- 8
- last updated
- May 23, 2026
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
databasestringquerystringSponsors
Configuration
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