MCP MySQL

v1.0.0Databasesstable

Enables interaction with MySQL databases (including AWS RDS and cloud instances) through natural language, supporting query execution, schema inspection, index management, and comprehensive database operations with secure SSL connections.

mcpmcp-clientmcp-mysqlmcp-servermcp-tools
Share:
32
Stars
0
Downloads
0
Weekly
0/5

What is MCP MySQL?

MCP MySQL is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to enables interaction with mysql databases (including aws rds and cloud instances) through natural language, supporting query execution, schema inspection, index management, and comprehensive database o...

Enables interaction with MySQL databases (including AWS RDS and cloud instances) through natural language, supporting query execution, schema inspection, index management, and comprehensive database operations with secure SSL connections.

This server falls under the Databases category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Enables interaction with MySQL databases (including AWS RDS

Use Cases

Query MySQL databases including AWS RDS instances through natural language.
Perform schema inspection, index management, and comprehensive database operations.
Manage secure SSL connections to cloud MySQL instances via AI interface.
TickHaiJun

Maintainer

LicenseApache 2.0
Languagejavascript
Versionv1.0.0
UpdatedApr 27, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx mcp-mysql-server

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use MCP MySQL

MCP MySQL Server provides a natural language interface to MySQL databases, including AWS RDS and other cloud-hosted instances, through the Model Context Protocol. It exposes tools for executing SQL queries, inspecting table schemas, and checking connection status, while enforcing safety guardrails that block destructive DDL operations. Developers and analysts can query and explore databases conversationally without writing raw SQL, making it ideal for rapid data exploration and reporting workflows.

Prerequisites

  • Node.js 16+ and npm installed
  • A running MySQL database (local, AWS RDS, or other cloud instance)
  • Database credentials: host, port, username, password, and database name
  • An MCP-compatible client such as Claude Desktop or Cursor
1

Clone the repository

Clone the MCP MySQL server repository and enter the project directory.

git clone https://github.com/TickHaiJun/mysql-mcp-server.git
cd mysql-mcp-server
2

Install Node.js dependencies

Install all required npm packages for the server.

npm install
3

Prepare your database connection details

Gather the five required connection parameters: DB_HOST, DB_PORT (default 3306), DB_USER, DB_PASSWORD, and DB_NAME. For AWS RDS, use the endpoint hostname as DB_HOST.

4

Configure your MCP client

Add the MySQL server to your MCP client configuration, supplying database credentials as environment variables.

{
  "mcpServers": {
    "mysql": {
      "command": "node",
      "args": ["/path/to/mysql-mcp-server/src/index.js"],
      "env": {
        "DB_HOST": "localhost",
        "DB_PORT": "3306",
        "DB_USER": "root",
        "DB_PASSWORD": "yourpassword",
        "DB_NAME": "yourdatabase"
      }
    }
  }
}
5

Test the connection

Ask your AI assistant to check the connection status. The get_connection_status tool will confirm the server can reach your database.

MCP MySQL Examples

Client configuration

Claude Desktop configuration for the MCP MySQL server. Replace credentials and path with your actual values.

{
  "mcpServers": {
    "mysql": {
      "command": "node",
      "args": ["/path/to/mysql-mcp-server/src/index.js"],
      "env": {
        "DB_HOST": "mydb.cluster-xyz.us-east-1.rds.amazonaws.com",
        "DB_PORT": "3306",
        "DB_USER": "admin",
        "DB_PASSWORD": "yourpassword",
        "DB_NAME": "production"
      }
    }
  }
}

Prompts to try

Example natural language queries you can run after the server is connected.

- "Show me all tables in the database and describe their structure."
- "How many orders were placed in the last 30 days? Group them by status."
- "Find all users who signed up in 2024 but have never made a purchase."
- "Is the database connection currently healthy?"

Troubleshooting MCP MySQL

Connection refused or ECONNREFUSED error

Verify DB_HOST and DB_PORT are correct. For AWS RDS, ensure your security group allows inbound traffic on port 3306 from your IP. For local MySQL, confirm the service is running with 'mysqladmin ping -h localhost'.

Query blocked — 'operation not permitted' for DROP or ALTER

The server deliberately blocks DROP, TRUNCATE, ALTER, and other destructive DDL statements as a safety measure. Use a direct MySQL client for schema migrations.

Authentication failed for user

Double-check DB_USER and DB_PASSWORD in your config. Ensure the MySQL user has SELECT (and optionally INSERT/UPDATE/DELETE) privileges on DB_NAME. Run 'SHOW GRANTS FOR your_user@\'%\';' in MySQL to verify.

Frequently Asked Questions about MCP MySQL

What is MCP MySQL?

MCP MySQL is a Model Context Protocol (MCP) server that enables interaction with mysql databases (including aws rds and cloud instances) through natural language, supporting query execution, schema inspection, index management, and comprehensive database operations with secure ssl connections. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install MCP MySQL?

Follow the installation instructions on the MCP MySQL GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with MCP MySQL?

MCP MySQL works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is MCP MySQL free to use?

Yes, MCP MySQL is open source and available under the Apache 2.0 license. You can use it freely in both personal and commercial projects.

Browse More Databases MCP Servers

Explore all databases servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "mcp-mysql-server": { "command": "npx", "args": ["-y", "mcp-mysql-server"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use MCP MySQL?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides