Try “Claude Code skills”, “MCP servers for Cursor” or “Codex” · Esc to close

MCP Server for MySQL 🔌 MCP server Open source

Read-only-by-default MySQL access with opt-in writes, SSH tunnels and PII masking

Database & backend MCP servers · Open source ★ 2.1k · +1 this week · MIT · updated 2026-07-27

7.2editor score
View on GitHub ↗
GitHub stars
2.1k
Stars this week
+1
Forks
253
Licence
MIT
Last push
2026-07-27
Maintainer
benborla
Installclaude 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 @benborla29/mcp-server-mysql

Third-party MCP servers run with your permissions. Read the source before installing, and prefer pinned versions.

Works with

Built on the open MCP standard, so it works in every app that supports MCP.

About MCP Server for MySQL

What it does

MCP Server for MySQL connects a coding agent to a MySQL database so it can read the schema and run SQL while it builds or debugs your app. A typical session has the agent inspect tables before writing a migration or model, check what data a failing endpoint actually returns, or explain a slow query. The server is read-only out of the box. Inserts, updates, deletes and DDL each have to be switched on separately, and you can set these permissions per schema, for example allowing writes on a development database but not on production. It can also reach remote databases through a built-in SSH tunnel, query several databases without reconnecting, and mask personal data in results. It is a community project, not an Oracle product.

Tools it gives your agent

  • mysql_query runs SQL. Only reads are allowed unless you enable write flags
  • The mysql://tables resource lists tables and column metadata for the connected database

Works with

It runs locally over stdio through npx by default. An optional remote mode serves HTTP with bearer-token auth. The README targets Claude Code and Claude Desktop, and the installation guide also covers Cursor, Codex CLI and Smithery. Any MCP client will work.

How to connect

The Claude Code command from the README (replace the placeholder credentials with your own):

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 @benborla29/mcp-server-mysql

Cost and limits

It is free and MIT-licensed. It needs Node.js 20 or later and MySQL 5.7 or later, with 8.0 recommended. There is no hosted service, and the only costs come from your own database.

Safety notes

Keep the default read-only mode unless you need writes. Enable writes one at a time with ALLOW_INSERT_OPERATION, ALLOW_UPDATE_OPERATION and ALLOW_DELETE_OPERATION, or use per-schema permission maps. Connect as a dedicated MySQL user with minimal grants rather than root, even though the quick-start example uses it. The credentials sit in your MCP config as environment variables, so keep that file out of version control. ENABLE_PII_REDACTION masks sensitive columns in query results. If you use remote mode, set REMOTE_SECRET_KEY and put the server behind TLS.

mysql sql database read-only ssh-tunnel

Pros

  • Read-only by default, with writes enabled per operation and per schema
  • Built-in SSH tunnel, multi-database mode and optional PII redaction

Cons

  • A single generic mysql_query tool, with no dedicated schema or explain tools
  • Community project, not from Oracle or MySQL

Supabase MCP 🔌 MCP serverFreemium

Manage Supabase projects, databases, migrations and edge functions from your agent

★ 2.9k · +6 this week

OpenViking 🔌 MCP serverOpen source

Open-source context database giving agents shared memory, resources and skills

★ 39k · +450 this week

7.5 Visit ↗

Popular searches