mysql
mysql-mcp-server. java version
claude mcp add --transport stdio jasondeepny-mysql-mcp-server java -Dspring.datasource.url= * -Dspring.datasource.username= * -Dspring.datasource.password= * -jar /absolute/path/mysql-mcp-server-0.0.1-SNAPSHOT.jar
How to use
Mysql-Mcp-Server is a Java-based MCP server designed to expose a MySQL data source as a centralized MCP endpoint. It supports multiple data sources and provides STDIO-based interaction through standard Spring Boot tooling. The server is packaged as a Spring Boot application and can be started via the Java command specified in the mcp_config, using runtime-configurable JDBC URL, username, and password. Once running, you can leverage the server for managing and querying MySQL connections in an MCP workflow, enabling standardized access across MCP clients.
To use the server, configure your connection properties (URL, username, password) either directly on the command line or via environment/config management that substitutes the -Dspring.datasource.* properties. The server is designed to run as a spring-boot Jar, so standard Spring Boot logging, health checks, and lifecycle hooks are available. Ensure the jar path points to the correct build artifact (e.g., mysql-mcp-server-0.0.1-SNAPSHOT.jar) and that the JDBC URL points to your MySQL instance with appropriate credentials.
How to install
Prerequisites:
- Java Development Kit (JDK 11 or newer)
- Maven Wrapper (mvnw) included in the project or Maven installed
- Access to a running MySQL instance
Installation steps:
- Clone the repository or download the built artifact bundle.
- Build the project (if you have source):
# If using Maven Wrapper (recommended)
./mvnw clean package -Dmaven.test.skip=true
# Or with Maven installed
mvn clean package -Dmaven.test.skip=true
- Locate the generated JAR (e.g., mysql-mcp-server-0.0.1-SNAPSHOT.jar) in the target or build output directory.
- Run the MCP server with your data source configuration:
java \
-Dspring.datasource.url=jdbc:mysql://HOST:PORT/DATABASE_NAME \
-Dspring.datasource.username=YOUR_USERNAME \
-Dspring.datasource.password=YOUR_PASSWORD \
-jar /absolute/path/mysql-mcp-server-0.0.1-SNAPSHOT.jar
- Verify the server starts and is reachable (check logs or health endpoint if available).
Additional notes
Tips and considerations:
- Replace the placeholder values for the JDBC URL, username, and password with your actual MySQL credentials.
- Ensure the MySQL server allows connections from the MCP host (network ACLs, user privileges).
- The provided configuration assumes a single data source; to support multiple sources, extend the mcp_config with additional entries under mcpServers.
- If you store credentials in environment variables or a secrets manager, adapt the runtime command to substitute those values at startup.
- Common issues include classpath problems or mismatched JDBC driver versions; ensure the jar contains the correct driver dependency for your MySQL version.