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

运行

python run_server.py

功能

执行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.1.tar.gz (3.5 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.1-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for jewei_mysql_mcp_server-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4842a532ff65151ab39ec9c75e52d46b391df6c225602ea71be6db4936fc3155
MD5 2403e1e3e25134433d2a37d2e6e2607c
BLAKE2b-256 87ffb01540ffa27dfa346446ff1fb279b2e04f6c7dbf957d8de1b110f0a4b45c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jewei_mysql_mcp_server-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 faffe0a5979dde7ab4e9b31e13e2c407a2e4b97ed5c96185e012eb26322f7e44
MD5 e88e49060f5141584c52521623b43192
BLAKE2b-256 4244e11644b18d40452ef64c25463fd2d621546d16b90d4d1323ce2889f4e0d8

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