Hosted MCPDatabase

MySQL MCP Server

Query a MySQL database in natural language. Read-only: SELECT, SHOW, DESCRIBE and EXPLAIN. The database must be reachable from the public internet.

Setup

5 fields · 1 secret

Credentials are injected into an ephemeral sandbox at boot and destroyed with it.

Runtime

Standard

Sessions run up to 60 minutes before the sandbox is reclaimed.

Models

60+ AI models

Chat with 60+ AI models on the same workflow — switch to a different model mid-conversation and re-run the same prompt, or use Compare mode to put several side-by-side.

What the MySQL MCP server does

How models use it and what it is built for.

The MySQL MCP server lets a model explore and query a MySQL database in plain language: find the tables, read their structure, and answer questions with real SQL against real data.

It ships read-only. The server rejects writes unless it is started with explicit insert, update or delete switches, and hosted deployments never set them — so a prompt cannot change your data, whatever it says.

You supply a host, a user and (optionally) a password and default database. The server runs in a cloud sandbox and connects to your database over the public internet.

What a model can do with it

Concrete operations exposed as tools.

  • List databases and tables, and describe table columns and indexes
  • Run SELECT queries and return the rows to the model
  • Use EXPLAIN to reason about slow queries
  • Answer multi-step questions by chaining queries — find a table, inspect it, then aggregate it

How to set up the MySQL MCP server

In order. Each step assumes the previous one worked.

  1. 01

    Make the database reachable

    The sandbox connects over the public internet. Managed services such as Amazon RDS, Google Cloud SQL, Azure Database for MySQL and PlanetScale work once their firewall allows the connection. A database on a private network needs a public endpoint or tunnel.

  2. 02

    Create a read-only user

    Even though the server is read-only, use a dedicated account with SELECT privileges only. It is the database-level guarantee behind the server-level one.

  3. 03

    Enter the connection details

    Host and username are required. Port defaults to 3306; leave the password blank for an account without one, and leave the database blank to query across databases.

  4. 04

    Check with a simple query

    Ask the model to list the tables in your database. If they come back, the connection and credentials are right.

Configuration

What you provide before the sandbox starts.

Database (optional)

Default database. Leave blank to query across databases.

HostRequired

Public hostname or IP of your MySQL server.

PasswordSecret

Leave blank if the user has no password.

Port

Usually 3306.

UsernameRequired

A read-only user is recommended.

Example prompts

Paste any of these into Agent Studio once the server is connected.

List the tables in this database and describe the three largest.

How many orders were placed per month over the last year? Show the SQL you ran.

Which customers have never placed an order?

This query is slow: SELECT * FROM orders WHERE email = ?. Use EXPLAIN and suggest an index.

Limits and things to watch

Known constraints, stated plainly.

  • Read-only: INSERT, UPDATE, DELETE and DDL are rejected.
  • The database must accept connections from the public internet; VPC-only databases are unreachable without a tunnel.
  • Large result sets cost model context. Ask for aggregates or LIMITed samples rather than whole tables.

Test MySQL against a real model

Deploy the server hosted, then watch which tools a model actually reaches for — with full JSON input and output on every call. Switch models mid-conversation to compare how each one uses the same server.

Frequently asked questions

About the MySQL MCP server.

Can the AI modify or delete my data?

No. Write operations are disabled in the server, and hosted deployments do not enable them. Pair that with a SELECT-only database user for a second, independent guarantee.

Does it work with MariaDB, PlanetScale or Amazon RDS?

It speaks the standard MySQL protocol, so MySQL-compatible databases that accept a normal username and password connection work the same way.

Why can't it connect to my database?

Almost always reachability. The server runs in the cloud, not on your network, so the database needs a public address and a firewall rule that allows the connection.

More