Grok can query MySQL, but not with the usual local MCP servers. Grok connectors need a server on the public internet. Contextflo is the hosted route: connect MySQL once with a read-only user, then add one URL to Grok.
MySQL often sits behind an app or a store, and the people with questions about orders or signups are not the ones writing SQL. Asking in Grok is a natural fit. The setup just has to be hosted.
Option 1: a MySQL MCP server in Grok
The common option is @bytebase/dbhub, which supports MySQL. You start it with npx and a DSN, ideally pointed at a replica.
That makes it a stdio server on your own machine. Grok can't run local servers and can't reach localhost, so it doesn't work as a Grok connector. If you expose it publicly yourself, you are now hosting a service that holds database credentials, which is more than a chat question calls for.
Option 2: Contextflo
On the MySQL side, create a read-only user:
CREATE USER 'contextflo_ro'@'%' IDENTIFIED BY '<password>';
GRANT SELECT ON mydb.* TO 'contextflo_ro'@'%';
Point Contextflo at a replica if you have one.
In Contextflo: go to Data Sources, then Add data source, and pick MySQL. Enter host, port, username and password. SSL is on by default, and an SSH bastion is optional for private databases. Pick the tables to expose and invite your team.
In Grok:
- Open grok.com/connectors.
- Choose New Connector, then Custom.
- Enter
https://mcp.contextflo.com/mcp. - Complete the sign-in.
Each person signs in with their own Contextflo account. Contextflo runs SELECT only.
What a bare connection leaves out
Application databases have cryptic names and no descriptions. Contextflo generates table and column descriptions, and your team saves corrections and definitions as shared context. You choose which tables each person can query. You get an audit trail of prompts and the SQL that ran, and a weekly digest.
Which one to use
For Grok, the hosted route is the one that works. Local MySQL servers are fine in clients that can launch processes on your machine, but Grok is not one of them.
You do the modeling, we do the rest. Connect MySQL free.
FAQ
Can Grok connect to MySQL? Yes, through a hosted MCP server. Grok connectors only reach servers on the public internet, so a local MySQL MCP server won't work. Contextflo connects to MySQL and gives Grok one URL.
Why doesn't dbhub work in Grok? @bytebase/dbhub supports MySQL, but it runs as a local stdio process with a DSN. Grok can't run local servers or reach localhost.
What does Contextflo need to connect to MySQL? A host, port, username and password. SSL is on by default, and you can connect through an SSH bastion if the database is private.
Is it safe to point this at a production MySQL database? Use a read-only user with SELECT on the schema you expose, and point it at a replica if you have one. Contextflo runs SELECT only.
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

