queryLABSCO SUMMARY
The MySQL user's grants are the whole security model.
Nothing in the server distinguishes a SELECT from a DROP, which means the safety decision happens when you create the account you put in MYSQL_PASSWORD. Give it read-only grants on one schema and this is a fine way to let a model answer questions about your data; give it your application user and it inherits everything that user can do.
What it is
A minimal TypeScript server with a single tool: hand it a SQL string, get the results back. The database is fixed by environment variables at launch, so the connection is not something a call can change. It is small enough to read in a sitting, which makes it a reasonable starting point for a server you want to extend.
What you get
queryexecutes a SQL query and returns the results- The SQL string is the only required parameter
- Connection details fixed at launch, so every call runs against the same database
Requirements
Four environment variables in your client config: MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD and MYSQL_DATABASE. Run npm install and npm run build, then point your client at the built index.js. Package mysql-server, version 0.1.0. There is no statement filtering, so whatever the connecting MySQL user is allowed to do, a query can do — the account's grants are the only limit.
Setup effort
Build from source
USE CASES
Answering a question about your data
Ask in plain language and let the client write and run the SELECT.
Checking a schema you have forgotten
Run the information-schema query directly rather than opening a client.
Starting your own database server
Read it end to end as a working minimal example and add the tools you need.
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.
Requires
MYSQL_PASSWORD in your environment
Where it runs
The documented client runs the server on your machine.
INSTALLATION
Connect your client
You clone and build this one yourself.
Server setup
git clone https://github.com/xianzong85/mysql-server-MCP-Server
cd mysql-server-MCP-ServerInstall dependencies
npm installBuild the server
npm run buildMCP Clients
Any MCP client
{
"mcpServers": {
"mysql": {
"command": "node",
"args": [
"<YOUR_PATH_TO_MYSQL_SERVER_MCP_SERVER>/build/mysql-server/index.js"
],
"env": {
"MYSQL_HOST": "<YOUR_MYSQL_HOST>",
"MYSQL_USER": "<YOUR_MYSQL_USER>",
"MYSQL_PASSWORD": "<YOUR_MYSQL_PASSWORD>",
"MYSQL_DATABASE": "<YOUR_MYSQL_DATABASE>"
}
}
}
}