mcpField
S
Spring Boot MySQL Project

Spring Boot MySQL Project

Local
github.com/angelo848Databases0Updated 79w ago

About Spring Boot MySQL Project

Spring Boot MySQL Project is a Java application configured to use MySQL with HikariCP. It can run as an MCP server over stdio for clients that need database access.

Key features

  1. 01Spring Boot and MySQL setup
  2. 02HikariCP connection pooling
  3. 03Hibernate schema updates
  4. 04stdio server configuration

Use cases

  1. 01Connecting an MCP client to MySQL
  2. 02Running the application with Maven or a JAR
  3. 03Testing and debugging with MCP Inspector

MCP support

The project runs as an MCP server over stdio and can be configured in MCP clients. The README provides an MCP Inspector command for testing and debugging.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

Spring Boot MySQL Project

This is a Spring Boot project configured with MySQL and HikariCP connection pool.

Prerequisites

  • Java 17 or later
  • Maven 3.6 or later
  • MySQL 8.0 or later

Setup

  1. Create a MySQL database named demo:
CREATE DATABASE demo;
  1. Update the database credentials in src/main/resources/application.properties if they differ from the defaults:
  • username: root
  • password: root

Running the Application

  1. Build the project:
mvn clean install
  1. Run the application:
mvn spring-boot:run

OR

java -jar path/to/jar/java-mysql-mcp-0.0.1-SNAPSHOT.jar

The application will start on http://localhost:8080

Configuration

The application uses the following main configurations:

  • Server port: 8080
  • HikariCP connection pool size: 10
  • Hibernate ddl-auto: update (automatically updates database schema)

You can modify these settings in src/main/resources/application.properties

spring.main.web-application-type: none is mandatory for connect to server via stdio, otherwise this error will be thrown:

2025-03-25T09:21:30.352-03:00  WARN 25352 --- [main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Failed to start bean 'webServerStartStop'

Usage on MCP clients

db.hostenv value is the host and port of the database server, for example: host:port, eg: localhost:3306

{
  "mcpServers": {
    "blue-hero-database": {
      "command": "java",
      "args": [
        "-Dspring.ai.mcp.server.stdio=true",
        "-Dserver.port=8080",
        "-Ddb.hostenv=host:port",
        "-Ddb.schema=/demo",
        "-Ddb.user=username",
        "-Ddb.passwordenv=password",
        "-jar",
        "/path/to/java-mysql-mcp/target/java-mysql-mcp-0.0.1-SNAPSHOT.jar"
      ]
    }
  }
}
Debug

You can use the mcp inspector for testing and debugging with the following command:

npx @modelcontextprotocol/inspector java -Dspring.ai.mcp.server.stdio=true -jar /path/to/project/target/java-mysql-mcp-0.0.1-SNAPSHOT.jar

The logs output will be created in ./mcp-mysql-stdio-server.log

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.