describe_table
Show the schema for a specific table
Get oriented in an unfamiliar MySQL schema and answer questions from it with read-only SQL, without opening a client.
LABSCO SUMMARY
Three calls take you from "which databases are here" to "what columns does this table have", which is exactly the path a query against unfamiliar data starts down. execute_query is stated as read-only, so this server is not the thing that writes to your database — but list_databases and the per-call database parameter mean its reach is whatever the MySQL user was granted, and that narrowing belongs in the grant rather than here.
Four read tools over a MySQL connection: the databases it can see, the tables inside one, a table's schema, and a read-only query.
A reachable MySQL server and five environment variables that address it: MYSQL_HOST, MYSQL_PORT, MYSQL_USER, MYSQL_PASSWORD and MYSQL_DATABASE.
One command plus credentials — npm install -g mysql-mcp-server, then supply credentials
USE CASES
Three calls take you from which databases the connection reaches, to which tables sit in one, to what columns a table actually has.
Run the query where the question was asked and get the rows back inline, rather than switching to a client and pasting the result.
Read the schema first so column names and types are copied rather than guessed, then run the query — the loop that usually costs two failed attempts.
Counted once with only startup setup. Other versions, modes or optional credentials may expose a different list.
describe_tableShow the schema for a specific table
execute_queryExecute a read-only SQL query
list_databasesList all accessible databases on the MySQL server
list_tablesList all tables in a specified database
BEFORE YOU INSTALL
4 tools when we connected. execute_query accepts only SELECT, SHOW, DESCRIBE and EXPLAIN, so INSERT, UPDATE, DELETE and schema changes are blocked even if your MySQL user allows them.
CONTEXT COST
Rated by the size of the 4 tool definitions that ride along on every turn, not by how many there are
INSTALLATION
npm install -g mysql-mcp-servernpx -y @smithery/cli install @dpflucas/mysql-mcp-server --client claude{
"mcpServers": {
"mysql": {
"command": "npx",
"args": [
"mysql-mcp-server"
],
"env": {
"MYSQL_HOST": "<YOUR_MYSQL_HOST>",
"MYSQL_PORT": "3306",
"MYSQL_USER": "<YOUR_MYSQL_USER>",
"MYSQL_PASSWORD": "<YOUR_MYSQL_PASSWORD>",
"MYSQL_DATABASE": "<YOUR_MYSQL_DATABASE>"
},
"disabled": false,
"autoApprove": []
}
}
}Clone the repository, install dependencies and build:
git clone https://github.com/dpflucas/mysql-mcp-server.git && cd mysql-mcp-server && npm install && npm run buildAdd this to your client config; <YOUR_PATH_TO_MYSQL_MCP_SERVER> is the full path of your clone:
{
"mcpServers": {
"mysql": {
"command": "node",
"args": [
"<YOUR_PATH_TO_MYSQL_MCP_SERVER>/build/index.js"
],
"env": {
"MYSQL_HOST": "<YOUR_MYSQL_HOST>",
"MYSQL_PORT": "3306",
"MYSQL_USER": "<YOUR_MYSQL_USER>",
"MYSQL_PASSWORD": "<YOUR_MYSQL_PASSWORD>",
"MYSQL_DATABASE": "<YOUR_MYSQL_DATABASE>"
},
"disabled": false,
"autoApprove": []
}
}
}