mysql_queryLABSCO SUMMARY
The database user is your only access control.
mysql_query executes what it is given, so the boundary is entirely the credentials you put in the config — grant SELECT only and this is a safe question-answering tool, grant more and it is a shell into your data. The pairing with schema discovery is what makes it work in practice: the model reads the table structure first, so the SQL it writes matches your columns rather than its assumptions.
What it is
A minimal MySQL bridge for assistants. It gives the model the three things it needs to answer a database question on its own: what tables exist, what shape one of them is, and the result of a query. Connection details come from environment variables in your client config.
What you get
mysql_list_tableslists every table in the configured databasemysql_describe_tablereturns the schema for a named tablemysql_queryexecutes any SQL statement you pass it- Error handling that reports database failures back rather than dropping the call
Requirements
Node.js v14 or higher and a reachable MySQL instance. Clone, npm install, and point your client at the server file with MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE and MYSQL_PORT in the env block — the port defaults to 3306. Queries run with the permissions of the user in that config, and mysql_query accepts any SQL, so a read-only account is the difference between a lookup tool and a write handle.
Setup effort
Build from source — git clone https://github.com/dkabx/mcp-mysql-server.git
USE CASES
Answering a question about your data without writing SQL
Let the model list the tables, read the schema and compose the query.
Checking a schema while you write code against it
Describe the table and get columns and types back in place.
Debugging what is actually in a row
Run the exact SELECT you need and read the result back.
Getting oriented in an inherited database
List everything, then describe the tables that look relevant.
3 tools
Listed in project docs. Your client may show a different list.
mysql_describe_tablemysql_list_tablesBEFORE YOU INSTALL
What to know first
Tools you get
3 tools named in the project's documentation.
Requires
- Node.js
- MYSQL_PASSWORD in your environment
- MYSQL_USER in your environment
- MYSQL_HOST in your environment
- MYSQL_DATABASE in your environment
Where it runs
The documented client runs the server on your machine.
INSTALLATION
Connect your client
You clone this one yourself.
Server setup
git clone https://github.com/dkabx/mcp-mysql-server.git
cd mcp-mysql-server
npm installMCP Clients
Cursor
{
"mcpServers": {
"mysql-mcp": {
"label": "MySQL MCP",
"command": "node",
"args": [
"<YOUR_PATH_TO_MCP_MYSQL_SERVER>/mysql-mcp-server.js"
],
"env": {
"MYSQL_HOST": "<YOUR_MYSQL_HOST>",
"MYSQL_USER": "<YOUR_MYSQL_USER>",
"MYSQL_PASSWORD": "<YOUR_MYSQL_PASSWORD>",
"MYSQL_DATABASE": "<YOUR_MYSQL_DATABASE>",
"MYSQL_PORT": "3306"
}
}
}
}