# mysql-mcp [Health: Active]

**Category:** 🗄️ Databases  
**Repository:** https://github.com/neverinfamous/mysql-mcp.git  
**GitHub Stars:** 10  
**npm Downloads (last month):** 657  
**Views:** 10  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/mysql-mcp-2

## Description
Enterprise-grade MySQL MCP Server with OAuth 2.0, 106 tools, and Docker deployment

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "mysql-mcp": {
    "command": "npx",
    "args": ["-y","@neverinfamous/mysql-mcp"]
  }
}
```

## Documentation

## What mysql-mcp does

mysql-mcp exposes a MySQL database to AI agents through the Model Context Protocol. Its 106 tools cover core database operations as well as JSON data, spatial features, document-store collections, clusters, and related MySQL ecosystem utilities. The server also provides guided prompts for common workflows, including query execution, schema exploration, performance tuning, infrastructure setup, and tool discovery.

Database visibility is available through MCP resources. These resources can expose the schema, table metadata, server variables, status information, process lists, pool statistics, health details, query performance, index usage, replication lag, InnoDB metrics, event schedules, locks, cluster state, spatial structures, document-store collections, audit information, and server help.

## How it works

The server can run over stdio for local MCP clients or over streamable and stateless HTTP for networked deployments. Database connections use a built-in pool intended for concurrent access. Queries use parameterized execution and strict input validation, and responses use structured errors with actionable suggestions.

Code Mode groups operations inside a sandboxed V8 isolate to reduce the amount of tool traffic and model context required for multi-step work. Optional response controls can reduce payload size when handling large results. Tool groups and shortcuts help limit the visible tool set for clients with tool-count constraints.

OAuth 2.1 provides access control through scopes and can integrate with Keycloak. TLS/SSL connections, data-masking controls, encryption monitoring, audit logging, and Prometheus metrics support secured and observable deployments. The server also includes integrations for MySQL Router, ProxySQL, and MySQL Shell utilities.

## Setup and configuration

The documented prerequisites are Node.js 24 or newer, Bun for repository automation scripts, pnpm, and access to a MySQL server. Install the package globally with pnpm:

```bash
pnpm add -g @neverinfamous/mysql-mcp
```

Run it over stdio by supplying a MySQL connection URI:

```bash
mysql-mcp --transport stdio --mysql "mysql://mcp_user:secure_password@localhost:3306/testdb"
```

The package can also run without a global installation through `npx`. A Docker image is available as `writenotenow/mysql-mcp:latest`; Docker examples mount data and log directories and pass the transport, allowed I/O roots, and MySQL URI as command-line options.

A supplied Docker Compose example starts the MCP server, MySQL, Redis, and observability sidecars. The example includes Datadog, OpenTelemetry, Prometheus, and Grafana components, with the MCP endpoint exposed on port 3000 and Grafana on port 3001.

## Tools and capabilities

- Core CRUD and query operations
- JSON, spatial, document-store, and cluster support
- MySQL Router, ProxySQL, and MySQL Shell management
- Guided prompts such as `mysql_quick_query` and `mysql_quick_schema`
- Schema, health, performance, replication, InnoDB, and lock resources
- Prometheus metrics, audit trails, and structured error responses
- OAuth 2.1 scopes and Keycloak integration
- stdio, streamable HTTP, and stateless HTTP transports

The `mysql_tool_index` prompt helps agents discover the available tool groups. Resource URIs include forms such as `mysql://schema`, `mysql://health`, `mysql://performance`, `mysql://replication`, `mysql://audit`, and `mysql://help/{group}`.

_Full upstream README: https://allmcps.com/mcp/mysql-mcp-2/readme_

