Skip to main content
Glama
LeonMelamud

MySQL MCP Server

by LeonMelamud

MySQL MCP 服务器

功能强大的 MCP 服务器,可直接访问 MySQL 数据库。该服务器使 AI 代理能够通过简单的界面与 MySQL 数据库交互、执行 SQL 查询并管理数据库内容。

特征

资源

  • 通过note:///{id} URI 访问存储在数据库中的笔记

  • 每个笔记都有标题和内容

  • 用于简单内容访问的纯文本 MIME 类型

工具

  • create_note - 在数据库中创建新的文本注释

    • 将标题和内容作为必需参数

    • 将注释存储在 MySQL 数据库中

  • list_tables - 列出所连接数据库中的所有表

  • count_tables获取数据库中表的总数

  • search_tables - 使用 LIKE 模式搜索表

  • describe_table - 获取特定表的结构

  • execute_sql自定义 SQL 查询

Related MCP server: MySQL MCP Server

先决条件

  • Node.js 18 或更高版本

  • MySQL 服务器已安装并正在运行

  • 具有适当权限的数据库

设置

  1. 克隆此存储库:

    git clone git@github.com:LeonMelamud/mysql-mcp.git
    cd mysql-mcp
  2. 安装依赖项:

    npm install
  3. 使用您的 MySQL 连接详细信息在根目录中创建一个.env文件:

    MYSQL_HOST=localhost
    MYSQL_USER=your_username
    MYSQL_PASSWORD=your_password
    MYSQL_DATABASE=your_database
  4. 构建服务器:

    npm run build

安装

对于克劳德桌面

将服务器配置添加到您的 Claude Desktop 配置文件:

在 MacOS 上: ~/Library/Application Support/Claude/claude_desktop_config.json在 Windows 上: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "mysql": {
      "command": "node",
      "args": ["/path/to/mysql-server/build/index.js"],
      "env": {
        "MYSQL_HOST": "localhost",
        "MYSQL_USER": "your_username",
        "MYSQL_PASSWORD": "your_password",
        "MYSQL_DATABASE": "your_database"
      }
    }
  }
}

对于克莱恩

将服务器配置添加到您的 Cline MCP 设置文件:

在 MacOS 上: ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json在 Windows 上: %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json

{
  "mcpServers": {
    "mysql": {
      "command": "node",
      "args": ["/path/to/mysql-server/build/index.js"],
      "env": {
        "MYSQL_HOST": "localhost",
        "MYSQL_USER": "your_username",
        "MYSQL_PASSWORD": "your_password",
        "MYSQL_DATABASE": "your_database"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

使用示例

安装完成后,您可以在与 Claude 的对话中使用 MySQL MCP 服务器:

列出数据库中的所有表

Please list all the tables in my MySQL database.

执行 SQL 查询

Run this SQL query: SELECT * FROM users LIMIT 5

创建笔记

Create a note titled "Meeting Notes" with the content "Discussed project timeline and assigned tasks."

发展

对于使用自动重建的开发:

npm run watch

调试

使用 MCP Inspector 调试服务器:

npm run inspector

检查器将提供一个 URL 来访问浏览器中的调试工具。

执照

麻省理工学院

A
license - permissive license
Not graded
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    A server that enables AI models to interact with MySQL databases through a Model Control Protocol, providing tools for table creation, schema inspection, query execution, and data retrieval.
    28
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    A Model Context Protocol server that allows AI agents to execute SQL queries against a MySQL database, supporting operations like reading data, creating tables, inserting, updating, and deleting records.
    6
    519
    8
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    MCP server that connects AI agents to MySQL databases for schema exploration, data querying, and SQL execution via natural language.
    2
    MIT

View all related MCP servers

Related MCP Connectors

  • GibsonAI MCP server: manage your databases with natural language

  • Analytical memory for AI agents: a real Postgres queried in plain English over MCP. One command.

  • Driflyte MCP server which lets AI assistants query topic-specific knowledge from web and GitHub.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/LeonMelamud/mysql-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server