MCP Server for MySQL

MCP server that gives an agent access to MySQL: schema inspection and queries, read-only by default, writes behind flags

  • 2,217 ★ on the repository
  • Last commit
  • MIT
MCP server

Extended access

Why this level

  • Connects to a database and runs SQL on the agent's request
  • With write flags enabled it can modify and delete data
All reasons and checks

benborla/mcp-server-mysql

Install

In your terminal, with SkillFoxx CLI

npx skillfoxx add mcp/mcp-server-for-mysql

Detects the agents on your machine, shows the access level and pins the version.

Other ways to install

Access and checks

How we review

Extended accessThe tool runs code or makes network calls and only reads external data.

  • Connects to a database and runs SQL on the agent's request
  • With write flags enabled it can modify and delete data

This is third-party code. Review the repository files before installing.

What it does

The server connects an agent to a MySQL database over MCP. It exposes a tool that runs SQL and a resource that lists tables and column metadata, so the agent can read the schema and run selects without manual exports. Only read queries are available by default; insert, update and delete are enabled through separate environment variables. It adds a multi-database mode without reconnecting, per-database permissions, redaction of sensitive fields in results, SSH tunnel access and SSL with an mTLS option. Besides local stdio, it offers a remote HTTP mode with a bearer token.

Who it is for. For developers and analysts who want an agent to read and query MySQL directly from their editor or client.

Good fit when

  • You want the agent to explore a schema and write or check SQL
  • You want quick reads from MySQL without leaving the editor
  • You need remote database access over an SSH tunnel or HTTP with a token

Not a fit when

  • You need a database engine other than MySQL
  • You cannot give the agent direct access to a production database

Example request

Show the database schema and count orders per month for the last year

MCP

Transport
stdio, http
Authentication
not required

Environment variables

MYSQL_HOST required
MySQL server host
MYSQL_PORT required
MySQL port, usually 3306
MYSQL_USER required
Database user name
MYSQL_PASS required, secret
Database user password
MYSQL_DB
Database name, optional in multi-database mode
ALLOW_INSERT_OPERATION
Allow inserts, false by default
ALLOW_UPDATE_OPERATION
Allow updates, false by default
ALLOW_DELETE_OPERATION
Allow deletes, false by default

Limitations

Requires Node.js 20+ and a MySQL account with suitable privileges. The password and connection settings are passed via environment variables. Write operations are off by default and are enabled with ALLOW_INSERT_OPERATION, ALLOW_UPDATE_OPERATION and ALLOW_DELETE_OPERATION; once on, the agent can change data, so use a least-privilege account and avoid production unless needed.

How to disable. Remove the mcp_server_mysql server from your client's MCP configuration, for example with claude mcp remove or by editing the mcpServers block.

FAQ

Can the agent change data?

Not by default; only reads are allowed. Insert, update and delete are enabled through the separate ALLOW_INSERT_OPERATION, ALLOW_UPDATE_OPERATION and ALLOW_DELETE_OPERATION variables.

How do I reach a remote database?

There is built-in SSH tunnel support plus a remote HTTP mode with a bearer token. See docs/INSTALLATION.md and docs/CONFIGURATION.md.

Discussion

No questions or reviews yet.

A Python MCP server for MySQL: listing tables, reading data, running SQL and inspecting schema through a controlled interface

MCP serverBroad access1.4KRepository stars

MySQL MCP Server Pro

mysql_mcp_server_pro

A MySQL MCP server that runs SQL under access roles, finds tables by comments and analyzes locks, indexes and query plans

MCP serverBroad access249Repository stars
Official

A single-binary MCP server for MySQL, MariaDB, PostgreSQL and SQLite: read-only by default, with optional PII redaction

MCP serverBroad access33Repository stars

One MCP server for SQLite, SQL Server, PostgreSQL and MySQL: read and change data, edit schemas and export to CSV and JSON

MCP serverBroad access391Repository stars

DB MCP Server

db-mcp-server

An MCP server for several databases with protection: a read-only mode per database and a row limit. Written in Go, launched in Docker

MCP serverBroad access480Repository stars

An MCP server for Microsoft SQL Server and Azure SQL: the agent lists tables and runs SQL queries that read and write data

MCP serverBroad access404Repository stars

README in short

The README presents an MCP server that gives Claude and other LLMs access to MySQL: schema reads, queries and optional writes. It lists features: read-only by default, Claude Code integration, SSH tunnel, multi-database mode, per-database permissions, PII redaction, a remote HTTP mode and SSL with mTLS. It shows npx install commands for Claude Code and a config snippet for Claude Desktop and other clients. The mysql_query tool runs SQL and the mysql://tables resource lists tables. Separate docs cover installation, environment variables, multi-DB mode, redaction, testing and troubleshooting. MIT licensed.

README badge

Report a problem