Back to Browse

Mysql Ops MCP Server

Data & AnalyticsModerate5.8MCP RegistryLocal
Free

Server data from the Official MCP Registry

MySQL MCP server: browse schema, query, CRUD. Delete/drop gated by user approval.

About

MySQL MCP server: browse schema, query, CRUD. Delete/drop gated by user approval.

Security Report

5.8
Moderate5.8Moderate Risk

This MySQL MCP server has a solid foundation with approval-gated destructive operations and statement validation, but contains critical SQL injection vulnerabilities in the `getTableInfo` method that directly interpolate user-controlled database and table names into queries without proper escaping. The architecture is sound and permissions are appropriate for a database tool, but the injection flaws must be fixed before production use. Supply chain analysis found 1 known vulnerability in dependencies (0 critical, 1 high severity). Package verification found 1 issue.

5 files analyzed · 9 issues found

Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.

Permissions Required

This plugin requests these system permissions. Most are normal for its category.

env_vars

Check that this permission is expected for this type of plugin.

HTTP Network Access

Connects to external APIs or services over the internet.

database

Check that this permission is expected for this type of plugin.

What You'll Need

Set these up before or after installing:

MySQL host, default localhostOptional

Environment variable: DB_HOST

MySQL port, default 3306Optional

Environment variable: DB_PORT

MySQL user, default rootOptional

Environment variable: DB_USER

MySQL passwordRequired

Environment variable: DB_PASSWORD

Default database; can also be passed per tool callOptional

Environment variable: DB_DATABASE

How to Install

Add this to your MCP configuration file:

{
  "mcpServers": {
    "io-github-gt-dinuo-mysql-ops-mcp": {
      "env": {
        "DB_HOST": "your-db-host-here",
        "DB_PORT": "your-db-port-here",
        "DB_USER": "your-db-user-here",
        "DB_DATABASE": "your-db-database-here",
        "DB_PASSWORD": "your-db-password-here"
      },
      "args": [
        "-y",
        "mysql-ops-mcp"
      ],
      "command": "npx"
    }
  }
}

Documentation

View on GitHub

From the project's GitHub README.

MySQL Ops MCP

English | 简体中文

npm version License: MIT Node.js MCP GitHub stars

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 SELECT queries against any database
  • ✏️ CRUD: create tables, insert, update — with SQL-statement validation per tool
  • 🔐 Approval-gated destructive ops: delete_data and drop_table always require explicit user confirmation in the client
  • 🔌 Zero install: runs via npx, configured entirely through environment variables

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 build

Build 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

VariableRequiredDescription
DB_HOSTNoMySQL host, default localhost
DB_PORTNoMySQL port, default 3306
DB_USERNoMySQL user, default root
DB_PASSWORDNoMySQL password
DB_DATABASENoDefault database; if omitted, pass database per tool call

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 first

Destructive operations (delete_data, drop_table) are always confirmed by the MCP client before execution — nothing irreversible happens silently.

Tool List

ToolDescription
list_databasesList all databases
list_tablesList tables in a database
describe_tableShow table columns and types
get_table_infoFull table details: columns, indexes, DDL, stats
queryRun a SELECT query
create_tableCreate a table (CREATE TABLE only)
insertInsert rows (INSERT only)
updateUpdate rows (UPDATE only)
delete_dataDelete rows — requires user approval
drop_tableDrop a table — requires user approval
execute_sqlRun any custom SQL statement

Security

  1. Destructive operations require approval: delete_data and drop_table are gated by the MCP client's tool-call confirmation — approve or reject each one.
  2. Statement validation: each write tool only accepts its own SQL verb (e.g. query rejects anything but SELECT).
  3. Use a least-privilege account: don't connect as root in production — create a MySQL user scoped to the databases the AI may touch.
  4. Never commit credentials: .env / .mcp.json with real passwords must stay out of version control (.gitignore already 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-connection

Development

npm run dev    # watch mode, recompiles on change
npm run build  # build to dist/
npm start      # run the built Server

License

MIT © 2026 mysql-ops-mcp

Reviews

No reviews yet

Be the first to review this server!

Mysql Ops MCP Server - MySQL MCP server: browse schema, query, CRUD. Delete/drop | MCP Marketplace