MCP MySQL Server

by jamessmith888

MCP MySQL Server 是基于 Spring AI 的 MCP,可以执行任意 SQL。它需要外部数据源配置文件,通常是 YAML 格式的文件,例如 'src/main/resources/datasource.yml',可以通过环境变量或命令行参数进行自定义。

Developer toolsstdioCommunity

Repository-wide counts · Cached 2026-03-08

Overview

The MCP MySQL Server MCP server is a publicly available project. Review the upstream repository for installation instructions, supported tools, compatibility, permissions, and current maintenance status.

Configuration

Configuration, transport, authentication, and runtime requirements vary by project. Open the repository before connecting and use the smallest set of credentials and permissions required.

Open the MCP MySQL Server repository to read the latest documentation.

KEEP EXPLORING

Compare source, connection, and authentication details before choosing an implementation.

View the complete category

模型上下文协议服务器

modelcontextprotocol

Community

一组用于模型上下文协议(MCP)的参考实现,展示了对大型语言模型(LLM)工具和数据源的安全且受控的访问方式。

Context7 Platform - Up-to-date Code Docs For Any Prompt

upstash

Community

Context7 MCP server providing up-to-date, version-specific documentation and code examples for libraries, enabling coding agents to fetch accurate docs and code snippets. Requires an API key for higher rate limits, passed via CONTEXT7_API_KEY header.

Playwright MCP

Microsoft Corporation

Community

A Model Context Protocol (MCP) server that provides browser automation capabilities using Playwright. Enables LLMs to interact with web pages through structured accessibility snapshots, bypassing the need for screenshots or visually-tuned models.

AIHawk

feder-cr

Community

AIHawk is an anti detect browser and web browsing agent, open source, with an MCP server for coding agents: undetected, no captchas, no blocks. It requires an OpenRouter API key for the standalone web UI mode, which can be provided via the --openrouter-key flag or the OPENROUTER_API_KEY environment variable or a .env file in the running directory.

FROM THE SOURCE

Repository README

Build-time snapshot · Retrieved 2026-10-05

View original

MCP MySQL Server

一个基于 Spring AI 的MCP,可执行任意 SQL。

关于其他数据库支持,请查看 mcp-db-server

中文文档 | English Documentation

快速上手

1. MCP JSON 配置

方式一:Maven Wrapper 启动
{
  "mcpServers": {
    "mcp-mysql-server": {
      "command": "/Users/xin.y/IdeaProjects/mcp-mysql-server/mvnw",
      "args": [
        "-q",
        "-f",
        "/Users/xin.y/IdeaProjects/mcp-mysql-server/pom.xml",
        "spring-boot:run"
      ]
    }
  }
}
方式二:JAR 包启动

构建jar

./mvnw clean package

配置MCP服务器

{
  "mcpServers": {
    "mcp-mysql-server": {
      "command": "java",
      "args": [
        "-Dloader.path=/Users/xin.y/IdeaProjects/mcp-mysql-server/src/main/resources/groovy",
        "-jar",
        "/Users/xin.y/IdeaProjects/mcp-mysql-server/target/mcp-mysql-server-0.0.1-SNAPSHOT.jar"
      ]
    }
  }
}

注意: -Dloader.path 参数为可选,仅在需要运行扩展功能时才需要指定。

2. 数据源配置

修改 mcp-mysql-server/src/main/resources/datasource.yml 文件:

datasource:
  datasources:
    your_db1_name:
      url: jdbc:mysql://localhost:3306/db1
      username: root
      password: password
      default: true  # 标记为默认数据源

功能特点

  • 多数据源支持 - 配置和管理多个数据库数据源
  • 动态数据源切换 - 运行时动态切换不同的数据源
  • 扩展功能 - 通过 Groovy 脚本扩展功能
  • SQL 安全控制 - 防止 AI 模型执行危险 SQL 操作

详细文档

文档 描述
扩展功能文档 Groovy 脚本扩展的详细配置和开发指南
数据源配置文档 数据源的详细配置、多环境管理和最佳实践
SQL 安全控制文档 SQL 安全策略的配置和管理

环境要求

  • JDK 21+
  • Maven 3.6+