health_checkLABSCO SUMMARY
Schema, indexes and plan — the three things a slow query needs.
Running SQL alone leaves an assistant guessing about why something is slow. Having the index list and the EXPLAIN plan alongside the schema means an answer about performance can point at a missing index instead of speculating. Running it as its own local server keeps the database credentials out of your client's configuration.
What it is
A MySQL access server you run from a clone with Poetry, beside your database. The client connects to it over a local HTTP endpoint, and the database credentials stay in the server's .env file.
What you get
- Every table in the connected database, listed
- A table's schema read back
- Arbitrary SQL executed
- The indexes on a table
- The EXPLAIN plan for a query
- A health check, for confirming the connection before anything depends on it
Requirements
A reachable MySQL database, with its host, port, user, password and database name in the server's .env file. Python 3.12 or later and Poetry.
Setup effort
Build from source — git clone https://github.com/lclpedro/mcp-mysql.git
USE CASES
Getting oriented in a database you did not build
List the tables and read the schemas that matter, so an assistant writes SQL against your real columns rather than plausible ones.
Answering a data question without writing SQL
Ask in words, let it compose and run the statement, and read the rows back in the same exchange.
Working out why a query is slow
Read the EXPLAIN plan and the table's indexes together — a full scan next to a missing index is usually the whole answer.
Deciding whether an index is worth adding
Check what already exists on the table before proposing another, and compare the plan before and after the change.
Confirming the connection before you trust an answer
Run the health check when results look wrong — it separates a broken connection from a query that is genuinely returning nothing.
6 tools
Listed in project docs. Your client may show a different list.
list_tablesget_table_schemaexecute_queryshow_indexes_tableshow_explain_queryBEFORE YOU INSTALL
What to know first
Tools you get
6 tools named in the project's documentation.
Requires
- Python 3.12+ and Poetry
- A reachable MySQL database
- MYSQL_DATABASE_PASSWORD in your environment
Where it runs
The documented client runs the server on your machine.
INSTALLATION
Connect your client
This one is built from source rather than installed with a single command.
Server setup
git clone https://github.com/lclpedro/mcp-mysql.git
cd mcp-mysql
cp .env.example .envEdit .env so MYSQL_DATABASE_HOST, MYSQL_DATABASE_PORT, MYSQL_DATABASE_USER, MYSQL_DATABASE_PASSWORD and MYSQL_DATABASE_NAME point at your own database
poetry install
poetry run python main.pyThe server then listens on http://localhost:3002/sse. Configure it in your IDE with the block below, then load MCPs in the IDE
MCP Clients
Any MCP client
{
"mcpServers": {
"mysqlManaging": {
"url": "http://localhost:3002/sse"
}
}
}