How to connect MySQL to Claude (and ask it anything in plain English)
Your MySQL database knows everything. Your AI doesn't.
You've got years of business data sitting in MySQL. Customer records, transaction history, usage metrics, inventory — all of it structured, indexed, queryable.
And you've got Claude, one of the most capable AI models available today.
The problem: they can't talk to each other. Claude doesn't know your schema exists. Every time someone needs an insight from your data, they're either writing SQL manually, asking the data team, or exporting CSVs and pasting them into a chat window.
There's a better way.
What MCP actually does
Model Context Protocol (MCP) is the standard that lets AI models interact with external data sources in a structured, secure way. Think of it as a typed API between your database and any MCP-compatible client — Claude Desktop, Cursor, n8n, Continue, and others.
When MCP is set up correctly, you can ask Claude: "Which product categories had the highest return rate last quarter?" — and it queries your MySQL database, processes the result, and gives you a clear answer. No SQL required. No data team ticket. No waiting.
The model doesn't store your data. It doesn't have standing access to your database. It queries on-demand, through a controlled interface, and returns results in natural language.
Step 1: Sign up for conexor.io
Go to conexor.io and create a free account. No credit card required — you get a 14-day trial with full access.
Conexor is MCP infrastructure built specifically for this use case: connecting databases to AI models without custom code or a running server to manage.
Step 2: Add your MySQL connection
In the Conexor dashboard, click Add data source and select MySQL.
You'll need:
- Host and port (default: 3306)
- Database name
- Username and password
- SSL settings if applicable
Conexor connects directly to your database — your data never passes through Conexor's servers. The platform maps your schema and generates MCP tool definitions, but the query execution happens between the AI model and your database.
Step 3: Let Conexor discover your schema
Once connected, Conexor runs schema discovery. It reads your table structure, column types, indexes, and relationships — and turns them into a set of MCP tools that Claude can call.
A table like orders with columns id, customer_id, total, status, created_at becomes a queryable tool with built-in parameter validation.
This is the step that would take days to build manually. Conexor does it automatically in under 30 seconds.
Step 4: Connect to Claude Desktop
Conexor gives you an MCP server URL. To add it to Claude Desktop:
- Open Claude Desktop settings → Developer → Edit Config
- Add your Conexor MCP server under
mcpServers - Restart Claude Desktop
You'll see a small hammer icon appear in the Claude interface — that means your MCP tools are active and ready.
Step 5: Start asking questions
Open a new conversation in Claude Desktop and try:
- "How many new customers signed up this month vs last month?"
- "What's the average order value by country?"
- "Show me the top 10 products by revenue in Q1."
Claude will call your MySQL database, get the results, and respond in plain English — with the actual numbers from your live data.
What about security?
Good question to ask. A few things worth knowing:
- Read-only by default. Conexor generates SELECT-only MCP tools. No INSERT, UPDATE, or DELETE unless you explicitly configure it.
- Your data stays in your infrastructure. Query results pass directly from your database to the AI model — Conexor doesn't store or log query results.
- Parameterized queries only. Conexor uses parameterized query execution, not string substitution — so SQL injection via natural language prompts isn't a vector.
If you want a deeper dive on the security model, we wrote about it here: How conexor.io enforces zero data exposure.
The same works for PostgreSQL, SQL Server, and REST APIs
This tutorial used MySQL, but the setup is identical for PostgreSQL and SQL Server. REST APIs are also supported — useful if your data lives behind an internal API rather than a database directly.
If you're on PostgreSQL, we have a step-by-step guide for that too.
Try it now
The free tier includes 1 MCP server, 1 database connection, and 1,000 queries per month — more than enough to get started and see whether it fits your workflow.
Start your free trial at conexor.io → No credit card. No infrastructure to manage. 5-minute setup.