-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Enterprise-Grade, Production-Ready MySQL MCP Server with OAuth 2.1, Extensive Specialized Tool Library, and Code Mode (mysql_execute_code) – TypeScript Edition
Value Proposition An enterprise-grade MySQL MCP server engineered for autonomous AI workflows. It seamlessly unites high-performance Code Mode sandboxing, deterministic schema boundaries, and native OAuth 2.1 authentication to ensure secure, resilient database operations at scale. Gain continuous insights with robust metrics and real-time observability.
mysql-mcp modernizes how autonomous AI agents interface with enterprise infrastructure, bridging the gap between intelligent reasoning and deterministic data execution. By combining advanced native V8 sandboxing, deterministic schema validation, and rigorous connection pooling, it transforms your database into an unstoppable, AI-ready engine purpose-built for the enterprise.
Minimize token overhead and safely execute complex, multi-step operations via the sandboxed Code Mode. Lock down your infrastructure with robust OAuth 2.1 authentication and strict execution boundaries. This server modernizes database operations, empowering AI agents to perform securely at any scale.
npx -y @neverinfamous/mysql-mcp --transport stdio --allowed-io-roots "/data" --mysql mysql://user:password@localhost:3306/database| Resource | Description |
|---|---|
| Installation | Prerequisites and setup guide |
| Configuration | Environment variables, MCP client configs |
| Tool Filtering | Reduce tool count for IDE limits |
| Tools | Curated Tool Showcase |
| Code Mode | Sandboxed code execution (mysql_execute_code) |
| Resources | Database observability resources |
| Observability & Telemetry | System telemetry, token metrics, Datadog, Prometheus, Grafana |
| Prompts | AI-powered multi-step workflows with sandboxed Code Mode |
| Audit Trail | JSONL forensic logging |
-
PNPM:
pnpm add -g @neverinfamous/mysql-mcp -
Docker:
docker run -i --rm \ -e MYSQL_HOST=host.docker.internal \ -e MYSQL_USER=user \ -e MYSQL_PASSWORD=password \ -e MYSQL_DATABASE=database \ -e ALLOWED_IO_ROOTS=/data \ neverinfamous/mysql-mcp:latest \ --transport stdio
-
Token-Optimized Payloads — Tools with large responses offer
summary,limit, andcompactflags. These flags significantly reduce token usage. - Adaptive Instruction Architecture — The system intelligently loads targeted help content based on the active toolset. This preserves valuable token bandwidth.
- Connection Pooling via mysql2
- OAuth 2.1 standard authentication support
- Advanced Encryption (TLS/SSL, masking, compliance tools)
- Deterministic Error Handling — All system errors are rigorously managed. Returns enriched, actionable ErrorResponse payloads. This ensures resilient execution.
- Distributed Rate Limiting — Redis backs both HTTP Transport and Code Mode. Automatic in-memory fallback supports high-availability environments.
- Extensive Specialized Tool Library across categories (including Code Mode)
- Native Sandbox Isolation — Code Mode executes within a native isolated-vm V8 instance. Features include synchronous callbacks, enforced heap limits, and hard timeouts.
- AI-Powered Prompts for guided multi-step workflows featuring sandboxed Code Mode
- Shortcuts for rapid tool filtering
- Docker Deployment with multi-arch images
- Ecosystem Integrations for MySQL Router, ProxySQL, and MySQL Shell
- Resource Subscriptions — Native MCP subscriptions deliver real-time schema and status update notifications.
- Progress Tracking — The system emits real-time progress notifications for long-running administrative operations.
- Audit Trail — JSONL forensic logging with pre-mutation snapshots and token metrics
- Observability Resources for database observability, including Datadog and OpenTelemetry pipeline integrations
-
Prometheus Metrics Export (
/metrics) and Pre-configured Grafana Dashboard
mysql-mcp is designed as a secure, production-ready middleware layer. It bridges AI agents and MySQL infrastructure. It enforces strict data boundaries, provides distributed rate limiting, and supports high-throughput connection pooling. It offers multi-transport capabilities (STDIO and streamable HTTP architecture) and native OAuth 2.1 support. It integrates seamlessly into local development environments. It also supports complex cloud-native architectures. This ensures secure, autonomous database operations at scale.
Discover a comprehensive suite of tools carefully designed to streamline database management by providing both high-level insights and granular control.
| Category | Description |
|---|---|
| Core Database | CRUD, schema, indexing, transactions, and text search |
| Performance & Admin | EXPLAIN, insights, anomalies |
| Ecosystem & Cloud | Replication, cluster, backup tools |
| Advanced Data | Vector embeddings, JSON document store |
| Code Mode | Sandboxed TypeScript/JavaScript execution (mysql_execute_code) |
| Topic | Description |
|---|---|
| OAuth | OAuth 2.1 authentication |
| HTTP Transport | Enterprise HTTP transport deployment guide |
| MySQL Router | HA routing and InnoDB Cluster |
| MySQL Shell | Advanced operations and AdminAPI |
| Test Ecosystem | Validate and test external integrations |
| Schema | Strict schema boundaries and introspection |
| MCP Inspector | Visual debugging guide |
| Capacity Planning | Database sizing, caching, maintenance, token budgets |
| Performance Tuning | Connection pools, query analysis, Code Mode efficiency |
Engineered for high-throughput operations, the server delivers microsecond-level latency across schema parsing, rate limiting, and Code Mode sandbox initialization. For comprehensive benchmark data, refer to Performance Tuning.
- Strict Security Standards: Implements OAuth 2.1 validator middleware for secure integrations.
- Native Standard Schema: Tools leverage Zod's Standard Schema implementation. This supports sophisticated aliases and type coercion. It preserves standard JSON Schema generation. It accelerates agent integrations.
-
Graceful error handling: Integrates Standard Schema interfaces via strictly typed Zod boundaries (
.safeParse()). This provides deterministic, type-safe I/O boundaries. They gracefully reject hallucinated AI payloads. They do not throw unhandled exceptions.
- 🔍 AI Wiki Search
- GitHub Repository
- Docker Hub
- npm/pnpm Package
- MCP Registry
- Changelog
- Security Policy
Status: Production/Stable
Unlock autonomous database orchestration with an enterprise-grade MySQL MCP server. Featuring blazing-fast sandboxed Code Mode, uncompromising schema enforcement, and seamless ecosystem integrations to power secure, intelligent AI workflows.
- Installation
- Configuration
- Architecture
- HTTP Transport
- Tool Filtering
- Code Mode
- Tools
- Prompts
- Resources
- Observability & Telemetry