Cover image
Try Now
2025-03-30

3 years

Works with Finder

1

Github Watches

0

Github Forks

0

Github Stars

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

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Bora Yalcin
  • Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Lists Tailwind CSS classes in monospaced font

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • Yasir Eryilmaz
  • AI scriptwriting assistant for short, engaging video content.

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • huahuayu
  • 统一的API网关,用于将多个Etherscan样区块链Explorer API与对AI助手的模型上下文协议(MCP)支持。

  • deemkeen
  • 用电源组合控制您的MBOT2:MQTT+MCP+LLM

  • jae-jae
  • MCP服务器使用剧作《无头浏览器》获取网页内容。

    Reviews

    3 (1)
    Avatar
    user_wxibgRr7
    2025-04-15

    Fetcher MCP by jae-jae is an incredibly useful tool for anyone seeking an efficient and reliable data fetching experience. The interface is user-friendly and the performance is impressive. Easily integrates with various platforms and ensures data accuracy, making it a must-have for developers. Highly recommended! Check it out here: https://mcp.so/server/fetcher-mcp/jae-jae