connect_databaseLABSCO SUMMARY
One switch decides whether it can change anything.
The server is deliberately thin: connect to a database, send SQL, get JSON back. Read-only mode is set in the configuration before it starts, which makes it the setting to get right before pointing this at anything that matters.
What it is
A thin SQL layer over MySQL, launched as a local process with the host, user, password and an optional starting database in its configuration.
What you get
- connect_database — switches to a named database and confirms the connection
- execute_query — runs SQL and returns results as JSON; several statements can go in one call, separated by semicolons
- A read-only mode set in the configuration, which restricts the server to queries
Requirements
A reachable MySQL server and its credentials, set in the client config along with the optional starting database and the read-only flag. Install from PyPI with uv or pip, or run it with uvx without installing.
Setup effort
One command plus credentials — uv pip install mysqldb-mcp-server, then supply credentials
USE CASES
Answering a question from live data without a client
Connect to the database and run the query in the conversation, rather than switching to a GUI and back.
Getting oriented in a schema you did not write
Ask the database what tables and columns exist before writing anything against them.
Sanity-checking a query before it goes into code
Run it read-only against a real database, so the shape of the result is observed rather than assumed.
2 tools
Listed in project docs. Your client may show a different list.
execute_queryBEFORE YOU INSTALL
What to know first
Tools you get
2 tools named in the project's documentation.
Requires
- uvx on PATH
- MYSQL_USER in your environment
Optional
MYSQL_PASSWORD in your environment
Where it runs
The documented client runs the server on your machine.
INSTALLATION
Connect your client
Server setup
uv pip install mysqldb-mcp-serverMCP Clients
Claude Desktop — uvx
{
"mcpServers": {
"mysqldb-mcp-server": {
"command": "uvx",
"args": [
"mysqldb-mcp-server"
],
"env": {
"MYSQL_HOST": "localhost",
"MYSQL_USER": "root",
"MYSQL_PASSWORD": "password",
"MYSQL_READONLY": "true"
}
}
}
}root and password are sample MySQL credentials, and localhost assumes the server runs on this machine. To start in a particular database, add a MYSQL_DATABASE entry to env with its name; MYSQL_READONLY set to true limits the server to queries.