queryLABSCO SUMMARY
Schema as a resource is the detail worth noticing.
Putting the table structure behind resources rather than a tool means a model can read the schema without it counting as a query, which keeps the exploration phase cheap and the query tool focused. The read-only transaction is a real boundary rather than a prompt instruction. The exposure to plan around is the connection string: it holds the password in plain text in the client's configuration, so a read-only MySQL user is the right pairing, not an optional hardening step.
What it is
An MCP server that gives a model read access to a MySQL database. There is one tool, query, and it runs inside a read-only transaction; the schema is exposed separately as resources, so a model can learn the table structure without spending a query on it.
What you get
querytakes asqlstring and executes it inside a READ ONLY transaction- A schema resource per table at
mysql://<host>/<table>/schema, carrying column names and data types as JSON - Schemas are discovered from the database metadata rather than configured by hand
- Authentication travels in the connection URL, in the form
mysql://username:password@host:port/database - Both the query tool and the schema resources authenticate with the same credentials
Requirements
Node.js, and a reachable MySQL server. Clone the repository, run npm run prepare and npm install, then npm link to put mysql-mcp-server on the path. The client launches that command with the connection URL as its only argument. The README recommends giving the connecting MySQL user read-only permissions and keeping the credentials out of a committed config file — the connection string carries the password.
Setup effort
Build from source — git clone https://github.com/shreyansh-ghl/mysql-mcp-server.git
USE CASES
Answering a data question in the editor
Run the SELECT against the live database while you are writing the code that depends on it.
Learning a schema before writing SQL
Read the per-table schema resources so the query is written against real column names.
Giving an assistant safe database context
Read-only transactions plus a read-only user mean a wrong query is a wrong answer, not a changed row.
Checking production data without a client
Query the database from the chat rather than opening a separate SQL tool.
1 tool
Listed in project docs. Your client may show a different list.
BEFORE YOU INSTALL
What to know first
Tools you get
1 tool named in the project's documentation. Table schemas come from a resource, not a tool. The MySQL user and password travel inside the connection URL.
Requires
- Node.js and npm (to build and npm link the clone)
- A reachable MySQL server
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/shreyansh-ghl/mysql-mcp-server.git
cd mysql-mcp-server
npm run prepare
npm install
npm linkMCP Clients
Cursor
{
"mcpServers": {
"mysql": {
"command": "mysql-mcp-server",
"args": [
"mysql://<YOUR_DB_USER>:<YOUR_DB_PASSWORD>@localhost:3306/<YOUR_DB_NAME>"
]
}
}
}The MySQL user and password go inside the connection URL the client passes: mysql://username:password@host:port/database. The README advises a read-only MySQL user and keeping this config out of public places.