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.3.tar.gz (8.2 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.3-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for jewei_mysql_mcp_server-0.1.3.tar.gz
Algorithm Hash digest
SHA256 3df510f057565c683b6f298ff7f022e885419faf2181d383d0293f8a28e1e156
MD5 23d62473cd57685d94b9f6519678c319
BLAKE2b-256 3af6b7fff186cbfbc4edaa59ecebf091baa6aa4e0954a09b1c14a7d21e5074ff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jewei_mysql_mcp_server-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a68e703dd498a82b6598f276fb4a0851b4a6bc2cd7ef54659d3d0ced65980116
MD5 d15253426bc13668fdfd8fd7b829d463
BLAKE2b-256 edb782c010ab0e17c707f2c4272cc1a6e4a14e924500f8ad417d2cbd17082f35

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