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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for jewei_mysql_mcp_server-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5580a60506f763b392907f8649a00c59cbc1035448ca6d18f67578f5c6b2b43b
MD5 ad157ac8d3d37b432791fb38dc7455a3
BLAKE2b-256 2c6eb1a5fd526f140fcb53138aaaaaafa3aa172783eb7935e8b0d7a5809a8aab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jewei_mysql_mcp_server-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e1039622f9ec0f6baa4898e0b7d99e4a797db3a21d377d5eeacef293918cb62b
MD5 42c3d999fdf180310f463a7328a23513
BLAKE2b-256 19527a824336a5cd93c9f33339708ba83b8acb93c1eb0b10604c1f84d2337a51

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