
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
MySQL MCP Xu 是一个基于 FastMCP 的 MySQL MCP Server项目,提供了一个安全、高效的接口来执行 SQL 操作。该项目支持多种权限控制(读、写、管理员),并通过工具函数实现了表结构查询、索引信息获取、健康状态监控等功能。
.
├── src
│ └── mysql_mcp_xu
│ ├── __init__.py
│ ├── config.py
│ └── mcp_server.py
├── README.md
└── pyproject.toml
pip install mysql-mcp-xu
.env
文件,内容如下:MYSQL_HOST=localhost
MYSQL_PORT=3306
MYSQL_USER=your_username
MYSQL_PASSWORD=your_password
MYSQL_DATABASE=your_database
MYSQL_ROLE=r # 可选值: r, w, a
MYSQL_MAXSIZE=2 # 可选值 连接池最大值
权限控制通过 PERMISSIONS
字典实现,支持以下角色:
r
:只读权限,允许执行 SELECT
, SHOW
, DESCRIBE
, EXPLAIN
, USE
操作。w
:读写权限,允许执行 SELECT
, SHOW
, DESCRIBE
, EXPLAIN
, INSERT
, UPDATE
, DELETE
, USE
操作。a
:管理员权限,允许执行所有操作,包括 CREATE
, ALTER
, DROP
, TRUNCATE
等。execute_sql
: 执行 SQL 语句并返回结果,SELECT语句没有LIMIT时,自动在sql后加LIMIT 1000。get_table_structure
: 获取指定表的字段信息。get_table_indexes
: 获取指定表的索引信息。search_table_by_name
: 根据表名或表注释搜索数据库中对应的表名。get_mysql_health
: 获取 MySQL 的健康状态。get_database_info
: 获取数据库基本信息get_database_tables
: 获取数据库所有表和对应的表注释analyze_table_stats
: 分析表统计信息和列统计信息get_process_list
: 获取当前进程列表check_table_constraints
: 检查表约束信息在 MCP 配置文件中添加如下配置,以使用 uvx
部署 MySQL MCP Xu 服务:
{
"mcpServers": {
"mysql-mcp-xu": {
"command": "uvx",
"args": [
"mysql-mcp-xu"
],
"env": {
"MYSQL_HOST": "",
"MYSQL_PORT": "3306",
"MYSQL_USER": "",
"MYSQL_PASSWORD": "",
"MYSQL_DATABASE": "",
"MYSQL_ROLE": "r",
"MYSQL_MAXSIZE": "2"
}
}
}
}
{
"mcpServers": {
"mysql-mcp-xu": {
"name": "mysql-mcp-xu",
"type": "streamableHttp",
"description": "",
"isActive": true,
"url": "http://localhost:9009/mcp"
}
}
}
{
"mcpServers": {
"mysql-mcp-xu": {
"name": "mysql-mcp-xu",
"description": "",
"isActive": true,
"url": "http://localhost:9009/sse"
}
}
}
{
"mcpServers": {
"mysql-mcp-xu": {
"command": "uv",
"args": [
"--directory",
"D:/mysql-mcp-xu/src/mysql_mcp_xu",
"run",
"-m",
"mcp_server"
]
}
}
}
{
"mcpServers": {
"mysql-mcp-xu": {
"command": "uv",
"args": [
"--directory",
"D:/mysql-mcp-xu/src/mysql_mcp_xu",
"run",
"-m",
"mcp_server",
"sh"
]
}
}
}
{
"mcpServers": {
"mysql-mcp-xu": {
"command": "uv",
"args": [
"--directory",
"D:/mysql-mcp-xu/src/mysql_mcp_xu",
"run",
"-m",
"mcp_server",
"sse"
]
}
}
}
FAQs
使用FastMCP构建MySql Mcp Server,支持Streamable HTTP, STDIO, SSE,支持读写权限控制
We found that mysql-mcp-xu demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.