
mysql-mcp-server
by TickHaiJun·★ 31·Score 41
A Node.js MCP server that connects to MySQL databases, providing SQL query execution and metadata retrieval.
Overview
The MCP MySQL Server is a comprehensive tool service built on the @modelcontextprotocol/sdk that enables AI agents and automation tools to interact with MySQL databases. It provides essential database operations including executing SQL queries (SELECT, INSERT, UPDATE, DELETE), retrieving table structure information, and detecting connection status. The server implements security measures to prevent SQL injection by validating SQL statements and parameters, blocking dangerous operations like DROP/TRUNCATE/ALTER commands.
Try asking AI
After installing, here are 5 things you can ask your AI assistant:
When to choose this
Choose this server when you need an MCP interface for MySQL with basic query capabilities and built-in safety features, especially if you're working with JavaScript-based AI systems.
When NOT to choose this
Don't choose this if you need advanced database operations (transactions, stored procedures) or require fine-grained access control beyond basic safety checks.
Tools this server exposes
3 tools extracted from the READMEexecute_sqlExecute SQL queries including SELECT, INSERT, UPDATE, and DELETE
get_tables_infoGet database table structure information including all tables and their columns
get_connection_statusCheck if the MySQL database connection is active
Comparable tools
Installation
Installation
- Clone the repository
git clone https://github.com/TickHaiJun/mysql-mcp-server.git
cd mysql-mcp-server- Install dependencies
npm install- Configure database connection (create .env file)
DB_HOST=localhost
DB_PORT=3306
DB_USER=root
DB_PASSWORD=yourpassword
DB_NAME=yourdatabase- Start the server
node src/index.jsClaude Desktop Configuration
Add to Claude Desktop config:
{
"mcpServers": {
"mysql": {
"command": "node",
"args": ["/path/to/mysql-mcp-server/src/index.js"],
"env": {
"DB_HOST": "localhost",
"DB_PORT": "3306",
"DB_USER": "yourusername",
"DB_PASSWORD": "yourpassword",
"DB_NAME": "yourdatabase"
}
}
}
}FAQ
- Is DROP/TRUNCATE/ALTER supported?
- No, these dangerous operations are explicitly blocked for security reasons.
- How is SQL injection prevented?
- All SQL statements and parameters are validated using validators that check for injection patterns and block suspicious operations.
Compare mysql-mcp-server with
Last updated · Auto-generated from public README + GitHub signals.