Adamic Support

MySQL MCP Server

MySQL MCP Server is the definitive Model Context Protocol server for MySQL — the most comprehensive MySQL MCP server available with 191 specialized tools, 18 observability resources, and 19 AI-powered prompts. Built for developers who demand enterprise-grade features without sacrificing ease of use, it empowers AI assistants like Claude, Cursor, and other MCP clients with unparalleled database capabilities.

🏆 Enterprise-Grade Features

🛠️ 191 Specialized Tools

  • Largest MySQL tool collection for MCP
  • Core CRUD and native JSON functions
  • Advanced spatial/GIS operations
  • Document store management
  • Cluster management tools

📊 18 Observability Resources

  • Real-time schema information
  • Performance metrics and status
  • Process lists and connections
  • Replication status monitoring
  • InnoDB diagnostics

🤖 19 AI-Powered Prompts

  • Query building with best practices
  • Schema design guidance
  • Performance tuning workflows
  • Infrastructure setup guides
  • Migration planning assistance

🔐 OAuth 2.1 + Access Control

  • RFC 9728/8414 compliance
  • Granular scopes (read, write, admin)
  • Database and table-level control
  • Keycloak integration
  • Enterprise-ready security

🎛️ Smart Tool Filtering

  • 24 tool groups + 7 meta-groups
  • Stay within IDE tool limits
  • Starter bundle (38 tools)
  • DBA and AI-specific bundles
  • Mix and match flexibility

🔗 Ecosystem Integrations

  • MySQL Router REST API
  • ProxySQL management
  • MySQL Shell utilities
  • InnoDB Cluster support
  • Group Replication tools

📊 Complete Tool Suite

MySQL MCP Server provides 191 specialized tools across 24 comprehensive groups:

  • Core (8 tools) - Read/write queries, tables, indexes
  • Transactions (7 tools) - BEGIN, COMMIT, ROLLBACK, savepoints
  • JSON (17 tools) - JSON functions, merge, diff, stats
  • Text (6 tools) - REGEXP, LIKE, SOUNDEX
  • Fulltext (4 tools) - Natural language search
  • Performance (8 tools) - EXPLAIN, query analysis, slow queries
  • Optimization (4 tools) - Index hints, recommendations
  • Admin (6 tools) - OPTIMIZE, ANALYZE, CHECK
  • Monitoring (7 tools) - PROCESSLIST, status variables
  • Backup (4 tools) - Export, import, mysqldump
  • Replication (5 tools) - Master/slave, binlog
  • Partitioning (4 tools) - Partition management
  • Router (9 tools) - MySQL Router REST API
  • ProxySQL (12 tools) - ProxySQL management
  • Shell (10 tools) - MySQL Shell utilities
  • Schema (10 tools) - Views, procedures, triggers
  • Events (6 tools) - Event Scheduler management
  • SysSchema (8 tools) - sys schema diagnostics
  • Stats (8 tools) - Statistical analysis tools
  • Spatial (12 tools) - Spatial/GIS operations
  • Security (9 tools) - Audit, SSL, encryption
  • Cluster (10 tools) - Group Replication, InnoDB Cluster
  • Roles (8 tools) - MySQL 8.0 role management
  • DocStore (9 tools) - Document Store collections

🎯 Predefined Shortcuts

Use shortcuts to quickly configure tool sets for your use case:

  • starter (38 tools) - Recommended for general MySQL work
  • essential (15 tools) - Minimal footprint
  • dev-power (45 tools) - Power developer configuration
  • ai-data (44 tools) - AI data analyst focus
  • ai-spatial (43 tools) - AI spatial analyst focus
  • dba-monitor (35 tools) - DBA monitoring
  • dba-manage (33 tools) - DBA management
  • dba-secure (42 tools) - DBA security focus
  • ecosystem (31 tools) - Router, ProxySQL, Shell

🔮 MCP Resources (18)

Real-time database context that AI can access automatically:

  • mysql://schema - Full database schema
  • mysql://tables - Table listing with metadata
  • mysql://variables - Server configuration variables
  • mysql://status - Server status metrics
  • mysql://processlist - Active connections and queries
  • mysql://pool - Connection pool statistics
  • mysql://capabilities - Server version and features
  • mysql://health - Comprehensive health status
  • mysql://performance - Query performance metrics
  • mysql://indexes - Index usage and statistics
  • mysql://replication - Replication status and lag
  • mysql://innodb - InnoDB buffer pool and metrics
  • mysql://events - Event Scheduler status
  • mysql://sysschema - sys schema diagnostics
  • mysql://locks - InnoDB lock contention
  • mysql://cluster - Group Replication/InnoDB Cluster
  • mysql://spatial - Spatial columns and indexes
  • mysql://docstore - Document Store collections

🎯 MCP Prompts (19)

Guided workflows for complex database operations:

  • mysql_query_builder - Construct SQL with security best practices
  • mysql_schema_design - Design schemas with indexes and relationships
  • mysql_performance_analysis - Analyze slow queries with recommendations
  • mysql_migration - Generate migration scripts with rollback
  • mysql_database_health_check - Comprehensive health assessment
  • mysql_backup_strategy - Enterprise backup planning with RTO/RPO
  • mysql_index_tuning - Index analysis and optimization
  • 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
  • mysql_setup_spatial - Spatial/GIS data setup guide
  • mysql_setup_cluster - InnoDB Cluster/Group Replication guide
  • mysql_setup_docstore - Document Store / X DevAPI guide

🔄 Latest Updates (v2.1.0)

Version 2.1.0 brings npm package availability and enhanced distribution:

  • 📦 NPM Package - Available as @neverinfamous/mysql-mcp for easy global installation via npm install -g
  • 🐳 Docker Support - Official image at writenotenow/mysql-mcp:latest
  • ⚡ Performance - Parallelized health queries and batched index queries
  • 🗄️ Configurable Cache - 30-second default TTL via METADATA_CACHE_TTL_MS
  • 📝 MCP 2025-11-25 - Full protocol compliance with safety hints
  • ✅ 1590+ Tests - 97% coverage with strict TypeScript

🚀 Quick Start

NPM (Recommended)

Install globally:

npm install -g @neverinfamous/mysql-mcp

Run with your database:

mysql-mcp --transport stdio --mysql mysql://user:password@localhost:3306/database

Docker

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

From Source

Clone and build:

git clone https://github.com/neverinfamous/mysql-mcp.git && cd mysql-mcp && npm install && npm run build

Run the server:

node dist/cli.js --transport stdio --mysql mysql://user:password@localhost:3306/database

📖 MCP Configuration

Configure for Claude Desktop or Cursor by adding to your MCP settings:

{
  "mcpServers": {
    "mysql-mcp": {
      "command": "node",
      "args": [
        "/path/to/mysql-mcp/dist/cli.js",
        "--transport", "stdio",
        "--tool-filter", "starter"
      ],
      "env": {
        "MYSQL_HOST": "localhost",
        "MYSQL_PORT": "3306",
        "MYSQL_USER": "your_username",
        "MYSQL_PASSWORD": "your_password",
        "MYSQL_DATABASE": "your_database"
      }
    }
  }
}

The --tool-filter option is recommended to stay within IDE tool limits. Use starter for 38 essential tools, or customize with group combinations.

🔗 Database Connection Scenarios

MySQL MCP Server supports flexible connection configurations:

  • MySQL on host machine - Use host.docker.internal when running via Docker
  • MySQL in Docker - Use container name on shared Docker network
  • Remote/Cloud MySQL - Direct hostname connection (RDS, Cloud SQL, Azure)

🔒 Security Features

Security is a top priority with comprehensive protection including OAuth 2.1 authentication with Keycloak integration, SQL injection prevention through parameterized queries, granular access control scopes (read, write, admin, full, db:*, table:*:*), TLS/SSL support for encrypted connections, and audit capabilities for compliance requirements.

For OAuth-enabled deployments:

mysql-mcp --mysql mysql://root:pass@localhost/db \
          --oauth-enabled \
          --oauth-issuer http://localhost:8080/realms/mysql-mcp \
          --oauth-audience mysql-mcp

📚 Resources

Find comprehensive documentation, source code, container images, and installation packages: Documentation Wiki, GitHub Repository, Docker Hub, and npm Package.

🎯 What's Next

MySQL MCP Server represents the most comprehensive MySQL tooling for AI-native workflows. With 191 specialized tools across 24 groups, 18 real-time observability resources, 19 guided prompts for complex operations, OAuth 2.1 enterprise security, and ecosystem integrations for MySQL Router, ProxySQL, and MySQL Shell, it's ready to transform how you work with MySQL databases.

💡 Pro Tip: Start with the starter tool filter for a curated 38-tool experience, explore MCP Resources for instant database insights, and use the ecosystem shortcuts for InnoDB Cluster deployments.

🔗 Related Resources

Explore our MCP Server Hub for additional tools including PostgreSQL MCP Server, SQLite MCP Server, and Memory Journal MCP.

🏆 Why MySQL MCP Matters

MySQL MCP delivers the largest tool collection (191 tools) for any MySQL MCP server, intelligent tool filtering to work within IDE limits, enterprise-grade OAuth 2.1 security with granular access control, first-class ecosystem integrations for MySQL Router, ProxySQL, and MySQL Shell, comprehensive observability with 18 real-time resources, guided workflows through 19 AI-powered prompts, and production-ready reliability with 97% test coverage and strict TypeScript.