To query MySQL from Cursor, run a local MCP server such as DBHub, or connect MySQL to Contextflo once and share it with your team. The local route takes a minute. The Contextflo route keeps the password off every laptop.
Option 1: DBHub in Cursor
@bytebase/dbhub supports MySQL and runs over stdio with npx. Create a read-only user first, and point DBHub at a replica:
CREATE USER 'contextflo_ro'@'%' IDENTIFIED BY '<password>';
GRANT SELECT ON mydb.* TO 'contextflo_ro'@'%';
Then add it to ~/.cursor/mcp.json (global) or .cursor/mcp.json (this repo):
{
"mcpServers": {
"mysql": {
"command": "npx",
"args": [
"-y",
"@bytebase/dbhub",
"--dsn",
"mysql://contextflo_ro:<password>@replica-host:3306/mydb"
]
}
}
}
Check the DBHub README for the exact flags in your version. Cursor lists the server in its MCP settings, where you can toggle it.
Option 2: Contextflo
Use the same read-only user. In Contextflo, go to Data Sources, then Add data source:
| Field | Value |
|---|---|
| Host | Your MySQL host |
| Port | Your MySQL port |
| Username | contextflo_ro |
| Password | The password you set |
SSL is on by default, and an SSH bastion is optional. Pick the tables to expose and invite your team. Then add Contextflo to Cursor:
{
"mcpServers": {
"contextflo": {
"url": "https://mcp.contextflo.com/mcp"
}
}
}
Cursor opens the OAuth sign-in. Contextflo runs SELECT only, and the MySQL user is read-only too.
Contextflo generates table and column descriptions. Your team saves definitions as shared context. Each person sees only their tables. The audit trail records prompts and the SQL that ran, and a weekly digest summarizes it.
Which one to use
Just you, one database, a repo open in Cursor? DBHub is enough. If your team asks too, use Contextflo: shared context, per-person table access, and an audit trail of prompts and the SQL that ran.
You do the modeling, we do the rest. Connect MySQL free.
FAQ
Which MCP server works with MySQL in Cursor? @bytebase/dbhub supports MySQL and runs over stdio with npx, so it fits Cursor's command and args config. Point it at a replica.
Should Cursor connect to my primary MySQL database? Use a replica and a read-only user. That keeps an exploratory query away from your production writes.
Does Contextflo use SSL with MySQL? SSL is on by default. You can also route through an SSH bastion if the database is not publicly reachable.
Where do I put the MySQL password in Cursor? In the connection string inside mcp.json. Keep a project-level .cursor/mcp.json out of version control, or use Contextflo so the credentials stay out of every laptop.
See it on your own data.
Connect your warehouse and your team can ask Claude about it the same day, without waiting on a data team. Want a walkthrough first? Grab 20 minutes.
Book a 20-minute callSee how teams use Contextflo
Related posts
Keep reading

Conversational analytics: 5 ways to set it up, compared
7 min read

How to connect Claude to BigQuery? What works and what doesn't in 2026
8 min read

How to connect Claude to Postgres without giving it write access
9 min read

How to build a BI dashboard with Claude that your team can actually trust
8 min read

How to give Claude read-only access to your database (it isn't always the default)
7 min read

You connected your warehouse to Claude, now what?
5 min read

Run ClickHouse queries from Codex with MCP
6 min read

Databricks in Codex: Genie One MCP or Contextflo
5 min read

Give Codex read-only access to MySQL
4 min read

