Cover image
Try Now
2025-04-06

这是一个基于春季启动的sql服务应用,用于执行sql spring spring ai mcp(型号,聊天,提示),提供了,提供了sql查询和更新操作的功能。

3 years

Works with Finder

1

Github Watches

0

Github Forks

2

Github Stars

mcp-server-Sql

项目介绍

这是一个基于Spring Boot的SQL服务应用,用于执行SQL查询并将结果写入文件。该服务作为Spring AI MCP(Model, Chat, Prompt)框架的一部分,提供了SQL查询和更新操作的功能。

功能特性

  • 执行SQL查询并将结果写入CSV文件
  • 执行SQL更新操作(INSERT, UPDATE, DELETE)并返回影响的行数
  • 支持自定义数据库连接配置
  • 集成Spring AI MCP框架,可作为AI工具使用

技术栈

  • Java 17
  • Spring Boot 3.4.3
  • Spring AI 1.0.0-M6
  • MySQL 8.0
  • HikariCP 连接池
  • Lombok

快速开始

配置数据库

application.yml文件中配置您的数据库连接信息:

spring:
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://localhost:3306/your_database?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
    username: your_username
    password: your_password

构建项目

mvn clean package

运行应用

java -jar target/mcp-server-Sql-1.0-SNAPSHOT.jar

使用示例

执行SQL查询

{
  "sql": "SELECT * FROM users",
  "outputPath": "./output/users.csv"
}

执行SQL更新操作

{
  "sql": "UPDATE users SET name='John' WHERE id=1",
  "outputPath": "./output/update_result.txt"
}

注意事项

  • 确保输出目录存在或有权限创建
  • SQL查询结果将以CSV格式保存
  • 更新操作结果将包含影响的行数和执行时间

相关推荐

  • 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.

  • 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.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

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

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • https://zenepic.net
  • Embark on a thrilling diplomatic quest across a galaxy on the brink of war. Navigate complex politics and alien cultures to forge peace and avert catastrophe in this immersive interstellar adventure.

  • https://reddgr.com
  • Delivers concise Python code and interprets non-English comments

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

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

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

  • pontusab
  • 光标与风浪冲浪社区,查找规则和MCP

  • av
  • 毫不费力地使用一个命令运行LLM后端,API,前端和服务。

  • 1Panel-dev
  • 🔥1Panel提供了直观的Web接口和MCP服务器,用于在Linux服务器上管理网站,文件,容器,数据库和LLMS。

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

  • ravitemer
  • 一个功能强大的Neovim插件,用于管理MCP(模型上下文协议)服务器

  • Mintplex-Labs
  • 带有内置抹布,AI代理,无代理构建器,MCP兼容性等的多合一桌面和Docker AI应用程序。

  • GeyserMC
  • 与Minecraft客户端/服务器通信的库。

  • patruff
  • Ollama和MCP服务器之间的桥梁,使本地LLMS可以使用模型上下文协议工具

    Reviews

    3 (1)
    Avatar
    user_EK122UwQ
    2025-04-17

    I've been using mcp-server-sql by cherry-SC, and it has significantly improved my database management tasks. The setup is straightforward, and the robust features have streamlined my projects. The open-source nature allows flexibility for customization, making it a reliable tool for any SQL server needs. Highly recommended!