mcp-server-Sql

mcp-server-Sql

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

cherry-SC

Developer Tools
Visit Server

README

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格式保存
  • 更新操作结果将包含影响的行数和执行时间

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
MCP Package Docs Server

MCP Package Docs Server

Facilitates LLMs to efficiently access and fetch structured documentation for packages in Go, Python, and NPM, enhancing software development with multi-language support and performance optimization.

Featured
Local
TypeScript
Claude Code MCP

Claude Code MCP

An implementation of Claude Code as a Model Context Protocol server that enables using Claude's software engineering capabilities (code generation, editing, reviewing, and file operations) through the standardized MCP interface.

Featured
Local
JavaScript
@kazuph/mcp-taskmanager

@kazuph/mcp-taskmanager

Model Context Protocol server for Task Management. This allows Claude Desktop (or any MCP client) to manage and execute tasks in a queue-based system.

Featured
Local
JavaScript
Linear MCP Server

Linear MCP Server

Enables interaction with Linear's API for managing issues, teams, and projects programmatically through the Model Context Protocol.

Featured
JavaScript
mermaid-mcp-server

mermaid-mcp-server

A Model Context Protocol (MCP) server that converts Mermaid diagrams to PNG images.

Featured
JavaScript
Jira-Context-MCP

Jira-Context-MCP

MCP server to provide Jira Tickets information to AI coding agents like Cursor

Featured
TypeScript
Linear MCP Server

Linear MCP Server

A Model Context Protocol server that integrates with Linear's issue tracking system, allowing LLMs to create, update, search, and comment on Linear issues through natural language interactions.

Featured
JavaScript
Sequential Thinking MCP Server

Sequential Thinking MCP Server

This server facilitates structured problem-solving by breaking down complex issues into sequential steps, supporting revisions, and enabling multiple solution paths through full MCP integration.

Featured
Python