Read Only Local Mysql MCP Server logo

Read Only Local Mysql MCP Server

Runs validated, read-only MySQL queries through MCP with configurable default and runtime database connections.

Install Read Only Local Mysql MCP Server

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": {
    "read-only-local-mysql-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@hovecapital/read-only-mysql-mcp-server@latest"
      ],
      "env": {
        "DB_HOST": "YOUR_VALUE_HERE",
        "DB_PORT": "YOUR_VALUE_HERE",
        "DB_DATABASE": "YOUR_VALUE_HERE",
        "DB_USERNAME": "YOUR_VALUE_HERE",
        "DB_PASSWORD": "YOUR_VALUE_HERE",
        "DB_ALLOWED_HOSTS": "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 @hovecapital/read-only-mysql-mcp-server@latest

initialize succeeded but no response to tools/list.

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

The read-only-local-mysql-mcp-server MCP server connects AI clients to MySQL databases through read-only SQL tools. It uses environment variables for a default connection, while runtime and per-query connection strings can target other permitted databases. Reach for it when an agent needs to inspect schemas or retrieve data without write access.

Use cases

  • Inspect database schemas through natural-language requests
  • Retrieve filtered records from MySQL tables
  • Count or summarize read-only database data
  • Switch between permitted MySQL databases at runtime

Key features

  • Read-only MySQL SQL queries
  • Persistent and per-query connection switching
  • SQL statement validation
  • JSON-formatted results
  • Environment-based database configuration

Tools3

What Read Only Local Mysql MCP Server lets your agent do. Expand a tool for its parameters.

Verified live~204 tokens of context

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.

32/32 checks healthy over the last 111d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 10d ago via OSV.dev · @hovecapital/read-only-mysql-mcp-server@latest (npm)

Adoption & maintenance

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

GitHub stars8Stargazers on the source repository.
npm downloads818Package downloads in the last 30 days.
Last commit16d agoMost recent push to the default branch.
Install checkInconclusiveStarted but did not complete the MCP handshake in our test.
Tools exposed3Callable tools this server registers over MCP.
Directory activity12 viewsConfig copies, upvotes, and views on AllMCPs.

How Read Only Local Mysql MCP Server works

What read-only-local-mysql-mcp-server MCP server does

The read-only-local-mysql-mcp-server MCP server lets an MCP-compatible client work with MySQL through natural-language requests that the client turns into SQL. It is intended for inspecting database structure and reading records, not for modifying data.

The server exposes three tools: connect selects a runtime database from a MySQL connection string, disconnect ends that runtime selection and returns to the environment-configured database, and query executes a read-only SQL statement. Query results are returned in JSON format.

Typical requests include listing tables, inspecting a table definition, retrieving a limited set of rows, counting records, and filtering results.

How it works

At startup, the server reads the default database connection from environment variables. A call to connect changes the active connection for later queries until disconnect is called. The query tool can also receive a connection string for a single request, which takes precedence over the persistent runtime connection and the environment-based default.

The read-only-local-mysql-mcp-server MCP server accepts a MySQL URL in the form mysql://username:password@hostname:port/database_name. Host access is restricted: the configured DB_HOST and loopback addresses are allowed, and additional destinations can be supplied through DB_ALLOWED_HOSTS.

Before execution, SQL is validated. Supported statement forms are SELECT, WITH, SHOW, DESCRIBE, and EXPLAIN. The validation permits one statement and rejects comments. Queries also run in a server-side read-only transaction, providing an additional safeguard against changes.

Setup and configuration

Node.js 16 or newer, a reachable MySQL server, and an MCP client are listed as prerequisites. The package can be launched with npx, installed globally from npm, or built locally after cloning the repository with npm install and npm run build.

For the default connection, configure these variables in the MCP client definition:

  • DB_HOST: MySQL hostname
  • DB_PORT: MySQL port
  • DB_DATABASE: database name
  • DB_USERNAME: MySQL user
  • DB_PASSWORD: password
  • DB_ALLOWED_HOSTS: optional comma-separated additional hosts permitted in connection strings

The documented npx command uses @hovecapital/read-only-mysql-mcp-server@latest. Claude Code can add it through the claude mcp add command, while Claude Desktop uses its MCP configuration file. After changing configuration, restart the client.

Tools and capabilities

  • connect(connectionString): establishes a persistent runtime connection.
  • disconnect(): closes the runtime connection and restores the environment-configured default.
  • query(sql, connectionString?): executes a read-only query, optionally using a connection string only for that request.
  • JSON-formatted query output.
  • Runtime database switching without restarting the server.
  • Validation for permitted read-only SQL statement types.

Limitations and notes

The read-only-local-mysql-mcp-server MCP server does not provide write operations. SQL outside the supported statement types, multiple statements, or statements containing comments are rejected. Host restrictions also prevent arbitrary connection targets unless they are the configured host, loopback, or listed in DB_ALLOWED_HOSTS.

Credentials are supplied through environment variables or connection strings, so deployment should account for how the MCP client stores and passes those values.

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 Read Only Local Mysql MCP Server

read-only-local-mysql-mcp-server is an MCP server that connects AI clients to MySQL databases for read-only access. Its main tools are connect for selecting a runtime database, disconnect for restoring the default connection, and query for executing validated SELECT, WITH, SHOW, DESCRIBE, or EXPLAIN statements.

Install it with npx, npm, or from a local repository build. The documented npx command runs @hovecapital/read-only-mysql-mcp-server@latest, while local installation uses npm install followed by npm run build. Configure the resulting command in your MCP client.

Set DB_HOST, DB_PORT, DB_DATABASE, DB_USERNAME, and DB_PASSWORD in the MCP client environment. DB_ALLOWED_HOSTS can add permitted connection-string hosts. These variables define the default connection used when no runtime or per-query connection overrides it.

Yes. Call connect with a MySQL connection string to persist a different runtime connection, or pass connectionString to query for a one-request override. Calling disconnect returns the server to its environment-configured default, subject to the server's host restrictions.

Yes. Claude Desktop is documented as a supported client. Add the server command and database environment variables to claude_desktop_config.json, then restart Claude Desktop so it can expose the connect, disconnect, and query tools.

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