MySQL Server
About
A server for performing MySQL database operations.
Details
- Author
- malove86
- Downloads
- 349
- Categories
- Database, Other
- Tags
- #mysql, #sql
Jump to
- 安全的连接处理,自动清理
- 支持预处理语句防止 SQL 注入
- 多用户并发支持与连接池(最多50连接)
- 自动连接管理与优雅容错
- 支持 URL 远程模式,凭据不暴露客户端
- TypeScript 支持,详细请求跟踪
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
MySQL ServerCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
支持两种部署模式:在 MCP 配置文件中的本地模式通过 npx 运行并设置环境变量(MYSQL_HOST、MYSQL_USER、MYSQL_PASSWORD、MYSQL_DATABASE、MYSQL_PORT 可选),或远程 URL 模式指定服务器地址。服务器启动后提供 connect_db、query、list_tables、describe_table 等工具。
connect_db
Connect to MySQL database (optional if environment variables are set)
query
Execute a SELECT query
list_tables
List all tables in the database
describe_table
Get table structure
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"mysql server": {
"Malove86_mcp-mysql-server": {
"command": "npx",
"args": [
"@malove86/mcp-mysql-server"
]
}
}
}
}
McpServers
{
"Malove86_mcp-mysql-server": {
"command": "npx",
"args": [
"@malove86/mcp-mysql-server"
]
}
}
一个基于Model Context Protocol的MySQL数据库操作服务器。该服务器使AI模型能够通过标准化接口与MySQL数据库进行交互。
{ "mcpServers": { "mysql": { "command": "npx", "args": ["-y", "@malove86/mcp-mysql-server"], "env": { "MYSQL_HOST": "your_host", "MYSQL_USER": "your_user", "MYSQL_PASSWORD": "your_password", "MYSQL_DATABASE": "your_database", "MYSQL_PORT": "3306" } } } }
{ "mcpServers": { "mcp-mysql-server": { "url": "http://your-server-address:port/mcp-mysql-server" } } }
# 设置环境变量 export MYSQL_HOST=your_host export MYSQL_USER=your_user export MYSQL_PASSWORD=your_password export MYSQL_DATABASE=your_database export MYSQL_PORT=3306 # 可选,默认为3306 # 启动服务器 npx @malove86/mcp-mysql-server
- 多用户并发支持:服务器现在可同时处理多个用户的请求
- 高效连接池管理:使用改进的连接池,支持最多50个并发连接
- 请求级别隔离:每个请求都有唯一标识符,便于跟踪和调试
- 详细日志记录:记录每个请求的执行过程和资源使用情况
- 改进的错误处理:更精确地捕获和报告数据库错误
- 性能优化:连接池复用和优化的连接管理提高处理速度
- 自动数据库连接:在服务器启动时,如果设置了环境变量,会自动尝试连接数据库
- 无需客户端参数:当使用URL模式时,客户端不需要提供数据库连接信息
- 无感知数据库操作:可以直接使用list_tables、query等工具,无需先调用connect_db
- 更安全:敏感的数据库凭据只在服务器端存在,不会暴露在客户端对话中
- 优雅的容错:即使初始连接失败,后续操作会自动重试连接
使用提供的凭据建立与MySQL数据库的连接。如果已通过环境变量设置了连接,此工具是可选的。
{ "host": "localhost", "user": "root", "password": "your_password", "database": "your_database", "port": 3306 // 可选,默认为3306 }
{ "sql": "SELECT * FROM users WHERE id = ?", "params": [1] // 可选参数 }
{ "table": "users" }
- 安全的连接处理,自动清理
- 支持预处理语句参数
- 全面的错误处理和验证
- TypeScript支持
- 自动连接管理
- 服务器环境变量配置
- 支持URL远程连接模式
- 多用户并发支持
- 高性能连接池
- 支持最多50个并发连接(可配置)
- 连接池自动管理,提高资源利用率
- 详细的请求跟踪和性能监控
- 使用预处理语句防止SQL注入
- 通过环境变量支持安全密码处理
- 执行前验证查询
- 完成后自动关闭连接
- URL模式下敏感凭据不暴露在客户端
- 连接隔离,防止用户间数据泄露
欢迎贡献!请随时提交Pull Request到https://github.com/Malove86/mcp-mysql-server.git
Multi-database agent access (PostgreSQL, SQLite, MySQL, Oracle, SQL Server) with batch queries, pre-configured connections, and SQLGlot-enforced read-only safety
A read-only MCP server for MySQL, enabling LLMs to query live data using the CData JDBC Driver.
Database MCP server for MySQL, MariaDB, PostgreSQL & SQLite
A single-binary MCP server for MySQL, MariaDB, PostgreSQL, and SQLite
A Model Context Protocol (MCP) server that provides multi-database query execution capabilities with support for SQLite, PostgreSQL, and MySQL databases. Includes a built-in Web UI for managing database connections.
Allows Claude AI to interact directly with MySQL databases.
Update various databases (PostgreSQL, MySQL, MongoDB, SQLite) using data from CSV and Excel files.
Enables AI assistants to interact with various databases through JDBC connections.
An MCP server for retrieving data from a MariaDB database.
Access and manage MariaDB or MySQL databases using an MCP server.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





