Skip to content
Chris & Mike edited this page May 2, 2026 · 28 revisions

MySQL MCP Server

Enterprise-grade MySQL MCP Server with OAuth 2.1 authentication, connection pooling & tool filtering – TypeScript Edition

GitHub Docker Pulls License: MIT Version


What is mysql-mcp?

A MySQL MCP Server that enables AI assistants (Claude, Cursor, etc.) to interact with MySQL databases through the Model Context Protocol with deterministic error handling. It provides 230+ specialized tools, 18 resources, and 19 AI-powered prompts for database operations, performance analysis, and administration.

🚀 Quick Links

Resource Description
Installation Prerequisites and setup guide
Configuration Environment variables, MCP client configs
Tool-Filtering Reduce tool count for IDE limits
Tool-Reference Complete list of all 230+ tools
Code-Mode Sandboxed code execution (70-90% token savings)
Resources Database observability (18 resources)
Prompts AI-powered workflows (19 prompts)
Audit-Trail JSONL forensic logging & token metrics

📦 Deployment Options

  • NPM: npm install -g @neverinfamous/mysql-mcp (recommended)
  • Docker: docker run -i --rm writenotenow/mysql-mcp:latest

🔥 Core Features

  • 230+ MySQL Tools across 25 categories
  • Deterministic Error Handling — structured {success, error, code, category, suggestion, recoverable} on every tool
  • Audit Trail & Token Logging — JSONL forensic logging with pre-mutation snapshots
  • 18 Resources for database observability
  • 19 AI-Powered Prompts for guided workflows
  • Worker Sandbox Isolation — Code Mode executes in a separate V8 isolate via worker_threads with RPC bridge, enforced heap limits, and hard timeouts
  • Token-Optimized Payloads — Tools with large responses offer optional summary, limit, and compact flags to reduce token usage
  • Tool Filtering Shortcuts (starter, dev-power, dba-monitor, etc.)
  • Connection Pooling via mysql2
  • OAuth 2.1 enterprise authentication support
  • Advanced Encryption (TLS/SSL, masking, compliance tools)
  • Docker Deployment with multi-arch images

🛠️ Tool Categories

Category Tools Description
Core 8 CRUD, schema, tables, indexes
Transactions 7 BEGIN, COMMIT, ROLLBACK, savepoints
JSON 17 JSON functions + merge, diff, stats
Text 6 REGEXP, LIKE, SOUNDEX
FULLTEXT 5 Natural language search
Performance 8 EXPLAIN, query analysis
Optimization 4 Index hints, recommendations
Admin 6 OPTIMIZE, ANALYZE, CHECK
Monitoring 7 PROCESSLIST, status variables
Backup 4 Export, import, mysqldump
Replication 5 Master/slave, binlog
Partitioning 4 Partition management
Router 9 MySQL Router REST API
ProxySQL 11 Proxy management
Shell 10 MySQL Shell utilities
Schema 11 Views, procedures, triggers, constraints
Events 6 Event Scheduler management
sys Schema 8 MySQL sys schema diagnostics
Statistics 8 Statistical analysis tools
Spatial/GIS 12 Geometry operations, distance, GeoJSON
Security 9 Audit, SSL, encryption, masking
Cluster 10 Group Replication, InnoDB Cluster
Roles 8 MySQL 8.0 role management
Document Store 9 JSON document collections
Code Mode 1 Sandboxed code execution (worker-thread V8 isolate)

📚 Advanced Topics

Topic Description
OAuth OAuth 2.1 enterprise authentication
HTTP-Transport Dual HTTP transport deployment guide
MySQL-Router Configure MySQL Router tool access
ProxySQL Configure ProxySQL admin access
MySQL-Shell Configure MySQL Shell integration
MCP-Inspector Visual debugging guide

🔗 External Links


Status: Production/Stable

Clone this wiki locally