
MySQL MCP Server
io.github.musaddiq-devPublished by GitHub account musaddiq-devv0.1.2Updated Nov 3, 2026
Python MCP server for MySQL database inspection and querying
Overview
Local Python MCP server that lets an assistant inspect and query a MySQL database: list tables, read schemas, run bounded SELECTs and explain plans.
- What you can do
- List tables and describe table schemas
- Run single bounded SELECT queries with keyword and row-limit guardrails
- Retrieve SHOW CREATE TABLE output and EXPLAIN plans
- Summarize tables and row counts
- Optionally run INSERT, UPDATE, DELETE and DDL statements when write tools are enabled
- When to use it
- Useful when an assistant needs to explore or query a MySQL database from an MCP client such as Claude Desktop, Cursor or VS Code, for schema discovery, ad-hoc read queries or query-plan review. Add it only if you can point it at a database and, ideally, a read-only user.
- Requirements
- Runs locally over stdio via uvx (package mdev-mysql-mcp-server) or from source; needs Python 3.11+ and MySQL 5.7+/8.0+. Configure MYSQL_DATABASE (required) plus MYSQL_HOST, MYSQL_PORT, MYSQL_USER, MYSQL_PASSWORD, MYSQL_POOL_SIZE, MYSQL_READ_QUERY_LIMIT and LOG_LEVEL. Network access to the MySQL host is required.
Installation
In SourceWeft
- Open MySQL MCP Server in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
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
- Python 3.11+
- MySQL 5.7+ or MySQL 8.0+
- MCP-compatible client such as Claude Desktop, Cursor, VS Code, or another MCP host
Installation
When published to PyPI, install or run the server like a standard Python MCP package:
For local development from source:
Configuration
Copy the example environment file and update it with your database connection details.
Example read-only user:
Running
From a local checkout before PyPI publication, run:
MCP Client Configuration
For published installs, prefer uvx. MCP servers using stdio must write protocol messages only to stdout; this server writes logs to stderr through Python logging.
Claude Desktop / Cursor / Windsurf / Cline
Most MCP clients accept this mcpServers JSON shape:
For local development from this repository, use the installed console script path instead:
Claude Code CLI
VS Code MCP
VS Code uses the same command/args/env model in its MCP configuration:
Tools
Smoke Check
Without a database, verify syntax with:
With a configured database, start the server and use your MCP client to call list_tables.
Distribution
This server is published through the standard Python MCP distribution path:
- PyPI package:
mdev-mysql-mcp-server - MCP Registry name:
io.github.musaddiq-dev/mysql-mcp-server - Runtime hint:
uvx - Transport:
stdio
The mcp-name marker at the top of this README is required for MCP Registry ownership verification. Users should prefer uvx mdev-mysql-mcp-server in local MCP client configurations.
Security Notes
- Do not commit
.envor MCP client configs containing credentials. - Use least-privilege database users.
- Keep
execute_write_queryandexecute_ddlon explicit manual approval. - Do not expose this server over an untrusted network without additional authentication and transport security.
License
MIT
Source: README.md at commit be66e02
Tools
0Version history
1- v0.1.2LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts