MySQL Database Access MCP Server
About
<a href="https://glama.ai/mcp/servers/@dpflucas/mysql-mcp-server"> <img width="380" height="200" src="https://glama.ai/mcp/servers/@dpflucas/mysql-mcp-server/badge" alt="mysql-mcp-server MCP server" /> </a> [![npm…
Details
- License
- MIT license
Explore
- Read-only access: Only SELECT, SHOW, DESCRIBE, and EXPLAIN statements are allowed
- Query validation: Prevents SQL injection and blocks any data modification attempts
- Query timeout: Prevents long-running queries from consuming resources
- Row limit: Prevents excessive data return
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 Database Access 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
npm install -g mysql-mcp-server
npm install mysql-mcp-server
npm install
npm run build
The server requires the following environment variables:
- MYSQL_HOST: Database server hostname
- MYSQL_PORT: Database server port (default: 3306)
- MYSQL_USER: Database username
- MYSQL_PASSWORD: Database password (optional, but recommended for secure connections)
- MYSQL_DATABASE: Default database name (optional)
This script creates a test database, table, and sample data:
bash
export MYSQL_HOST=localhost
export MYSQL_PORT=3306
export MYSQL_USER=your_username
export MYSQL_PASSWORD=your_password
npm run test:setup
```
This script tests each of the MCP tools against the test database:
```bash
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"mysql database access mcp server": {
"mysql": {
"command": "npx",
"args": [
"mysql-mcp-server"
],
"env": {
"MYSQL_HOST": "",
"MYSQL_PORT": "",
"MYSQL_USER": "",
"MYSQL_PASSWORD": "",
"MYSQL_DATABASE": ""
}
}
}
}
}
McpServers
{
"mysql": {
"command": "npx",
"args": [
"mysql-mcp-server"
],
"env": {
"MYSQL_HOST": "",
"MYSQL_PORT": "",
"MYSQL_USER": "",
"MYSQL_PASSWORD": "",
"MYSQL_DATABASE": ""
}
}
}
This MCP server provides read-only access to MySQL databases. It allows you to:
- List available databases
- List tables in a database
- Describe table schemas
- Execute read-only SQL queries
Security Features
- Read-only access: Only SELECT, SHOW, DESCRIBE, and EXPLAIN statements are allowed
- Query validation: Prevents SQL injection and blocks any data modification attempts
- Query timeout: Prevents long-running queries from consuming resources
- Row limit: Prevents excessive data return
Installation
1. Install using one of these methods:
Install from NPM
```bash
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.



