Basic information
About mcp-mysql-server
Mirror of
mcp-mysql-server is a MCP server in the Databases category listed in the AddMCP.net directory, published by MCP-Mirror. It exposes 4 tools, including connect_db, query, list_tables, describe_table. Supported transport: stdio. Runtime: node. License: MIT license. Source code is hosted on github.com. Related topics: ai-integration, database, mcp-mysql-server.
Setup
{
"mcpServers": {
"Malove86_mcp-mysql-server": {
"command": "npx",
"args": [
"@malove86/mcp-mysql-server"
]
}
}
}
{
"mcpServers": {
"Malove86_mcp-mysql-server": {
"command": "npx",
"args": [
"@malove86/mcp-mysql-server"
]
}
}
}
{
"servers": {
"Malove86_mcp-mysql-server": {
"command": "npx",
"args": [
"@malove86/mcp-mysql-server"
]
}
}
}
mcp-mysql-server — by MCP-Mirror 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"
]
}
}
}
mcp-mysql-server — by MCP-Mirror tools
-
connect_db
— Connect to MySQL database (optional if environment variables are set)
host:string*, user:string*, password:string*, database:string*, port:number -
query
— Execute a SELECT query
sql:string*, params:array -
list_tables
— List all tables in the database
random_string:string -
describe_table
— Get table structure
table:string*
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 查询
- 多用户同时操作同一数据库,互不干扰
- 远程部署数据库操作服务,保护敏感凭据
Frequently asked questions
1 如何配置数据库连接?
通过环境变量设置 MYSQL_HOST、MYSQL_USER、MYSQL_PASSWORD、MYSQL_DATABASE,MYSQL_PORT 可选(默认 3306);也可在运行时通过 connect_db 工具传入参数。
2 支持哪些数据库操作?
提供 connect_db、query(执行 SELECT 查询)、list_tables(列出所有表)、describe_table(获取表结构)四个工具。
3 性能上有什么限制?
支持最多 50 个并发连接(可配置),连接池自动管理以提高资源利用率。
4 如何防止 SQL 注入?
使用预处理语句,执行前验证查询,并在完成后自动关闭连接。
5 版本 v0.2.4+ 有哪些改进?
新增多用户并发支持、高效连接池管理、请求级别隔离、详细日志记录、改进的错误处理和性能优化。
Comments
No comments yet
Be the first to share feedback about this listing. Sign in to leave a comment.
Sign In