Skip to main content

MCP server for MySQL database operations

Project description

keevor-mysql-mcp-server

一个 MCP (Model Context Protocol) 服务器,用于连接 MySQL 数据库并执行常用操作。

功能

  • list_tables - 查询数据库中的所有表
  • describe_table - 查询指定表的结构
  • execute_sql - 执行 SQL 语句

使用方法

1. 安装 uv

# Windows (PowerShell)
irm https://astral.sh/uv/install.ps1 | iex

# macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

2. 配置 MCP

在 AI 工具的 MCP 配置文件中添加:

{
  "mcpServers": {
    "keevor-mysql-mcp-server": {
      "command": "uvx",
      "args": ["keevor-mysql-mcp-server"],
      "env": {
        "DB_HOST": "localhost",
        "DB_PORT": "3306",
        "DB_USER": "root",
        "DB_PASSWORD": "your_password",
        "DB_NAME": "your_database"
      }
    }
  }
}

3. 开始使用

配置完成后,AI 助手即可使用以下工具:

  • 查询所有表:调用 list_tables
  • 查询表结构:调用 describe_table,传入表名
  • 执行 SQL:调用 execute_sql,传入 SQL 语句

环境变量

变量 说明 默认值
DB_HOST 数据库主机地址 localhost
DB_PORT 数据库端口 3306
DB_USER 数据库用户名 root
DB_PASSWORD 数据库密码 -
DB_NAME 数据库名称 -

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

keevor_mysql_mcp_server-0.2.0.tar.gz (48.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

keevor_mysql_mcp_server-0.2.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file keevor_mysql_mcp_server-0.2.0.tar.gz.

File metadata

File hashes

Hashes for keevor_mysql_mcp_server-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8adbc8e4357a49ef8d1a5edbd644c2483e2e28a3e0d431b52c004ee3eee127df
MD5 abd691807de258e734611e855ae8fd63
BLAKE2b-256 d9660994918c42b32319c66fbdfef160b74a60be34e7a22a1055cb940b3bd1a5

See more details on using hashes here.

File details

Details for the file keevor_mysql_mcp_server-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for keevor_mysql_mcp_server-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e4ef7612ccc3d68080b5e3714a79a2b033d04b14ad56a3c3a680d070d93dd8f8
MD5 d8dbc7f47d4eee27a6f0b4333efff108
BLAKE2b-256 61f36fc34e21bf719c004a77407b7a9a7fae204571b128bd7791c04c62d87217

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page