MySQL MCP Server
About
MySQL MCP Server is a Model Context Protocol server that provides secure MySQL database operations for AI assistants and other MCP clients. It exposes database queries and schema introspection as MCP tools and resources.
Details
- Author
- MCP-Mirror
- Downloads
- 376
- Categories
- Database
Jump to
- Execute safe SQL queries (SELECT, INSERT, SHOW, DESCRIBE)
- Get detailed table structure information
- Insert data with automatic parameterization
- List all tables in the database
- Automatic LIMIT clauses on SELECT queries
- Connection pooling for efficient database management
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 MCP 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
Install via npm install mysql-mcp-server and configure with environment variables (MYSQL_HOST, MYSQL_PORT, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DB, MYSQL_TIMEZONE). Add it to your Claude Desktop config or run directly with npx mysql-mcp-server.
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"mysql mcp server": {
"SuMiaoALi_mysql-mcp-server": {
"command": "npx",
"args": [
"mysql-mcp-server"
]
}
}
}
}
McpServers
{
"SuMiaoALi_mysql-mcp-server": {
"command": "npx",
"args": [
"mysql-mcp-server"
]
}
}
MySQL MCP Server
A Model Context Protocol (MCP) server that provides secure MySQL database operations for AI assistants and other MCP clients.
Features
🛠️ Tools
- execute_query - Execute safe SQL queries (SELECT, INSERT, SHOW, DESCRIBE) - get_table_info - Get detailed table structure information - insert_data - Convenient data insertion with automatic parameterization - list_tables - List all tables in the database📊 Resources
- Database Info (mysql://database/info) - Database metadata and table list
- Table Structure (mysql://table/{table_name}) - Detailed table schema information
🔒 Security Features
- Limited Operations: Only allows safe operations (SELECT, INSERT, SHOW, DESCRIBE) - SQL Injection Protection: Uses parameterized queries - Automatic LIMIT: Adds LIMIT clauses to SELECT queries to prevent large data dumps - Connection Pooling: Efficient database connection managementInstallation
npm install mysql-mcp-server
Configuration
The server can be configured using environment variables:
| Variable | Default | Description |
|----------|---------|-------------|
| MYSQL_HOST | localhost | MySQL server hostname |
| MYSQL_PORT | 3306 | MySQL server port |
| MYSQL_USER | root | MySQL username |
| MYSQL_PASSWORD | _(empty)_ | MySQL password |
| MYSQL_DB | mysql | Default database name |
| MYSQL_TIMEZONE | +00:00 | MySQL timezone |
Usage with MCP Clients
Claude Desktop
Add to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"mysql": {
"command": "npx",
"args": ["mysql-mcp-server"],
"env": {
"MYSQL_HOST": "your-mysql-host",
"MYSQL_PORT": "3306",
"MYSQL_USER": "your-username",
"MYSQL_PASSWORD": "your-password",
"MYSQL_DB": "your-database"
}
}
}
}
Other MCP Clients
For other MCP clients, use the server with stdio transport:
npx mysql-mcp-server
Development
Prerequisites
- Node.js 18+ - TypeScript - Access to a MySQL databaseSetup
1. Clone the repository:
git clone https://github.com/your-username/mysql-mcp-server.git
cd mysql-mcp-server
2. Install dependencies:
npm install
3. Set up environment variables:
```bash
cp .env.example .env
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.



