connect_db
Connect to MySQL database (optional if environment variables are set)
Point an agent at a MySQL database and let it list the tables, read a table's columns and run parameterised SELECT queries — and nothing else.
LABSCO SUMMARY
There is no insert, update or schema-change call in the tool set — query is described as a SELECT, and the rest is inventory and structure. Values travel in params next to the sql string rather than inside it. connect_db makes the target switchable at run time, so one server can be pointed at a different host or database mid-session instead of being restarted with new environment variables.
A MySQL server whose tool set stops at reading: connect, list, describe and SELECT.
A reachable MySQL database, with MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE and MYSQL_PORT in the environment; connect_db takes the same values as arguments when they are not set.
One command plus credentials — npx @malove86/mcp-mysql-server, then supply credentials
USE CASES
List what tables exist, then read the columns of the two or three that look like they hold the answer.
Run the SELECT with its values bound through params instead of pasted into the statement.
Supply host, user, password, database and port on the call when the environment is set for somewhere else.
Counted once with only startup setup. Other versions, modes or optional credentials may expose a different list.
connect_dbConnect to MySQL database (optional if environment variables are set)
describe_tableGet table structure
list_tablesList all tables in the database
queryExecute a SELECT query
BEFORE YOU INSTALL
4 tools when we connected. From 0.2.2 the server connects automatically when its environment variables are set, so connect_db is optional; the query tool runs SELECT statements only.
The documented client runs the server on your machine.
CONTEXT COST
Rated by the size of the 4 tool definitions that ride along on every turn, not by how many there are
INSTALLATION
npx @malove86/mcp-mysql-server{
"mcpServers": {
"mysql": {
"command": "npx",
"args": [
"-y",
"@malove86/mcp-mysql-server"
],
"env": {
"MYSQL_HOST": "<YOUR_MYSQL_HOST>",
"MYSQL_USER": "<YOUR_MYSQL_USER>",
"MYSQL_PASSWORD": "<YOUR_MYSQL_PASSWORD>",
"MYSQL_DATABASE": "<YOUR_MYSQL_DATABASE>",
"MYSQL_PORT": "3306"
}
}
}
}