Mysql MCP logo

Mysql MCP

Connect AI agents to MySQL with 106 tools, observability resources, guided prompts, OAuth 2.1, and stdio or stateless HTTP transport.

Install Mysql MCP

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "mysql-mcp-2": {
      "command": "npx",
      "args": [
        "-y",
        "@neverinfamous/mysql-mcp"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

We couldn’t confirm it starts correctly

We ran the install command but it didn't respond within our test window — this can mean a slow first-time install rather than a real problem.

npx -y @neverinfamous/mysql-mcp

No response to initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

mysql-mcp connects AI agents to MySQL through MCP, exposing tools for CRUD, JSON, spatial data, document stores, clusters, and database administration. It supports stdio, streamable HTTP, and stateless HTTP deployments, with connection pooling and optional Code Mode for consolidating operations in a sandboxed V8 isolate. Resources provide schema, health, performance, replication, InnoDB, lock, and telemetry data, while prompts guide query, schema, tuning, and observability workflows. Reach for it when an agent needs structured MySQL access with OAuth 2.1 controls, parameterized queries, audit logging, and Docker deployment.

Use cases

  • Run parameterized MySQL queries from an AI agent
  • Explore schemas, indexes, processes, and server health
  • Inspect replication, InnoDB, cluster, and lock status
  • Guide query building and performance-tuning workflows
  • Deploy an observable MySQL agent service with Docker

Key features

  • 106 MySQL-focused MCP tools
  • Stdio and stateless or streamable HTTP transport
  • OAuth 2.1 scopes with Keycloak integration
  • Schema, performance, replication, and health resources
  • Sandboxed Code Mode and token-optimized responses
  • Docker deployment with Prometheus and Grafana support

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

16/16 checks healthy over the last 77d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 17d ago via OSV.dev · @neverinfamous/mysql-mcp (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars10Stargazers on the source repository.
npm downloads657Package downloads in the last 30 days.
Last commit6d agoMost recent push to the default branch.
Install checkInconclusiveDidn't respond in our test window — often a slow first install.
Directory activity10 viewsConfig copies, upvotes, and views on AllMCPs.

How Mysql MCP works

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}.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Mysql MCP

mysql-mcp is an MCP server that connects AI agents to MySQL databases through 106 tools for queries, CRUD, JSON, spatial data, document stores, clusters, and administration. It also exposes schema and performance resources, guided prompts, OAuth 2.1 access control, and stdio or HTTP transports.

Install it globally with `pnpm add -g @neverinfamous/mysql-mcp`, or run it directly with `npx @neverinfamous/mysql-mcp`. Node.js 24 or newer, pnpm, and a MySQL server are listed prerequisites.

Pass a MySQL connection URI with the `--mysql` option, such as `mysql-mcp --transport stdio --mysql "mysql://mcp_user:secure_password@localhost:3306/testdb"`. The same option is used in the Docker command.

Yes, Docker is supported through the `writenotenow/mysql-mcp:latest` image. The documented command mounts data and log directories and passes the transport, allowed I/O roots, and MySQL connection URI.

Yes, mysql-mcp supports streamable HTTP and stateless HTTP in addition to stdio. The Docker Compose example exposes the MCP server at `http://localhost:3000`.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewMysql MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/mysql-mcp-2?style=directory)](https://allmcps.com/mcp/mysql-mcp-2)
HTML Embed
<a href="https://allmcps.com/mcp/mysql-mcp-2"><img src="https://allmcps.com/api/badge/mysql-mcp-2?style=directory" alt="Mysql MCP on AllMCPs" /></a>