mcp-mysql-server
@MCP-Mirror
About mcp-mysql-server
Mirror of
Basic information
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"Malove86_mcp-mysql-server": {
"command": "npx",
"args": [
"@malove86/mcp-mysql-server"
]
}
}
}Tools
No tools detected
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
What is mcp-mysql-server?
一个基于 Model Context Protocol 的 MySQL 数据库操作服务器,使 AI 模型能够通过标准化接口与 MySQL 数据库进行交互。
How to use mcp-mysql-server?
支持两种部署模式:在 MCP 配置文件中的本地模式通过 npx 运行并设置环境变量(MYSQL_HOST、MYSQL_USER、MYSQL_PASSWORD、MYSQL_DATABASE、MYSQL_PORT 可选),或远程 URL 模式指定服务器地址。服务器启动后提供 connect_db、query、list_tables、describe_table 等工具。
Key features of mcp-mysql-server
- 安全的连接处理,自动清理
- 支持预处理语句防止 SQL 注入
- 多用户并发支持与连接池(最多50连接)
- 自动连接管理与优雅容错
- 支持 URL 远程模式,凭据不暴露客户端
- TypeScript 支持,详细请求跟踪
Use cases of mcp-mysql-server
- AI 模型通过标准化接口安全查询 MySQL 数据库
- 列出数据库所有表并获取表结构信息
- 使用预处理语句执行带参数的 SELECT 查询
- 多用户同时操作同一数据库,互不干扰
- 远程部署数据库操作服务,保护敏感凭据
FAQ from mcp-mysql-server
如何配置数据库连接?
通过环境变量设置 MYSQL_HOST、MYSQL_USER、MYSQL_PASSWORD、MYSQL_DATABASE,MYSQL_PORT 可选(默认 3306);也可在运行时通过 connect_db 工具传入参数。
支持哪些数据库操作?
提供 connect_db、query(执行 SELECT 查询)、list_tables(列出所有表)、describe_table(获取表结构)四个工具。
性能上有什么限制?
支持最多 50 个并发连接(可配置),连接池自动管理以提高资源利用率。
如何防止 SQL 注入?
使用预处理语句,执行前验证查询,并在完成后自动关闭连接。
版本 v0.2.4+ 有哪些改进?
新增多用户并发支持、高效连接池管理、请求级别隔离、详细日志记录、改进的错误处理和性能优化。
More Databases MCP servers
Redis MCP Server
redisThe official Redis MCP Server is a natural language interface designed for agentic applications to manage and search data in Redis efficiently
Elasticsearch/OpenSearch MCP Server
cr7258A Model Context Protocol (MCP) server implementation that provides Elasticsearch and OpenSearch interaction.
Multi Database MCP Server
FreePeakA powerful multi-database server implementing the Model Context Protocol (MCP) to provide AI assistants with structured access to databases.
MCP Server for MySQL based on NodeJS
benborlaA Model Context Protocol server that provides read-only access to MySQL databases. This server enables LLMs to inspect database schemas and execute read-only queries.
Meilisearch MCP Server
meilisearchA Model Context Protocol (MCP) server for interacting with Meilisearch through LLM interfaces.
Comments