mysql-ops-mcp
Provides tools for interacting with MySQL databases, allowing schema browsing, running queries, and performing CRUD operations, with approval-gated destructive operations.
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-ops-mcpShow me the structure of the users table"
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 Ops MCP
English | 简体中文
A MySQL database MCP Server. Let AI tools like Claude Code / Cursor / Codex talk to your MySQL databases in natural language — browse databases and tables, inspect schemas, run queries, and perform CRUD operations, with destructive operations (DELETE / DROP) gated behind explicit user approval.
Features
🗄️ Schema browsing: list databases, list tables, describe table structure, full table info (indexes, DDL, stats)
🔍 Queries: run
SELECTqueries against any database✏️ CRUD: create tables, insert, update — with SQL-statement validation per tool
🔐 Approval-gated destructive ops:
delete_dataanddrop_tablealways require explicit user confirmation in the client🔌 Zero install: runs via
npx, configured entirely through environment variables
Related MCP server: MySQL MCP Server
Installation
Requires Node.js 18+. No clone or build needed — npx fetches and runs the published npm package on first use (see the config below).
To build from source instead (e.g. for development):
git clone https://github.com/GT-dinuo/mysql-ops-mcp.git
cd mysql-ops-mcp
npm install
npm run buildBuild output goes to dist/; the entry point is dist/index.js.
Configuration
In each project where you want to use this tool, create (or append to) .mcp.json:
{
"mcpServers": {
"mysql": {
"command": "npx",
"args": ["-y", "mysql-ops-mcp"],
"env": {
"DB_HOST": "localhost",
"DB_PORT": "3306",
"DB_USER": "root",
"DB_PASSWORD": "your_password",
"DB_DATABASE": "your_database"
}
}
}
}If you built from source, point the command at the local build instead: "command": "node", "args": ["/absolute/path/to/mysql-ops-mcp/dist/index.js"].
Environment Variables
Variable | Required | Description |
| No | MySQL host, default |
| No | MySQL port, default |
| No | MySQL user, default |
| No | MySQL password |
| No | Default database; if omitted, pass |
Usage
Once configured, just ask in natural language in your AI tool:
List all databases
Show the structure of the users table
Query the 10 most recent orders
Get full info for the users table — indexes and DDL included
Insert a test record into the users table
Delete the test record you just inserted ← the client will ask for your approval firstDestructive operations (delete_data, drop_table) are always confirmed by the MCP client before execution — nothing irreversible happens silently.
Tool List
Tool | Description |
| List all databases |
| List tables in a database |
| Show table columns and types |
| Full table details: columns, indexes, DDL, stats |
| Run a SELECT query |
| Create a table (CREATE TABLE only) |
| Insert rows (INSERT only) |
| Update rows (UPDATE only) |
| Delete rows — requires user approval |
| Drop a table — requires user approval |
| Run any custom SQL statement |
Security
Destructive operations require approval:
delete_dataanddrop_tableare gated by the MCP client's tool-call confirmation — approve or reject each one.Statement validation: each write tool only accepts its own SQL verb (e.g.
queryrejects anything butSELECT).Use a least-privilege account: don't connect as
rootin production — create a MySQL user scoped to the databases the AI may touch.Never commit credentials:
.env/.mcp.jsonwith real passwords must stay out of version control (.gitignorealready covers.env).
Testing the Connection
After configuring .env (copy from env.example), you can verify connectivity before wiring up the client:
cp env.example .env # fill in real credentials
npm run test-connectionDevelopment
npm run dev # watch mode, recompiles on change
npm run build # build to dist/
npm start # run the built ServerLicense
MIT © 2026 mysql-ops-mcp
This server cannot be deployed
Maintenance
Related MCP Connectors
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
Ask data questions in natural language. Get SQL, insights, and charts from your databases.
- dataOAuthco.thinair
PostgreSQL, MySQL, and SQL Server in one session. 26 read-only MCP tools for AI agents.
Query your warehouse or a CSV with Claude/ChatGPT over MCP, governed by table-level ACL + audit.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables natural language database operations on MySQL databases with AI integration, supporting CRUD operations, schema inspection, and audit logging with built-in security features including SQL injection protection and permission controls.317 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to securely connect to and manage MySQL databases with support for multiple database connections, complete CRUD operations, schema inspection, and dynamic connection management through natural language.7 npm81MIT
- AlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to securely interact with MySQL databases through tools for query execution, schema inspection, and transaction management. It features built-in safety controls like row limits and query validation to ensure safe and standardized database access.317 npm-
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to securely interact with MySQL databases, including listing tables, viewing schemas, and executing read-only SQL queries through natural language.6-