← Back to directory
M

MySQL MCP Server

Community
Query MySQL databases through MCP with read-only defaults.
Category
Database #38 of 58
Stars
★ 2.2k Very popular
Transport
stdio (local process)
Runtime
Node.js 20+ · Hosted (no local runtime)
Credentials
No credential needed
License
MIT
Last commit
Tools
1
50FMRS · D

This server is suited to using MCP with Claude and other clients to inspect MySQL schemas and query data. It defaults to read-only access and offers SSH tunneling, multi-database mode, PII redaction, and SSL/TLS support. Write operations require explicit environment flags, so database privileges and credentials should be configured carefully.

Strongest · Setup experience 12/20 Weakest · Reliability 8/20

Reliability
8/20
Security and permissions
10/20
Maintenance
9/20
Documentation
11/20
Setup experience
12/20
Why each score
Reliability 8/20
The README describes a mysql_query tool and mysql://tables resource, with read-only behavior and optional writes. However, the server manifest is not cached and no source files, tests, or CI execution evidence are provided, so initialization, tool-list behavior, parameters, error handling, and dependency control cannot be verified. Points are deducted for this uncertainty.
Security and permissions 10/20
The evidence says the server is read-only by default, enables write operations through separate environment flags, and mentions SSH, TLS, bearer authentication, and PII redaction. These claims are only in the unverified README; implementation of privileges, dangerous-operation confirmation, data boundaries, and remote-mode security are not reviewable. No stated red-line risk is established, but the evidence is insufficient for a high score.
Maintenance 9/20
The project states an MIT license, is not archived, and provides a repository and contribution path. Stars cannot add points, and there is no evidence here of releases, commit activity, dependency updates, issue response, maintainer accountability, or a security-response channel, so maintenance earns only a modest score.
Documentation 11/20
The README gives Node.js and MySQL requirements, npx and client configuration examples, environment variables, and an overview of tools and resources. It also links installation, configuration, testing, troubleshooting, and specialized documentation. Because those documents are not supplied, tool parameters, limits, costs, authentication details, and reviewable failure handling remain unclear.
Setup experience 12/20
The README provides a Node.js v20+ prerequisite, an npx installation command, and Claude Code/Claude Desktop configuration examples, making the basic path clear. However, no source or verifiable CI/test evidence is supplied, and platform compatibility, connection-failure diagnosis, and advanced-mode configuration are not demonstrated, so the score remains below the upper range.

Static review · not runListed 2026-07-29

Read the FMRS scoring method →

Fit and risk

What it can accessConnects to a database

Best for

  • Developers and data teams that need AI-assisted MySQL schema inspection or querying
  • Workflows that prefer read-only database access by default
  • Deployments requiring SSH, SSL/TLS, or PII-redaction capabilities

Not for

  • Environments that do not use MySQL
  • Workflows requiring write access by default without explicit permission configuration
  • Environments unable to provide suitable database credentials or network connectivity

Required permissions

  • Requires configuration for the MySQL host, port, username, password, and database name
  • The database user needs privileges matching the intended queries and any enabled write operations
  • Remote database access may require SSH tunnel configuration
  • When write flags are enabled, the server can perform the corresponding insert, update, or delete operations

Risks and side effects

  • Although read-only by default, enabled write flags can modify or delete data
  • Database credentials are supplied through environment variables and should be protected
  • SQL queries may expose sensitive data; PII redaction can help reduce exposure
  • Misconfigured database privileges, SSL/TLS, or remote access may broaden data exposure

Setup

Before you start

Runtime:Node.js 20+ · Hosted (no local runtime)

MYSQL_HOST required MySQL server address, e.g. 127.0.0.1, per your database environment.
MYSQL_USER required MySQL username with read privileges on the target database.
MYSQL_PASS requiredsecret Password for that MySQL user, from your database account settings.
MYSQL_DB required Name of the database to connect to; it must already exist.
Other optional settings (4)
MYSQL_PORT optional MySQL port, defaults to 3306.
ALLOW_INSERT_OPERATION optional Set true to enable INSERT writes; disabled by default.
ALLOW_UPDATE_OPERATION optional Set true to enable UPDATE writes; disabled by default.
ALLOW_DELETE_OPERATION optional Set true to enable DELETE writes; disabled by default.

Requires Node.js v20+, MySQL 5.7+ (8.0+ recommended), and a MySQL user with appropriate privileges. Start the server with npx and configure MYSQL_HOST, MYSQL_PORT, MYSQL_USER, MYSQL_PASS, and MYSQL_DB. Claude Desktop can use the JSON configuration shown in the README. Write operations are disabled by default; when needed, enable them individually with ALLOW_INSERT_OPERATION=true, ALLOW_UPDATE_OPERATION=true, or ALLOW_DELETE_OPERATION=true.

claude_desktop_config.json
{"mcpServers":{"mcp_server_mysql":{"command":"npx","args":["-y","@benborla29/mcp-server-mysql"],"env":{"MYSQL_HOST":"127.0.0.1","MYSQL_PORT":"3306","MYSQL_USER":"root","MYSQL_PASS":"your_password","MYSQL_DB":"your_database"}}}}

Shown for Claude Desktop. Other clients may use a different file or key (VS Code uses "servers") — the configurator below converts it.

.vscode/mcp.json
{
  "servers": {
    "mcp_server_mysql": {
      "command": "npx",
      "args": [
        "-y",
        "@benborla29/mcp-server-mysql"
      ],
      "env": {
        "MYSQL_HOST": "127.0.0.1",
        "MYSQL_PORT": "3306",
        "MYSQL_USER": "root",
        "MYSQL_PASS": "your_password",
        "MYSQL_DB": "your_database"
      }
    }
  }
}

Goes in your project's .vscode/mcp.json (VS Code uses a "servers" key).

Terminal
claude mcp add mcp_server_mysql -e MYSQL_HOST=127.0.0.1 -e MYSQL_PORT=3306 -e MYSQL_USER=root -e MYSQL_PASS=your_password -e MYSQL_DB=your_database -- npx -y @benborla29/mcp-server-mysql

Run it in a terminal; replace any <…> placeholders with your own values first.

Check that it works

The mysql_query tool should appear in the client's tool list; alternatively ask "what tables are in my database" — a returned schema proves the connection works.

Troubleshooting

  1. Verify Node.js is v20 or newer and that the MySQL version meets the requirements
  2. Check MYSQL_HOST, MYSQL_PORT, MYSQL_USER, MYSQL_PASS, and MYSQL_DB values
  3. Confirm that the MySQL user has the required privileges and that the database is reachable
  4. For remote connection failures, inspect the SSH tunnel configuration
  5. When using SSL/TLS or mTLS, check the connection settings
  6. Run the repository tests and consult the troubleshooting documentation

Things to try

Once connected, you can ask your AI assistant things like:

  • List all tables and their columns in the connected database
  • Show the 10 most recent rows from the users table
  • Count orders per month from the orders table
  • Inspect the schema read-only and don't change any data

Tools 1

mysql_query read-only
Executes SQL queries; read-only by default, with write operations enabled through configuration.

Use cases

Inspecting MySQL tables and column metadata
Running read-only SQL queries with AI assistance
Connecting to remote databases through SSH tunnels
Querying multiple databases in multi-DB mode
Automatically masking sensitive data in query results

Supported clients

Claude Desktop
Claude Code

Listed from the project's documentation, not tested by this site.

Overview

An MCP server that gives Claude and other large language models access to MySQL databases for schema inspection and SQL queries. Access is read-only by default, with optional write operations controlled by environment flags.

Similar servers

Source revision b9c714e18242 Data synced 2026-10-19 Read the FMRS scoring method