← Back to directory
M

MySQL MCP Server

Community
A read-only MySQL MCP server for querying databases through Claude Desktop.
Category
Database #35 of 58
Stars
★ 7 Popular
Transport
stdio (local process)
Runtime
Node.js 16+
Credentials
No credential needed
License
MIT
Last commit
Tools
3
53FMRS · D

The MySQL MCP server provides a convenient way to query read-only MySQL databases via Claude using natural language. It supports dynamic connections and per-query overrides, but its security relies solely on query validation, so a dedicated read-only user is recommended. Its functionality is limited, making it suitable for analysis and development scenarios, but not for production or write-heavy use cases.

Strongest · Documentation 14/20 Weakest · Security and permissions 8/20

Reliability
9/20
Security and permissions
8/20
Maintenance
9/20
Documentation
14/20
Setup experience
13/20
Why each score
Reliability 9/20
README claims SELECT-only enforcement but provides no tests or evidence of how statements are parsed or that multi-statement/comment bypasses are blocked; no CI or test files shown; dynamic connection feature lacks documented error handling. Deducted for no execution evidence, no test coverage, and unknown SQL-validation strength.
Security and permissions 8/20
No malware, credential theft, or exfiltration found; no red-line issues. However, runtime connection strings allow connecting to arbitrary hosts, SELECT-only relies on opaque blocklist-style validation, passwords sit in plaintext env vars, and there is no row-limit or dangerous-operation confirmation. Deducted for expanded data boundary via dynamic connections and undisclosed validation mechanics.
Maintenance 9/20
Version 0.2.0, MIT license, 7 stars, 11 open issues; no evidence of release cadence, dependency updates, or security-response channel; no changelog visible. Deducted for thin maintenance evidence and unknown issue responsiveness.
Documentation 14/20
Thorough docs: multiple install paths, full config examples, env var table, connection-string format, dynamic-connection workflow, security guidance, and troubleshooting. Deducted for missing limitations/performance notes, cost disclosure, and unclear SELECT-validation boundaries (subqueries, multi-statement).
Setup experience 13/20
One-command npx install plus complete Claude Desktop/Claude Code JSON examples; steps are clear and cross-platform (macOS/Windows). Deducted for unverified install path (no CI/tests shown), user-managed Node specifics (mise), and no post-install verification step.

Static review · not runListed 2026-09-08

Read the FMRS scoring method →

Fit and risk

What it can accessConnects to a database

Best for

  • Data analysts and developers who want to query read-only MySQL data using natural language
  • Claude Desktop users who need to interact with local MySQL databases seamlessly
  • Teams that need to query MySQL without directly writing SQL

Not for

  • Applications that require write or modify operations on the database
  • Applications that need to connect to non-MySQL databases (e.g., PostgreSQL)
  • Production environments without additional security measures and a dedicated read-only user

Required permissions

  • Requires Node.js v16 or higher
  • Requires a MySQL database server
  • Requires Claude Desktop or Claude Code
  • Requires database credentials (via environment variables or connection string)
  • Grants only SELECT operations if credentials are limited, but if broad credentials are used, read access to all data is possible

Risks and side effects

  • Security may be misleading: the server only blocks non-SELECT statements, but if the provided credentials have write permissions, data could be modified; use a dedicated read-only user
  • Data privacy: database credentials are stored in environment variables, accessible to other processes on the same system
  • Network exposure: if the MySQL server is exposed, unauthorized access is possible; ensure network security
  • Resource usage: complex queries may consume significant resources; monitor query performance

Setup

Before you start

Runtime:Node.js 16+

DB_HOST required MySQL server hostname; defaults to mysql, typically localhost locally.
DB_DATABASE required Name of the database to connect to; use your own database name.
DB_USERNAME required MySQL username; a dedicated read-only (SELECT-only) user is recommended.
DB_PASSWORD requiredsecret MySQL password, from your own MySQL account settings.
Other optional settings (1)
DB_PORT optional MySQL server port; defaults to 3306.

Recommended: Use Claude Code CLI: run claude mcp add mysql -s user -- npx -y @hovecapital/read-only-mysql-mcp-server@latest, then set environment variables DB_HOST, DB_PORT, DB_DATABASE, DB_USERNAME, DB_PASSWORD. Alternatively, manually edit the Claude Desktop configuration file (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json; Windows: %APPDATA%\Claude\claude_desktop_config.json) and add the server configuration under mcpServers.

claude_desktop_config.json
{
  "mcpServers": {
    "mysql": {
      "command": "npx",
      "args": ["-y", "@hovecapital/read-only-mysql-mcp-server@latest"],
      "env": {
        "DB_HOST": "localhost",
        "DB_PORT": "3306",
        "DB_DATABASE": "your_database_name",
        "DB_USERNAME": "your_username",
        "DB_PASSWORD": "your_password"
      }
    }
  }
}

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": {
    "mysql": {
      "command": "npx",
      "args": [
        "-y",
        "@hovecapital/read-only-mysql-mcp-server@latest"
      ],
      "env": {
        "DB_HOST": "localhost",
        "DB_PORT": "3306",
        "DB_DATABASE": "your_database_name",
        "DB_USERNAME": "your_username",
        "DB_PASSWORD": "your_password"
      }
    }
  }
}

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

Terminal
claude mcp add mysql -e DB_HOST=localhost -e DB_PORT=3306 -e DB_DATABASE=your_database_name -e DB_USERNAME=your_username -e DB_PASSWORD=your_password -- npx -y @hovecapital/read-only-mysql-mcp-server@latest

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

Check that it works

After restarting the client, ask "What tables are in my database?" — if the connect/query tools appear in the tool list and it returns table names, the setup works.

Troubleshooting

  1. Config not taking effect after restart: verify you edited the correct config file and fully restart Claude.
  2. Connection failures: check MySQL is running, verify credentials, ensure network connectivity.
  3. Path errors: if manually installed, ensure the absolute path to dist/index.js is correct.
  4. JSON syntax issues: validate the claude_desktop_config.json format.
  5. View logs: run `node dist/index.js` to see server logs.

Things to try

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

  • Show me all tables in my database
  • What's the structure of the users table?
  • Get the first 10 records from the products table
  • How many orders were placed last month?

Tools 3

connect writes
Connect to a MySQL database using a connection string; the connection persists until changed or disconnected.
disconnect writes
Disconnect from the current runtime database and revert to environment-configured defaults.
query read-only
Execute a read-only SQL query on the currently connected database, optionally overriding the connection for that query.

Use cases

Query database tables and data using natural language
View table structures without writing SQL manually
Fetch sample data for analysis
Provide non-technical users with database query capability

Supported clients

Claude Desktop

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

Overview

The MySQL MCP Server is a Model Context Protocol implementation that enables Claude Desktop to interact with MySQL databases via natural language. It only executes read-only SQL queries, such as SELECT, and blocks data-modifying operations. It features dynamic connection configuration, allowing runtime switching between databases via connection strings. It is distributed as an npm package @hovecapital/read-only-mysql-mcp-server and is also available on GitHub.

Similar servers

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