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.2.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.2-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for jewei_mysql_mcp_server-0.1.2.tar.gz
Algorithm Hash digest
SHA256 fc05ca05f675c216b642c5e997543331df24b646b7745adbb4d9aef437bdfdfc
MD5 81c3d0d46aefe70cdcf1e6dc44ee89c2
BLAKE2b-256 3e1adbbfab50456b151398f824ce46c3b57d535ef7005123ec8c3836aa827d0d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jewei_mysql_mcp_server-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b81ffd468c6acdf0babf2758943cdd7f9eb8879bfe8a9099de22bdbe586b90ad
MD5 e86ab941bed399522b96412f63a3096d
BLAKE2b-256 022b77eac083a862de8a4fff86b70cc446d272401296818105071b02ded1a092

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