New: one score for how consistent your answers are. See more

Which MySQL MCP server should you use with Claude or ChatGPT?

Six MySQL MCP servers checked for read-only defaults, plus the read-only MySQL 8 user and the Claude, Cursor and ChatGPT config to run them safely.

December 1, 2026•8 min read•Vivek Sah
Jump to a section

A MySQL MCP server lets Claude or ChatGPT run SQL against your database and read back real rows. There are a handful worth considering, and the question that separates them is what happens when the AI writes DELETE. Three of the most used servers ship a quick-start config that would let it go through.

They're still worth using. Read the defaults below, create the read-only MySQL user before you install anything, and treat the server's own read-only switch as a second lock.

The servers, side by side

Stars and releases are from GitHub on December 1, 2026.

ServerStarsLatest releaseLicenseRuns whereRead-only by default?What its quick-start does
benborla/mcp-server-mysql2.2kv2.0.9, Jun 2026MITYour machine (Node)Yes, writes need env flagsConnects as root
bytebase/dbhub4.0kv2.1.0, Nov 2026MITYour machine (Node) or DockerNo, until readonly = true--dsn alone, so writable
designcomputer/mysql_mcp_server1.4kv0.4.5, Oct 2026MITYour machine (Python)No read-only modeAny user you give it
AWS Labs MySQL MCP server10k (awslabs/mcp monorepo)Dec 2026 (monorepo)Apache-2.0Your machine, AWS credentialsYes, writes need --allow_write_queryIncludes --allow_write_query
Google MCP Toolbox, MySQL prebuilt17kv1.18.0, Nov 2026Apache-2.0Your machine (Go binary)No read-only option documentedAny user you give it
PlanetScale MCPHostedHosted serviceHostedPlanetScale's cloudYou choose at sign-inOAuth, read-only or full

What each one is good at

benborla/mcp-server-mysql

The most-starred MySQL-only server here, and the safest default of the self-run ones: "All write operations are disabled by default", with ALLOW_INSERT_OPERATION, ALLOW_UPDATE_OPERATION and ALLOW_DELETE_OPERATION to turn each back on. (Source: GitHub: benborla/mcp-server-mysql README, https://github.com/benborla/mcp-server-mysql, checked on 2026-12-01) It adds schema-level permissions, a multi-database mode, SSH tunnels and PII masking. The catch is in its own README: both install examples set MYSQL_USER to root. Swap in the read-only user before you copy them. The last release was June 2026, so check recent commits before you depend on it.

Use it when one person needs one MySQL database, with a SELECT-only user.

DBHub (Bytebase)

One server for MySQL, MariaDB, Postgres, SQL Server, Oracle, ClickHouse and SQLite, with two tools by default to keep the token cost low. Its README is direct about the default: "With --dsn alone, DBHub's execute_sql can also write." (Source: GitHub: bytebase/dbhub README, https://github.com/bytebase/dbhub, checked on 2026-12-01) Read-only is a per-tool readonly = true in a TOML config, and for MySQL it wraps queries in a read-only transaction as well as checking the SQL. DBHub still calls it "a guardrail, not a permission boundary" and tells you to connect with a read-only user. (Source: DBHub docs: Read-only mode, https://dbhub.ai/config/read-only-mode, checked on 2026-12-01)

Use it when MySQL is one of several databases, and always with the TOML config.

designcomputer/mysql_mcp_server

The Python option. Its execute_sql tool "Supports SELECT, SHOW, DESCRIBE, and DML (INSERT, UPDATE, DELETE)", with writes marked as destructive so a client may ask before running them. (Source: GitHub: designcomputer/mysql_mcp_server README, https://github.com/designcomputer/mysql_mcp_server, checked on 2026-12-01) That hint is advice to the client, and the server runs the write if the client goes ahead. Its explore_database and analyze_table prompts help with a schema you don't know yet. If you run its SSE mode, it "has no built-in authentication" and binds to all interfaces by default. Keep it on dev databases, behind a SELECT-only user.

AWS Labs MySQL MCP server

Built for Aurora MySQL, RDS for MySQL and RDS for MariaDB, connecting through the RDS Data API or the MySQL wire protocol with IAM auth. Without --allow_write_query it rejects SQL containing mutating keywords, and AWS states plainly that this "is a best-effort SQL-text safeguard, not a security boundary". (Source: GitHub: awslabs/mcp, MySQL MCP server README, https://github.com/awslabs/mcp/tree/main/src/mysql-mcp-server, checked on 2026-12-01) Its sample config includes --allow_write_query, and the README shows the AI creating a new Aurora cluster from a prompt. Remove the flag, and scope the AWS profile it runs under.

Use it on Aurora or RDS when your team already works through IAM.

Google MCP Toolbox for Databases

Run the Toolbox binary with --prebuilt mysql and you get list_tables and execute_sql, which "executes any SQL statement", plus diagnostic tools for query plans, locks and table stats. (Source: MCP Toolbox docs: MySQL using MCP, https://mcp-toolbox.dev/documentation/connect-to/ides/mysql_mcp/, checked on 2026-12-01) The docs describe no read-only switch for MySQL, so the MySQL user is the only lock. Where it earns its place is custom tools: define named, parameterized queries in YAML and the AI calls revenue_by_month instead of writing free-form SQL, which suits a team that wants a fixed menu of approved queries.

PlanetScale MCP

Hosted at https://mcp.pscale.dev/mcp/planetscale, with OAuth sign-in where you pick no access, read-only or full access per organization or database. It blocks UPDATE and DELETE without a WHERE, blocks TRUNCATE, and asks for human confirmation on DDL. The old local pscale mcp command "has been removed". (Source: PlanetScale docs: MCP server, https://planetscale.com/docs/connect/mcp, checked on 2026-12-01)

It has the strongest defaults on this list, for databases that already live on PlanetScale.

Create the read-only MySQL user first

Every server above, including the ones with a read-only mode, says the real boundary is the database user. In a test, Querio ran designcomputer's server against MySQL 8.4 with a user that had SELECT plus EXECUTE on one stored procedure, and the AI's CALL shop.purge_orders() deleted 10 rows. (Source: Querio: MySQL MCP Server, which one to use, tested on MySQL 8.4, https://querio.ai/articles/mysql-mcp-server, checked on 2026-12-01) A procedure runs with its definer's rights by default, so EXECUTE can carry writes past a SELECT-only grant.

These steps work on MySQL 8.0 and 8.4. Run them as an admin, ideally on a read replica.

  1. Create the user. Limit the host to the network the server connects from, require TLS, and cap its connections.
CREATE USER 'mcp_ro'@'10.0.%'
  IDENTIFIED BY '<a long generated password>'
  REQUIRE SSL
  WITH MAX_USER_CONNECTIONS 5;

The clause order matters: authentication, then REQUIRE, then WITH resource options. (Source: MySQL 8.4 Reference Manual: CREATE USER, https://dev.mysql.com/doc/refman/8.4/en/create-user.html, checked on 2026-12-01)

  1. Grant SELECT on what the AI should see.
GRANT SELECT ON shop.* TO 'mcp_ro'@'10.0.%';
  1. If a table must stay hidden, grant table by table. MySQL can't subtract one table from a database-wide grant: partial revokes "apply at the schema level only", not to tables. (Source: MySQL 8.4 Reference Manual: Privilege Restriction Using Partial Revokes, https://dev.mysql.com/doc/refman/8.4/en/partial-revokes.html, checked on 2026-12-01) So instead of shop.*:
GRANT SELECT ON shop.orders TO 'mcp_ro'@'10.0.%';
GRANT SELECT ON shop.order_items TO 'mcp_ro'@'10.0.%';
GRANT SELECT ON shop.products TO 'mcp_ro'@'10.0.%';
-- shop.users (password hashes, emails) is left out
  1. Skip FLUSH PRIVILEGES. Many tutorials add it, but grants made with CREATE USER and GRANT load "immediately". (Source: MySQL 8.4 Reference Manual: When Privilege Changes Take Effect, https://dev.mysql.com/doc/refman/8.4/en/privilege-changes.html, checked on 2026-12-01) It's harmless, just unnecessary.

  2. Check the result.

SHOW GRANTS FOR 'mcp_ro'@'10.0.%';

You should see USAGE and SELECT lines only. Then log in as mcp_ro and try an INSERT; it should fail with error 1142.

Add it to Claude, Cursor or ChatGPT

The examples use benborla's server, which is read-only by default, and DBHub with its read-only config. Swap in your host and the mcp_ro password.

Claude Code

One command:

claude mcp add mysql \
  -e MYSQL_HOST="replica.internal" \
  -e MYSQL_PORT="3306" \
  -e MYSQL_USER="mcp_ro" \
  -e MYSQL_PASS="<password>" \
  -e MYSQL_DB="shop" \
  -- npx -y @benborla29/mcp-server-mysql

Claude Desktop

Add this to claude_desktop_config.json (Settings, then Developer, then Edit Config):

{
  "mcpServers": {
    "mysql": {
      "command": "npx",
      "args": ["-y", "@benborla29/mcp-server-mysql"],
      "env": {
        "MYSQL_HOST": "replica.internal",
        "MYSQL_PORT": "3306",
        "MYSQL_USER": "mcp_ro",
        "MYSQL_PASS": "<password>",
        "MYSQL_DB": "shop"
      }
    }
  }
}

Cursor, with DBHub

Save a dbhub.toml; the password comes from an environment variable, so the file can live in a repo:

[[sources]]
id = "shop"
dsn = "mysql://mcp_ro:${MYSQL_MCP_PASSWORD}@replica.internal:3306/shop"

[[tools]]
name = "execute_sql"
source = "shop"
readonly = true

Then point ~/.cursor/mcp.json at it:

{
  "mcpServers": {
    "mysql": {
      "command": "npx",
      "args": ["-y", "@bytebase/dbhub@latest", "--transport", "stdio", "--config", "/path/to/dbhub.toml"]
    }
  }
}

ChatGPT

ChatGPT adds MCP servers by URL in its connectors settings, so it takes hosted servers like PlanetScale's or Contextflo's as they are. A local server needs to run over HTTP somewhere ChatGPT can reach, behind authentication. The Cursor to MySQL guide has a shorter version of the Cursor setup.

Where this breaks down for a team

Everything above is a one-person setup, and it works well for one person. It strains once the rest of the company starts asking.

The password sits in a plain-text config on every laptop that has the server installed, and rotating it means touching each machine. MySQL's own logs show every query as mcp_ro, so when a wrong number reaches a meeting there's no record of who asked or what the AI was told.

Definitions drift too. Each person's Claude or ChatGPT works out from scratch what orders.status = 4 means, so two people asking for "net revenue last month" can get two different queries and two different numbers.

Local MySQL MCP serverContextflo
Where the MySQL password livesA config file on each laptopStored encrypted in Contextflo, off every laptop
Who MySQL seesOne shared userOne read-only user, with every question logged per person in Contextflo
Who can query which tablesWhatever the MySQL user can readAccess rules per group, on every plan
What the AI knows about your columnsNames and typesTable and column descriptions generated from your schema, code and docs
Other sources in the same chatOne server per databaseMySQL, Snowflake, BigQuery, Postgres and more through one connector
SetupOne config per personAbout 10 minutes once, then each person signs in

Where Contextflo fits

Contextflo connects MySQL to Claude or ChatGPT with the same read-only user from this post, then adds the parts a single server leaves to you. It generates table and column descriptions and starter metric definitions from your schema, your code and your docs, so the AI knows what status = 4 means before anyone asks. Corrections your team saves are reused in every later answer, and the schema re-syncs daily.

It supports access control across all data sources, at the granularity each underlying data source supports, on every plan, and the per-person audit log is on every plan too. MySQL sits in the same connector as your warehouse and your uploaded spreadsheets, so one chat can use all of them.

It works with the Claude or ChatGPT subscription your team already pays for, so there's one AI bill and you pick the model. Pricing is from $500/month for up to 10 people, unlimited queries, and it's free for one user and one data source. The MySQL setup guide takes about 10 minutes.

Tilt, a live-auction marketplace for limited-edition goods, runs Contextflo with a one-person data team: about 6,000 queries a month, with 30+ people asking every week.

Here is a more in-depth look at Contextflo and how it works.

What is Contextflo?

Contextflo is a governed context layer between your data and the AI your team already uses. Connect your warehouse once, and your team asks questions in their own Claude or ChatGPT. The model writes and runs the SQL; Contextflo supplies the definitions, the per-user access control, and the audit that make the answers trustworthy. Your data never moves, and you do not need a data team.

How it works

1
Connect your data
Point Contextflo at your warehouse or database, or upload a CSV. It reaches multiple sources at once, so a single question can span all of them.
2
Bootstrap your context layer and review
Connect your code repo, Notion docs, or a data dictionary, and Contextflo annotates each table in your data source where it can. You review and correct them. That becomes the foundational context layer: your AI agent does not just see tables, it sees the context around them.
3
Define metrics and save golden queries
Pin the verified SQL behind a metric once. Every question then resolves against the same definitions, so the number is consistent no matter who asks or how they phrase it.

Contextflo, explained by our founder.

Your team queries in their own Claude or ChatGPT over MCP, so you bring any agent rather than a locked-in bot, and every answer comes back with the SQL shown and access enforced per user.

FAQ

What is the best MySQL MCP server? For one person on one MySQL database, benborla/mcp-server-mysql, because it is read-only by default and writes need explicit flags. DBHub suits several databases in one server once you set readonly = true. PlanetScale's hosted server is the pick on PlanetScale, and the AWS Labs server fits Aurora and RDS. For a team, Contextflo connects MySQL with read-only access, per-person access rules and an audit log on every plan.

Is a MySQL MCP server read-only? Some are by default and some are not. benborla/mcp-server-mysql and the AWS Labs server block writes unless you turn them on, though AWS's own example config turns them on. DBHub writes unless you set readonly = true, and designcomputer/mysql_mcp_server has no read-only mode. Whatever the server, connect with a MySQL user that only has SELECT.

How do I create a read-only MySQL user for an MCP server? Run CREATE USER 'mcp_ro'@'10.0.%' IDENTIFIED BY '<password>' REQUIRE SSL WITH MAX_USER_CONNECTIONS 5; then GRANT SELECT ON shop.* TO 'mcp_ro'@'10.0.%'; and check it with SHOW GRANTS. On MySQL 8 the grant applies immediately, with no FLUSH PRIVILEGES needed. Don't grant EXECUTE unless you've read the procedure.

Can ChatGPT connect to a MySQL MCP server? Yes. ChatGPT connects to MCP servers by URL through its connectors settings, so it works with hosted servers like PlanetScale's or Contextflo's directly. A local server such as benborla or DBHub has to run over HTTP somewhere reachable first.

Can Contextflo connect Claude or ChatGPT to MySQL and our other data? Yes. Contextflo connects MySQL alongside Snowflake, BigQuery, Postgres, Redshift, Databricks, ClickHouse and uploaded files, through one connector in Claude or ChatGPT. It supports access control across all data sources, at the granularity each underlying data source supports, on every plan, logs every question per person, and runs on the AI subscription your team already pays for, with unlimited queries.