LABSCO SUMMARY
Multiple databases behind one server, with a guard rail on what the model is allowed to execute.
Two things separate this from the usual 'run SQL' server. The datasource list means the same connection does not have to be re-pointed when you move between environments — the model picks the database as part of the request. And the SQL safety policy is configurable rather than assumed, which is what makes handing an agent a write-capable connection defensible. If you need a database other than MySQL, the author points at a sibling project instead.
What it is
A Spring AI server that executes SQL against MySQL, holding several datasources at once and switching between them at runtime.
What you get
- Arbitrary SQL executed against a configured MySQL database
- Several datasources defined side by side in datasource.yml, one marked as the default
- Runtime switching between them, so one server covers development and staging without a restart
- SQL safety controls that stop a model from running destructive statements
- Groovy scripts as an extension point when you want behaviour beyond plain SQL
Requirements
JDK 21 or higher and Maven 3.6 or higher. Connections are declared in datasource.yml as JDBC URLs with a username and password — there is no separate account to create. Launched either through the Maven wrapper or from a built jar; the -Dloader.path argument is only needed if you use the Groovy extensions. Documentation is primarily in Chinese, with an English README alongside it.
Setup effort
Build from source — git clone https://github.com/JamesSmith888/mcp-mysql-server.git
USE CASES
Answering a question that needs a query you have not written yet
Ask in plain language, let the model write the SQL, and read the rows back in the same conversation.
Comparing the same query across environments
Switch datasource at runtime and run it again, rather than editing a connection string between attempts.
Letting an agent touch a database without holding your breath
Configure the SQL safety policy first, so the statements you do not want executed are refused rather than trusted.
Adding behaviour the plain SQL path does not cover
Drop a Groovy script into the extensions directory and point the server at it with the loader path argument.
BEFORE YOU INSTALL
What to know first
Requires
- JDK 21+
- Maven 3.6+
Where it runs
Both documented setups run the server on your machine.
INSTALLATION
Connect your client
Server setup
git clone https://github.com/JamesSmith888/mcp-mysql-server.git
cd mcp-mysql-serverEdit src/main/resources/datasource.yml: under datasource.datasources, add each MySQL database with its url, username and password, and mark one default: true
./mvnw clean packageMCP Clients
Any MCP client — Maven
{
"mcpServers": {
"mcp-mysql-server": {
"command": "<YOUR_PATH_TO_MCP_MYSQL_SERVER>/mvnw",
"args": [
"-q",
"-f",
"<YOUR_PATH_TO_MCP_MYSQL_SERVER>/pom.xml",
"spring-boot:run"
]
}
}
}<YOUR_PATH_TO_MCP_MYSQL_SERVER> is the absolute path to your clone.
Any MCP client — jar
{
"mcpServers": {
"mcp-mysql-server": {
"command": "java",
"args": [
"-Dloader.path=<YOUR_PATH_TO_MCP_MYSQL_SERVER>/src/main/resources/groovy",
"-jar",
"<YOUR_PATH_TO_MCP_MYSQL_SERVER>/target/mcp-mysql-server-0.0.1-SNAPSHOT.jar"
]
}
}
}<YOUR_PATH_TO_MCP_MYSQL_SERVER> is the absolute path to your clone. The -Dloader.path argument is optional; it is only needed for the Groovy extensions.