MySQL is behind a huge chunk of the web, from WordPress blogs to large-scale e-commerce platforms. Claude Code brings Anthropic's AI to your terminal. Connect them through Sequel's MCP server and you can query your MySQL database in natural language without leaving the command line.
What You'll Accomplish
Once configured, you'll be able to open Claude Code and ask:
- "How many orders were placed today?"
- "What products are low on inventory?"
- "Show me the most recently registered users."
Claude Code will use Sequel's MCP server to translate those questions into MySQL queries, run them, and return results in your terminal.
Prerequisites
- A Sequel account: Sign up free at sequel.sh
- A running MySQL database: local or cloud-hosted (RDS, PlanetScale, Railway, etc.)
- Claude Code installed: run
npm install -g @anthropic-ai/claude-codeif needed
Step 1: Connect Your MySQL Database to Sequel
Sign in to sequel.sh and click Data Sources in the left sidebar.

Click New Connection. On the "Choose a connector" page, select MySQL.

Fill in two fields:
- Connection Name: a memorable label, e.g.
Production MySQL - Connection String: your full MySQL connection string:
mysql://username:password@host:3306/database_name

Click Connect to verify and save.
Tip: Create a read-only MySQL user first:
CREATE USER 'sequel_reader'@'%' IDENTIFIED BY 'a_strong_password'; GRANT SELECT ON myapp_production.* TO 'sequel_reader'@'%'; FLUSH PRIVILEGES;Your connection string becomes:
mysql://sequel_reader:a_strong_password@host:3306/myapp_production
Step 2: Get Your Sequel API Key
Click Settings in the left sidebar, then select API Keys from the settings navigation.

Click New key, name it claude-code-mysql, and copy the key (starts with sql_).
Step 3: Configure Claude Code to Use Sequel MCP
In your terminal:
claude mcp add sequel \
--transport http \
https://api.sequel.sh/mcp \
--header "Authorization: Bearer sql_your_api_key"
Replace sql_your_api_key with the key from Step 2. Verify with:
claude mcp list
Step 4: Query Your MySQL Database
Start a Claude Code session and ask:
How many active users are in the database?
Show me the orders placed in the last 24 hours with their total values.
Which products haven't been ordered in the past 90 days?
What You Can Do Now
- Support and ops: answer customer questions quickly without building custom admin panels
- Debugging: ask "Are there any orphaned records in the order_items table?"
- Business intelligence: ask "What's our revenue trend for the past 12 months?"
- Schema exploration: ask "What tables exist in this database?" when jumping into an unfamiliar codebase
- Data quality checks: ask "Are there any NULL values in required fields?" before running a deployment

