MySQL MCP Server
This server provides tools to interact with a MySQL database, allowing you to inspect its structure and execute both read-only and write queries.
Check MySQL version (
select_mysql_version): Returns the version of the connected MySQL server.List tables (
list_tables): Lists all tables in the connected database.Describe table (
describe_table): Shows columns, data types, and constraints for a given table.Execute read-only queries (
query): RunsSELECTstatements with support for optional parameterized inputs (?placeholders).Execute write queries (
mutate): RunsINSERT,UPDATE, orDELETEstatements with optional parameterized inputs. Note:SELECTstatements are explicitly rejected by this tool.
Allows connecting to a MySQL database to inspect schema, list tables, describe columns, and run read/write queries.
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 Server list all tables in the database"
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 connects Claude (or any MCP-compatible client) to a MySQL database. It exposes tools for schema inspection and running read/write queries over a stdio transport.
Tools
Tool | Description |
| Returns the connected MySQL server version |
| Lists all tables in the connected database |
| Shows columns, types, and constraints for a given table |
| Runs a read-only |
| Runs an |
Note:
mutaterejectsSELECTstatements — usequeryfor reads.
Related MCP server: mcp-mysql-server
Requirements
Node.js 18+
A running MySQL instance
Quick Install (Recommended)
1. Download the plugin
Go to the Releases page and download the latest .mcpb file (e.g. mysql-mcp-server-v1.0.1.mcpb).
2. Install the plugin
Via Claude Code CLI:
claude plugin install mysql-mcp-server-v1.0.1.mcpbVia Claude Desktop:
Double-click the .mcpb file — Claude Desktop will prompt you to install it.
3. Configure your database connection
After installation, Claude will prompt you to fill in your connection details:
Field | Default | Description |
Database Host |
| MySQL hostname or IP |
Database Port |
| MySQL port |
Database User |
| MySQL username |
Database Password | (empty) | MySQL password |
Database Name | (required) | Database to connect to |
Connection Pool Limit |
| Max concurrent connections |
You can update these settings at any time in Claude's plugin settings under MySQL MCP Server.
Manual Setup (from source)
1. Clone and install dependencies
git clone https://github.com/iamdylanngo/mysql-mcp-server
cd mcp
npm install2. Configure environment
Copy the sample env file and fill in your database credentials:
cp .env.sample .envDB_HOST=127.0.0.1
DB_PORT=3306
DB_USER=root
DB_PASSWORD=root
DB_NAME=mydb
DB_POOL_LIMIT=103. Build
npm run buildUsage
Run directly
node --env-file=.env build/index.jsInspect with MCP Inspector
npm run mcpConnect to Claude Desktop
Add the following to your claude_desktop_config.json:
{
"mcpServers": {
"mysql": {
"command": "node",
"args": ["/[absolute-path]/mysql-mcp-server/build/index.js"],
"env": {
"DB_HOST": "127.0.0.1",
"DB_PORT": "3306",
"DB_USER": "root",
"DB_PASSWORD": "your_password",
"DB_NAME": "your_database",
"DB_POOL_LIMIT": "10"
}
}
}
}Environment Variables
Variable | Default | Description |
|
| MySQL host |
|
| MySQL port |
|
| MySQL user |
| (empty) | MySQL password |
|
| Database name |
|
| Connection pool size |
Tech Stack
MCP SDK — MCP server framework
mysql2 — MySQL client with promise support
Zod — Input schema validation
TypeScript
License
Available Tools
5 toolsdescribe_tableC
Show columns, types, and constraints for a table.
Inputs: tableName (required).
list_tablesB
Listing all table, that connected to the database.
Inputs: no named parameters.
mutateC
Run an INSERT, UPDATE, or DELETE statement with optional params
Inputs: sql (required), params.
queryB
Run a read-only SELECT query with optional params (? placeholders).
Inputs: sql (required), params.
select_mysql_versionD
MySQL version.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a distinct purpose: listing tables, describing a table, running SELECT queries, running INSERT/UPDATE/DELETE, and fetching MySQL version. There is no overlap.
Tool names mix verb_noun patterns (list_tables, describe_table) with single-verb names (mutate, query) and a verbose name (select_mysql_version). The inconsistency could confuse an agent about naming conventions.
With 5 tools covering listing, describing, querying, mutating, and version checking, the tool count is well-scoped for a MySQL server providing basic database interaction.
The tools cover essential read/write operations and schema inspection, but lack DDL tools like create or drop table. The mutate tool is limited to DML, so agents cannot perform schema changes.
Maintenance
Related MCP Connectors
Hosted MySQL MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Text-to-SQL MCP server: read-only queries on PostgreSQL, MySQL and SQL Server with your real schema
Hosted SQL Server MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Talk to your public-facing AI from any MCP client — Claude, ChatGPT, Cursor, Cline, Windsurf.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceA Model Context Protocol (MCP) server that connects Claude Code to MySQL databases. Supports SSH tunnels, SSL/TLS, and multiple simultaneous connections.28 npm1MIT
- AlicenseNot gradedqualityDmaintenanceProvides a lightweight MySQL database interface via stdio, enabling query execution, data manipulation, schema inspection, and connection testing using FastMCP tools.3MIT
- AlicenseAqualityDmaintenanceA Model Context Protocol (MCP) server for interacting with MySQL databases. Provides tools for querying, inspecting, and modifying databases directly from Claude.78 npmMIT
- AlicenseNot gradedqualityDmaintenanceMCP server for MySQL/MariaDB/Aurora MySQL that enables executing SQL queries, explaining query plans, inspecting schema, checking health, and running diagnostic playbooks through Claude.Apache 2.0