MySQL MCP Server
Provides tools for interacting with a MySQL database, including listing tables, describing schemas, fetching data with filters and pagination, updating, deleting, truncating, and bulk modifications with safety constraints.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MySQL MCP ServerShow me all tables"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MySQL MCP Server
A Model Context Protocol (MCP) server that provides structured MySQL database operations for Claude Desktop. Converts natural language database requests into safe, parameterized queries.
Features
7 tools:
list_tables,describe_table,fetch,update,delete,truncate,modify_bulkSafety first: No raw SQL, parameterized queries, identifier sanitization
Guard rails: UPDATE/DELETE require filters, TRUNCATE requires confirmation
Preview mode: Bulk operations show impact before executing
Stdio transport: Designed for Claude Desktop integration
Related MCP server: MCPDB - Database Access MCP Server
Project Structure
mysql-mcp/
├── package.json
└── src/
├── index.js # MCP server entry point (stdio transport)
├── db.js # MySQL connection pool
├── tools.js # Tool definitions (JSON Schema)
└── handlers.js # Tool execution logic + safety checksSetup
1. Install dependencies
cd mysql-mcp
npm install2. Configure Claude Desktop
Open your Claude Desktop config file:
Windows:
%APPDATA%\Claude\claude_desktop_config.jsonmacOS:
~/Library/Application Support/Claude/claude_desktop_config.json
Add this to the mcpServers section:
{
"mcpServers": {
"mysql": {
"command": "node",
"args": ["D:/100xDev/mysql-mcp/src/index.js"],
"env": {
"DB_HOST": "localhost",
"DB_PORT": "3306",
"DB_USER": "root",
"DB_PASSWORD": "your_password_here",
"DB_NAME": "your_database_name"
}
}
}
}Important: Use the full absolute path to
index.jsin theargsarray. Update theenvvalues to match your MySQL setup.
3. Restart Claude Desktop
Close and reopen Claude Desktop. You should see the MySQL tools available in the tools menu.
Available Tools
Tool | Description |
| Show all tables in the database |
| Show column structure of a table |
| SELECT with filters, sorting, pagination |
| UPDATE with required filters |
| DELETE with required filters |
| Drop all rows (requires |
| Deduplicate, normalize, or cleanup data |
Safety Rules
No raw SQL — All queries are built from structured input
Identifier sanitization — Table/column names are validated against
[a-zA-Z_][a-zA-Z0-9_]*Parameterized queries — All values use
?placeholders (no SQL injection)UPDATE requires filters — Cannot update all rows accidentally
DELETE requires filters — Cannot delete all rows accidentally
TRUNCATE requires confirmation — Must pass
confirm: trueBulk operations preview first — Shows impact before executing
Row limit cap — Fetch is capped at 1000 rows max
Example Prompts
Once connected in Claude Desktop, you can use natural language:
"Show me all tables"
"What columns does the users table have?"
"Get all users where status is active"
"Update the name to 'Zoher' where id is 5"
"Delete all orders where status is cancelled"
"Find duplicate entries in users by email"
"Normalize status values: replace 'actve' with 'active' in users"
Environment Variables
Variable | Default | Description |
|
| MySQL host |
|
| MySQL port |
|
| MySQL username |
|
| MySQL password |
|
| Database name |
This server cannot be deployed
Maintenance
Related MCP Connectors
Query your warehouse or a CSV with Claude/ChatGPT over MCP, governed by table-level ACL + audit.
Query 40 databases from Claude, ChatGPT, or Cursor — on any device. Read-only, encrypted, audited.
- dataOAuthco.thinair
PostgreSQL, MySQL, and SQL Server in one session. 26 read-only MCP tools for AI agents.
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA natural language interface that allows Claude to execute SQL queries on your local MySQL databases, enabling database interaction using natural language.5-
- FlicenseNot gradedqualityDmaintenanceProvides Claude Desktop with secure access to multiple database connections, allowing users to query MySQL, PostgreSQL, SQLite, and SQL Server databases directly through natural language.-
- AlicenseNot gradedqualityDmaintenanceEnables Claude Desktop to interact with MySQL databases through secure query execution, schema discovery, and multi-database support with configurable read/write permissions and built-in SQL injection protection.158 npmMIT
- AlicenseNot gradedqualityDmaintenanceConnects AI assistants like Claude Desktop directly to MySQL databases, enabling natural language interaction for schema inspection, data querying, CRUD operations, and database administration tasks.9 npmMIT