Skip to main content

MySQL MCP服务器,提供SQL查询和表结构查询功能

Project description

MySQL MCP Server

这是一个基于FastMCP的MySQL数据库查询服务器,提供了以下功能:

  • 执行SQL查询(仅支持SELECT语句)
  • 获取表结构信息
  • 列出数据库中的所有表

安装

  1. 克隆仓库
  2. 安装依赖:pip install -r requirements.txt
  3. 配置环境变量(参见下文)

配置

在项目根目录创建.env文件,包含以下环境变量:

DB_HOST=localhost
DB_PORT=3306
DB_USER=root
DB_PASSWORD=your_password
DB_NAME=your_database

运行

使用uvx安装并运行(推荐)

uvx --from jewei-mysql-mcp-server jewei-mysql-mcp-server

或者从源码运行

python -m jewei_mysql_mcp_server.server

功能

执行SQL查询

执行SQL查询并返回结果集(仅支持SELECT语句)。

获取表结构信息

获取指定表的结构信息,包括列信息、主键、外键和索引。

列出数据库中的所有表

列出指定数据库中的所有表。

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

jewei_mysql_mcp_server-0.1.4.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

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

jewei_mysql_mcp_server-0.1.4-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file jewei_mysql_mcp_server-0.1.4.tar.gz.

File metadata

File hashes

Hashes for jewei_mysql_mcp_server-0.1.4.tar.gz
Algorithm Hash digest
SHA256 cbe188575fb1f8f409ca5b89d90251c0e7c717ff9f4ef579cefb8e8ae9acc9bc
MD5 1b453c400797450811eee76c0949f103
BLAKE2b-256 a369d1f055b635bb6b77cd78de7a0df7367f2941a20c2368ab5b564d38b315eb

See more details on using hashes here.

File details

Details for the file jewei_mysql_mcp_server-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for jewei_mysql_mcp_server-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 bd4dfd238e1780ddeb4613295e89553c01edb6e6eb2755ff8588a3f9191b6b30
MD5 f5d988ba038075d0a0e05b0575b87ba0
BLAKE2b-256 d0c6d198f532f2309339f6f0e991ab7c9eca783292f23b4220f496cfea5640ee

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