PlugWiki
mcp-server-mysql logo

MySQL MCP Server (benborla): Setup for Claude, Cursor and Other Apps

CommunityLocal
Getnpm@benborla29/mcp-server-mysqlbenborla/mcp-server-mysql

Lets Claude, Cursor and other assistants look at your MySQL tables and run SQL queries, read-only unless you turn writes on.

This is a community MySQL server by Ben Borla, not an Oracle or MySQL product. It runs on your computer, connects with a MySQL user and password you provide, and gives the assistant one query tool plus a list of your tables and columns.

It starts read-only. Inserts, updates, deletes and schema changes each need their own setting before they work, so leave them off unless you need them. Use a database user with only the rights you want the assistant to have.

Good for

  • Developers who want the assistant to answer questions from a MySQL database
  • Analysts who want quick queries without writing all the SQL
  • Teams who need a database reachable only through a read-only login
  • People with remote databases, since an SSH tunnel is supported

Works in

12 should work

Tap an app to see how to set it up and any known problems.

Install mcp-server-mysql

Claude Code

  1. 1

    Copy this prompt.

    Add the mcp-server-mysql server to Claude Code. Run this command:
    
    claude mcp add mysql -e MYSQL_HOST=<MYSQL_HOST> -e MYSQL_USER=<MYSQL_USER> -e MYSQL_PASS=<MYSQL_PASS> -e MYSQL_DB=<MYSQL_DB> -- npx -y @benborla29/mcp-server-mysql
    
    Ask me for MYSQL_HOST, MYSQL_USER, MYSQL_PASS, MYSQL_DB and only put the values in that config, nowhere else.
    
    Then check that it loaded and tell me if I need to sign in or restart.
  2. 2

    Paste it into Claude Code. It shows the change and asks before running it.

Requires Node.js.

Built from the package data we hold. Not yet tested by us.

Tools

  • Runs a SQL query on your database

    Runs the SQL you or the assistant write. By default only reading is allowed. Inserts, updates, deletes and schema changes each work only if you turn on their setting.

    Try: “Show the 10 customers with the highest order totals this month.”

    Network · mysql_query

Read from the source code

Permissions

low risk · 3 things to watch

Low risk

By default the assistant can only read from your database, but the query results are sent to your AI provider. Use a MySQL user with SELECT rights only, and leave the write settings off.

What it can do

Watch out for

  • Writes and deletes can be switched on

    Setting the ALLOW_* options lets the assistant insert, update, delete and drop. Leave them off, and use a MySQL user without those rights as a second lock. github.com

  • Query results go to your AI provider

    Whatever the query returns is sent to your assistant. An optional PII redaction setting masks personal data, but it is off by default. github.com

  • Remote mode listens on every network interface

    With IS_REMOTE_MCP=true the server starts an HTTP port without a host limit, and the bearer token only applies when you set REMOTE_SECRET_KEY. Always set the key, or stay on the default local mode. github.com

Security advisories

No published security advisories as of Nov 1, 2026.

Technical details
Turning on read-onlyLeave ALLOW_INSERT_OPERATION, ALLOW_UPDATE_OPERATION, ALLOW_DELETE_OPERATION and ALLOW_DDL_OPERATION at false, which is the default.
Talks toYour MySQL host (default 127.0.0.1)
Sign-in and keysThe MySQL password goes in the MYSQL_PASS setting of your MCP config on your machine.
Scopes
  • MySQL user rights (your database user decides what is possible)

Questions

Is this the official MySQL MCP server?

No. It is a community project by Ben Borla. MySQL and Oracle do not publish or maintain it.

Can it run read-only?

Yes, and that is the default. Writes only work if you set the ALLOW_INSERT, ALLOW_UPDATE, ALLOW_DELETE or ALLOW_DDL options to true. For a hard guarantee, also use a MySQL user that only has SELECT rights.

What do I need to connect?

Node.js and a MySQL 5.7 or newer database. You need the host, user, password and database name, entered as the settings in the install box.

Does it run locally or in the cloud?

It runs locally on your computer and connects to the MySQL host you point it at. An optional remote mode runs it as an HTTP server instead.

Can it delete or change my data?

Only if you turn that on. All insert, update, delete and schema-change options are off by default. A user with delete rights plus the delete option on can remove data.

Can it hide personal data in results?

Yes, optionally. Set ENABLE_PII_REDACTION to true to mask personal columns in query results. It is off by default.

Can it query more than one database?

Yes. Leave the database name out to use multi-database mode, where writes stay off unless you enable them.

Information

updated Nov 2, 2026

Publisher
Community
Package
@benborla29/mcp-server-mysql
Registry
npm
Transport
stdio
Auth
token in env
Version
2.0.9
License
MIT
Last commit
Jul 27, 2026
Open issues
46

GitHubnpmChangelogIssues

Sources

Docs, issue trackers and discussions this page is built from. Issues, quotes and findings above link to their own source.

Show all 3
  1. README.md · github.com
  2. CONFIGURATION.md · github.com
  3. index.ts · github.com

Facts from the official MCP registry, GitHub, npm, PyPI and the Docker catalog. Updated Nov 2, 2026.