MySQL MCP服务器,提供SQL查询和表结构查询功能
Project description
MySQL MCP Server
这是一个基于FastMCP的MySQL数据库查询服务器,提供了以下功能:
- 执行SQL查询(仅支持SELECT语句)
- 获取表结构信息
- 列出数据库中的所有表
安装
- 克隆仓库
- 安装依赖:
pip install -r requirements.txt - 配置环境变量(参见下文)
配置
在项目根目录创建.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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jewei_mysql_mcp_server-0.1.3.tar.gz.
File metadata
- Download URL: jewei_mysql_mcp_server-0.1.3.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3df510f057565c683b6f298ff7f022e885419faf2181d383d0293f8a28e1e156
|
|
| MD5 |
23d62473cd57685d94b9f6519678c319
|
|
| BLAKE2b-256 |
3af6b7fff186cbfbc4edaa59ecebf091baa6aa4e0954a09b1c14a7d21e5074ff
|
File details
Details for the file jewei_mysql_mcp_server-0.1.3-py3-none-any.whl.
File metadata
- Download URL: jewei_mysql_mcp_server-0.1.3-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a68e703dd498a82b6598f276fb4a0851b4a6bc2cd7ef54659d3d0ced65980116
|
|
| MD5 |
d15253426bc13668fdfd8fd7b829d463
|
|
| BLAKE2b-256 |
edb782c010ab0e17c707f2c4272cc1a6e4a14e924500f8ad417d2cbd17082f35
|