MySQL MCP server
Connect Claude, ChatGPT or Claude Code to a MySQL database over MCP (Model Context Protocol), without putting a connection string on anyone's laptop. The assistant reads the schema, writes SQL and runs it, and Thunderduck checks every query before it reaches MySQL.
The problem: an assistant with a connection string
The usual way to give an assistant a MySQL database is a local MCP server started with a connection string. It works on day one, and it leaves you with three problems once the database is a real one:
- The credential lives in a config file on every machine that uses it, usually a user with more rights than the assistant needs.
- Nothing checks the cost of a query. An assistant exploring a table it
does not know will happily run a
SELECT *or an unfiltered join against production. - The assistant only sees names and types.
amtcould be dollars or cents, andstatus = 3means nothing without the application code, so plausible SQL returns wrong numbers.
How Thunderduck solves it
Thunderduck runs a hosted MCP server in front of the database, at
https://mcp.thunderduck.ai/mcp.
- No connection string on any laptop. The MySQL password goes to a secrets manager when you add the database. People sign in to the assistant with their own Thunderduck account (OAuth), and the assistant never sees the password.
- Read-only in three places. The MySQL user's grants, the catalog's read-only flag and the user's token scope each block writes on their own, so a persuasive prompt cannot talk its way past them.
- Every query is priced before it runs. Thunderduck plans the SQL first and refuses it above the per-query or daily limit, or when it would scan a large table with no selective filter. See Scopes & costs.
- Filters run in MySQL. Filters on constant values are pushed down, and
so are
GROUP BY,ORDER BYandLIMITwhen the query reads one table, so only matching rows leave the database. Each statement carries a comment naming the Thunderduck user, so you can find it in your MySQL general or slow query log. - Columns come with meanings. Thunderduck infers a description and a unit for each column and lets your team correct them. The assistant reads them before it writes SQL. See Column meanings.
- One server for every database. The same connection reaches your PostgreSQL, BigQuery and S3 data, and one query can join them.
Set it up
1. Create a read-only user
Run this in MySQL. Change the database name and the password:
CREATE USER 'thunderduck_ro'@'%' IDENTIFIED BY '…';
GRANT SELECT, SHOW VIEW ON shop.* TO 'thunderduck_ro'@'%';Databases the user cannot read stay invisible to the assistant, because Thunderduck only catalogs what the user can read.
2. Add the database as a catalog
In the console, Catalogs → Create catalog → MySQL. Give it a short
lowercase name such as store, enter the host, port, database and the user
from step 1, and turn on Read-only. SSL defaults to require, and the
server certificate is checked against public CAs and the Amazon RDS CA.
The database must be reachable from the internet or through your own tunnel.
All fields are on the PostgreSQL & MySQL page.
3. Connect your assistant
Claude (claude.ai and Claude Desktop): Settings → Connectors → Add custom connector, paste the URL below, and sign in.
https://mcp.thunderduck.ai/mcpClaude Code:
claude mcp add --transport http thunderduck https://mcp.thunderduck.ai/mcp \
--client-id thunderduck-mcp-cli --callback-port 33418ChatGPT: add a connector with the same URL.
More on each client in Connecting Claude & ChatGPT.
4. Ask a question
Which ten products had the most revenue in October, and how does that compare with September?
The assistant calls get_catalog_context('store') to read the tables, keys and
column meanings, checks the price with estimate_query_cost, then runs
something like:
SELECT p.name,
sum(oi.amount) FILTER (WHERE o.created_at >= DATE '2026-10-01') AS october,
sum(oi.amount) FILTER (WHERE o.created_at < DATE '2026-10-01') AS september
FROM store.shop.orders o
JOIN store.shop.order_items oi ON oi.order_id = o.id
JOIN store.shop.products p ON p.id = oi.product_id
WHERE o.created_at >= DATE '2026-09-01'
AND o.created_at < DATE '2026-11-01'
GROUP BY p.name
ORDER BY october DESC
LIMIT 10;Tables are addressed as catalog.schema.table, where the middle part is the
MySQL database name. The date filter runs inside MySQL, so it only reads two
months of orders.
What the assistant can do
| With a read-only setup | |
|---|---|
| List schemas, tables and columns | Yes |
| Read column meanings, keys and joins | Yes |
Run SELECT | Yes, within the cost limits |
| Export a large result to Parquet or CSV | Only with the export scope |
INSERT, UPDATE, DELETE, DDL | No: refused by the grants, the catalog and the token |
| Schedule a query | Only with the query:write scope |
The full list is on the Tools page.
Compared with a local open-source server
Open-source MySQL MCP servers run on your own machine with a connection string. For a database on your laptop, or a quick look at a dev database, that is the simpler choice: no account, nothing hosted, and nothing between you and the database.
Thunderduck fits when the database is shared or in production: when more than one person will connect, when the password should not sit in config files, when queries need a cost check, or when the questions span more than one database.
Related
- PostgreSQL & MySQL catalogs: every connection field
- Scopes & costs: limits, row caps and refusals
- Column meanings: how the assistant learns what columns mean
- PostgreSQL MCP server · BigQuery MCP server · ClickHouse MCP server · SQL Server MCP server