MySQL

Provides a comprehensive MCP server enabling AI assistants to interact with MySQL databases for queries, schema design, and maintenance.
  • typescript

3

GitHub Stars

typescript

Language

3 months ago

First Indexed

3 weeks ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "neverinfamous-mysql-mcp": {
      "command": "mysql-mcp",
      "args": [
        "--transport",
        "stdio",
        "--mysql",
        "mysql://user:password@localhost:3306/database"
      ],
      "env": {
        "MYSQL_HOST": "localhost",
        "MYSQL_PORT": "3306",
        "MYSQL_USER": "your_user",
        "MYSQL_DATABASE": "your_database",
        "MYSQL_PASSWORD": "your_password"
      }
    }
  }
}

You are using the mysql-mcp server, a high-performance MCP (Model Context Protocol) implementation for MySQL. It lets AI assistants query, design, and manage MySQL databases through a structured, extensible toolset with built‑in security, observability, and orchestration features. This guide shows you how to install, configure, and operate mysql-mcp so you can connect your MCP clients and start leveraging its capabilities.

How to use

Once mysql-mcp is running with a stdio interface, you connect your MCP client (such as Cursor IDE or Claude Desktop) to the local process. You interact through the MCP protocol, which exposes a rich set of tools for core CRUD operations, JSON handling, schema exploration, performance analysis, and more. Use the provided prompts to guide queries, schema design, migrations, and health checks. For local development, the stdio transport is the simplest path; for remote deployments or enterprise setups, you can enable HTTP/SSE transport and OAuth 2.1 authentication.

How to install

Prerequisites for running mysql-mcp: install Node.js 24 or newer, ensure a MySQL server is accessible (5.7+ or 8.0+), and have npm or yarn available.

# Install globally (recommended)
npm install -g @neverinfamous/mysql-mcp

# Run with stdio transport and a local MySQL connection
mysql-mcp --transport stdio --mysql mysql://user:password@localhost:3306/database

# Or run with npx without installing globally
npx @neverinfamous/mysql-mcp --transport stdio --mysql mysql://user:password@localhost:3306/database

If you prefer using Docker, you can start the server in a container and connect to your MySQL instance from within the same network.

docker run -i --rm writenotenow/mysql-mcp:latest \
  --transport stdio \
  --mysql mysql://user:password@host.docker.internal:3306/database

From source, you can clone the repository, install dependencies, build, and run the CLI directly from the built distribution.

git clone https://github.com/neverinfamous/mysql-mcp.git
cd mysql-mcp
npm install
npm run build
node dist/cli.js --transport stdio --mysql mysql://user:password@localhost:3306/database

Additional configuration and notes

Authentication can be enabled to secure access using OAuth 2.1 with an identity provider such as Keycloak. When OAuth is enabled, you must configure the issuer and audience, and you can expose MCP endpoints over HTTP/SSE for remote clients.

Prompts and tooling overview

Mysql-mcp includes a collection of intelligent prompts to assist with common tasks such as building queries, designing schemas, analyzing performance, planning migrations, and more. You can invoke prompts to streamline workflows and maintain best practices across your MySQL workflow.

Security and observability notes

The server provides observability resources such as schema views, performance metrics, process lists, replication status, and InnoDB diagnostics. It also supports secure connections (TLS/SSL) and parameterized queries to protect against injection-based threats.

Developer tips

For local IDE integration, keep the default stdio transport. If you need remote access for multiple clients, consider HTTP mode with proper OAuth 2.1 configuration and TLS certificates. Always keep credentials in environment variables or secret stores, and avoid committing them in code.

Available tools

mysql_query_builder

Construct SQL queries with security best practices

mysql_schema_design

Design table schemas with indexes and relationships

mysql_performance_analysis

Analyze slow queries with optimization recommendations

mysql_migration

Generate migration scripts with rollback options

mysql_database_health_check

Comprehensive database health assessment

mysql_backup_strategy

Enterprise backup planning with RTO/RPO

mysql_index_tuning

Index analysis and optimization workflow

mysql_setup_router

MySQL Router configuration guide

mysql_setup_proxysql

ProxySQL configuration guide

mysql_setup_replication

Replication setup guide

mysql_setup_shell

MySQL Shell usage guide

mysql_tool_index

Complete tool index with categories

mysql_quick_query

Quick query execution shortcut

mysql_quick_schema

Quick schema exploration

mysql_setup_events

Event Scheduler setup guide

mysql_sys_schema_guide

sys schema usage and diagnostics guide

mysql_setup_spatial

Spatial/GIS data setup guide

mysql_setup_cluster

InnoDB Cluster/Group Replication guide

mysql_setup_docstore

Document Store / X DevAPI guide

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational