MCP Server Mysql logo

MCP Server Mysql

by benborla29

Connects AI clients to MySQL for schema inspection and SQL queries, with opt-in writes and configurable database access controls.

Install MCP Server Mysql

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": {
    "benborla29-mcp-server-mysql": {
      "command": "npx",
      "args": [
        "-y",
        "@benborla29/mcp-server-mysql"
      ],
      "env": {
        "MYSQL_HOST": "YOUR_VALUE_HERE",
        "MYSQL_PORT": "YOUR_VALUE_HERE",
        "MYSQL_USER": "YOUR_VALUE_HERE",
        "MYSQL_PASS": "YOUR_VALUE_HERE",
        "MYSQL_DB": "YOUR_VALUE_HERE"
      }
    }
  }
}

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

Values are written into the snippet above so you can paste it as is. They never leave your browser.

We couldn’t confirm it starts correctly

The install command started, but didn't respond the way we expected when we tried to talk to it.

npx -y @benborla29/mcp-server-mysql

Process exited after initialize, before tools/list: npm WARN deprecated node-domexception@1.0.0: Use your platform's native DOMException instead npm notice npm notice New major version of npm available! 10.1.0 -> 12.0.2 npm notice Changelog: <https://github.com/npm/cli/releases/tag/v12.0.2> npm notice Run `npm install -g npm@12.0.2` to update! npm notice

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 1mo ago.

Overview

Connects MySQL to AI clients through the benborla29/mcp-server-mysql MCP server, exposing SQL execution and table metadata over MCP. It runs as a Node.js process, uses environment variables for database connection settings, and defaults to read-only operation. Reach for it when an agent needs to inspect schemas or query MySQL, including databases accessed through SSH tunnels or multiple configured database connections. Remote HTTP operation, bearer authentication, TLS, schema permissions, and PII redaction are also supported.

Use cases

  • Query MySQL data from Claude Code
  • Inspect tables and columns before generating SQL
  • Restrict agents to read-only database access
  • Enable selected write operations for controlled workflows
  • Query multiple MySQL databases through one MCP connection

Key features

  • Read-only SQL access by default
  • Schema and column metadata resource
  • Opt-in insert, update, and delete permissions
  • Multi-database and SSH tunnel support
  • PII redaction for query results
  • TLS and remote HTTP transport options

Security & health

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

ActiveLast checked Today

Recent health check succeeded.

29/29 checks healthy over the last 77d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 8d ago via OSV.dev · @benborla29/mcp-server-mysql (npm)

Adoption & maintenance

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

GitHub stars2.2kStargazers on the source repository.
npm downloads90kPackage downloads in the last 30 days.
Last commit3mo agoMost recent push to the default branch.
Install checkInconclusiveStarted but did not complete the MCP handshake in our test.
Directory activity3 viewsConfig copies, upvotes, and views on AllMCPs.

How MCP Server Mysql works

What the benborla29/mcp-server-mysql MCP server does

The benborla29/mcp-server-mysql MCP server connects MCP-compatible AI clients to a MySQL database. It exposes a SQL query tool named mysql_query and a mysql://tables resource that returns table and column metadata for the connected database.

Queries are read-only by default. Insert, update, and delete operations can be enabled independently through environment variables, allowing an operator to keep an installation read-only or grant only the write operations it needs. The server also supports per-database read and write permissions in multi-database configurations.

This is intended for MySQL 5.7 or later, with MySQL 8.0 or later recommended. The runtime requirement is Node.js 20 or newer.

How it works

The benborla29/mcp-server-mysql MCP server runs locally as an MCP process for clients such as Claude Desktop or Claude Code. The client starts the process and passes connection settings through environment variables. An AI agent can then call mysql_query to execute SQL or read the table metadata resource to understand the available schema.

Multi-database mode allows queries across multiple databases without reconnecting. The project also includes SSH tunnel support for reaching remote databases. Connections can use SSL/TLS, including a mutual TLS option. For deployments that should not run as a local stdio process, the server provides an HTTP transport with bearer-token authentication.

Results can be configured for automatic PII masking. This is useful when query output may contain sensitive values, but the specific redaction configuration should be reviewed before using the server with production data.

Setup and configuration

Install and run the package with Node.js 20 or newer. A basic configuration supplies the MySQL host, port, username, password, and database name through MYSQL_HOST, MYSQL_PORT, MYSQL_USER, MYSQL_PASS, and MYSQL_DB.

Write access is not enabled by the default configuration. Set ALLOW_INSERT_OPERATION=true, ALLOW_UPDATE_OPERATION=true, or ALLOW_DELETE_OPERATION=true to permit the corresponding operation. These flags can be enabled separately rather than granting all write access at once.

The README provides configuration guidance for Claude Code and Claude Desktop, as well as documentation for Cursor, Codex, local repository use, remote mode, multi-database operation, TLS, SSH tunnels, and PII redaction. The MySQL account must have privileges appropriate to the operations the server is expected to perform.

Tools and capabilities

The primary MCP tool is:

  • mysql_query: executes SQL against the configured MySQL connection. Read operations work by default; write operations depend on the relevant permission flags.

The available resource is:

  • mysql://tables: lists tables and column metadata for the connected database.

Additional supported capabilities include multiple database connections, schema-specific access controls, SSH tunnels, SSL/TLS connections, optional mutual TLS, HTTP transport with bearer authentication, and automatic masking of sensitive data in query results.

Limitations and notes

The benborla29/mcp-server-mysql MCP server requires a reachable MySQL installation and a user with suitable privileges; it does not provide a database itself. The supplied connection details and enabled write flags determine what an agent can access or change. Because SQL execution is exposed to the MCP client, operators should limit database privileges and review write settings before connecting it to production data.

The README identifies Claude Code as an optimized integration and gives a Claude Desktop configuration. Other client support depends on MCP client compatibility and the configuration method documented by the project.

Reviews

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

Frequently Asked Questions about MCP Server Mysql

Run it with Node.js 20 or newer using `npx -y @benborla29/mcp-server-mysql`, then provide the MySQL connection environment variables.

Yes. The README includes a Claude Desktop configuration using the `npx` command and MySQL environment variables.

Set `ALLOW_INSERT_OPERATION=true`, `ALLOW_UPDATE_OPERATION=true`, and/or `ALLOW_DELETE_OPERATION=true` for the operations the agent should be allowed to perform.

Yes. It supports SSH tunnels and also provides a remote HTTP transport with bearer-token authentication.

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 PreviewMCP Server Mysql AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/benborla29-mcp-server-mysql?style=directory)](https://allmcps.com/mcp/benborla29-mcp-server-mysql)
HTML Embed
<a href="https://allmcps.com/mcp/benborla29-mcp-server-mysql"><img src="https://allmcps.com/api/badge/benborla29-mcp-server-mysql?style=directory" alt="MCP Server Mysql on AllMCPs" /></a>