MCP Catalogs
Homemysql-mcp-server screenshot

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.

databasedeveloper-toolsai-llm
12
Forks
1
Open issues
9 mo ago
Last commit
2d ago
Indexed

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:

you:AI assistants that need to query or analyze MySQL data
you:Database administrators needing automated management tools
you:Data analysis workflows requiring SQL execution capability
you:Is DROP/TRUNCATE/ALTER supported?
you:How is SQL injection prevented?

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 README
  • execute_sql

    Execute SQL queries including SELECT, INSERT, UPDATE, and DELETE

  • get_tables_info

    Get database table structure information including all tables and their columns

  • get_connection_status

    Check if the MySQL database connection is active

Comparable tools

postgres-mcp-serversupabase-mcpdatabase-jsmysql2

Installation

Installation

  1. Clone the repository
git clone https://github.com/TickHaiJun/mysql-mcp-server.git
cd mysql-mcp-server
  1. Install dependencies
npm install
  1. Configure database connection (create .env file)
DB_HOST=localhost
DB_PORT=3306
DB_USER=root
DB_PASSWORD=yourpassword
DB_NAME=yourdatabase
  1. Start the server
node src/index.js

Claude 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

GitHub →

Last updated · Auto-generated from public README + GitHub signals.