mysql_get_tablesLABSCO SUMMARY
Read-only by construction.
Three tools and no write path is the whole design: the model discovers tables, reads columns and runs SELECTs, so a badly framed question produces a wrong answer rather than a changed record. Two things decide whether it fits. The CData JDBC driver is a separate licensed product, with a trial key to start on. And the assistant can query every table the connection can see — the Tables field in the connection profile does not narrow that, so limit the connection or the account it signs in with.
What it is
A read-only MCP server built on CData's JDBC Driver for MySQL. The driver exposes MySQL as relational tables; the server puts three tools over it, so a client can discover what tables exist, read a table's columns, and run a SELECT — without anyone writing SQL by hand.
What you get
- The tables the driver exposes for MySQL, returned as CSV with a header row —
mysql_get_tables - The columns of one of those tables, also as CSV, so a query can be composed against real field names —
mysql_get_columns - A SQL SELECT executed against live MySQL data —
mysql_run_query - Tool names that carry the prefix you set in the connection profile — the sample uses
Prefix=mysql— so several CData servers can run side by side without colliding - A
Tablessetting that only picks which tables also get a ready-made description (blank means none); it does not limit what the tools can list or query, so limit the connection or the account it signs in with
Requirements
Java and Maven to build — mvn clean install produces CDataMCP-jar-with-dependencies.jar. The CData JDBC Driver for MySQL is a separate download and needs licensing: run java -jar cdata.jdbc.mysql.jar --license and enter a name, an email and either TRIAL or a licence key. Connection settings go in a .prp file carrying Prefix, ServerName (the sample uses CDataMySQL), ServerVersion, DriverPath, DriverClass (cdata.jdbc.mysql.MySQLDriver), the JdbcUrl produced by the driver's connection-string utility, and the optional Tables list. The client then launches java -jar CDataMCP-jar-with-dependencies.jar mysql.prp. Transport is stdio, so the server has to run on the same machine as the client. If the data source authenticates over OAuth, you approve it in a browser while building the connection string.
Setup effort
Build from source — clone the repository, then point your client at the binary
USE CASES
Querying MySQL from a conversation
The client lists tables, reads the columns it needs and writes the SELECT itself, with no SQL typed by the person asking.
Mapping a database before you report on it
Enumerate tables and columns to understand what an unfamiliar MySQL schema holds.
Handing an assistant read-only access
There is no write path in the server, so the worst outcome of a badly framed question is a wrong answer, not a changed row.
Restricting scope to a few tables
Declare the table list in the connection profile so the model never sees the rest of the database.
3 tools
Listed in project docs. Your client may show a different list.
mysql_get_columnsmysql_run_queryBEFORE YOU INSTALL
What to know first
Tools you get
3 tools named in the project's documentation. All three are read-only: mysql_run_query runs SQL SELECT only, and write access is a separate paid CData product. Names carry the prefix you configure (mysql_get_tables with Prefix=mysql). The Tables setting does not limit what the tools reach; your connection's access does.
Where it runs
Both documented setups run the server on your machine.
INSTALLATION
Connect your client
Clone the repository, then point your client at the binary. This one is built from source rather than installed with a single command.
Server setup
git clone https://github.com/cdatasoftware/mysql-mcp-server-by-cdata.git
cd mysql-mcp-server-by-cdata
mvn clean installDownload and install the CData JDBC Driver for MySQL from https://www.cdata.com/drivers/mysql/download/jdbc
License the driver: from the driver install's lib folder run java -jar cdata.jdbc.mysql.jar --license, then enter your name, email, and "TRIAL" (or your license key)
Build the connection string: run java -jar cdata.jdbc.mysql.jar to open the Connection String utility, click "Test Connection" (browser OAuth if the source needs it), and copy the connection string
Create mysql.prp with:
Prefix=mysql
ServerName=CDataMySQL
ServerVersion=1.0
DriverPath=<YOUR_DRIVER_PATH>
DriverClass=cdata.jdbc.mysql.MySQLDriver
JdbcUrl=<YOUR_JDBC_URL>
Tables=Tables only picks which tables also get a ready-made description for your assistant, and empty means none; the server can still list and query every table your connection string reaches, so to keep data out of reach, limit that connection or the account it signs in with.
Add the mcpServers entry (block below) to claude_desktop_config.json, then fully quit and re-open the client
MCP Clients
Claude Desktop — macOS or Linux, Windows
{
"mcpServers": {
"mysql": {
"command": "<YOUR_PATH_TO_JAVA>",
"args": [
"-jar",
"<YOUR_PATH_TO_CDATA_MCP_JAR_WITH>",
"<YOUR_PATH_TO_MYSQL>"
]
}
}
}