DEV Community

Dylan Ngo
Dylan Ngo

Posted on

Talk to Your MySQL Database with Claude — No SQL Required

If you use Claude daily, you already know it's great for writing, coding, and answering questions. But what if Claude could also query your live MySQL database — in plain English?

That's exactly what the MySQL MCP Server plugin makes possible. In this tutorial, I'll show you how to install it and start having real conversations with your database in under five minutes.


What is MCP?

MCP (Model Context Protocol) is an open standard that lets AI assistants like Claude connect to external tools and data sources. Think of it as a plugin system: instead of copy-pasting data into Claude's chat window, you connect Claude directly to the source.

With an MCP server running, Claude can read and write data in real time — no manual exports, no SQL gymnastics.


What Can You Do With This Plugin?

Once connected, you can ask Claude things like:

  • "What tables are in my database?"
  • "Show me all orders placed in the last 7 days."
  • "How many users signed up this month compared to last month?"
  • "Update the status of order #1042 to 'shipped'."

Claude translates your plain-English request into the right SQL query, runs it, and gives you a human-readable answer. You stay in the conversation — no switching to a SQL client.


Prerequisites

  • Node.js 18+ installed on your machine
  • A running MySQL instance (local or remote)
  • Claude Desktop or Claude Code (CLI)

Step 1: Download the Plugin

Head to the Releases page and download the latest .mcpb file:

mysql-mcp-server-v1.0.1.mcpb
Enter fullscreen mode Exit fullscreen mode

.mcpb is Claude's plugin bundle format — a single file that contains everything needed to run the server.


Step 2: Install the Plugin

Option A — Claude Code (CLI):

claude plugin install mysql-mcp-server-v1.0.1.mcpb
Enter fullscreen mode Exit fullscreen mode

Option B — Claude Desktop:

Double-click the .mcpb file. Claude Desktop will detect it and open an install prompt.


Step 3: Configure Your Database Connection

After installation, Claude will ask for your connection details. Fill in the fields:

Field Example Notes
Database Host 127.0.0.1 Use your server IP for remote databases
Database Port 3306 Default MySQL port
Database User root Use a least-privilege user in production
Database Password •••••• Stored securely
Database Name mydb The specific database to connect to
Connection Pool Limit 10 Max concurrent connections

Tip: For production use, create a dedicated read-only MySQL user for Claude. This prevents accidental writes if you only need to query data.

You can update these settings at any time from Claude's plugin settings under MySQL MCP Server.


Step 4: Try It Out

Once connected, start a new conversation in Claude and try these prompts:

Explore your schema:

"What tables do I have? Give me a quick summary of what each one stores."

Query data in plain English:

"Show me the 10 most recent signups with their email and created date."

Get aggregations without writing SQL:

"How many orders are in each status? Show me a breakdown."

Write data when you need to:

"Set the is_active flag to false for all users who haven't logged in since January."

Claude will show you the SQL it's about to run before executing write operations, so you're always in control.


Available Tools

The plugin exposes five tools that Claude uses behind the scenes:

Tool What it does
select_mysql_version Returns the MySQL server version
list_tables Lists all tables in the connected database
describe_table Shows columns, types, and constraints for a table
query Runs a read-only SELECT query
mutate Runs INSERT, UPDATE, or DELETE statements

mutate rejects SELECT statements — reads and writes are intentionally separated.


Want to Build on It?

The source is on GitHub: iamdylanngo/mysql-mcp-server

It's built with TypeScript, the MCP SDK, mysql2, and Zod for input validation. PRs and issues are welcome.


Wrapping Up

The MySQL MCP Server bridges the gap between Claude's language understanding and your real data. If you've ever wanted to ask questions about your database the same way you'd ask a colleague, this is the plugin to try.

Download it from the Releases page and let me know what you build with it in the comments.


Tags: claude mcp mysql ai database

Top comments (0)