musaddiq-dev avatar

MySQL MCP Server

musaddiq-dev/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 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)

Sponsors

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

More from musaddiq-dev

Related Databases MCP servers

View all
1tthanh2k6 avatarSupabase Rls Checktthanh2k6/supabase-rls-checkRead-only Supabase RLS checks: explain rules, analyze/diff SQL exports, scan public env vars.0stars
2crystaldba avatarPostgres MCP Procrystaldba/postgres-mcpPostgres MCP Pro provides configurable read/write access and performance analysis for you and your AI agents.2.8Kstars
3designcomputer avatarMySQLdesigncomputer/mysql_mcp_serverA Model Context Protocol (MCP) server that enables secure interaction with MySQL databases1.3Kstars
4clickhouse avatarClickHouseclickhouse/mcp-clickhouseOfficial ClickHouse MCP server for querying and exploring ClickHouse clusters and chDB.903stars
5alexander-zuev avatarSupabasealexander-zuev/supabase-mcp-serverQuery MCP enables end-to-end management of Supabase via chat interface: read & write query executions, management API support, automatic migration versioning, a821stars
6timescale avatarTiger MCPtimescale/tiger-cliProvides programmatic access to Tiger Cloud services, databases, and documentation.127stars