MySQL Ops MCP

io.github.GT-dinuoPublished by GitHub account GT-dinuov1.0.0Updated Oct 24, 2026

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

VerifiedSTDIODesktop onlyDatabasesDeveloper Tools

Overview

AI-generated overview

Local MCP server that lets an AI assistant browse MySQL schemas, run SELECT queries and perform CRUD, with DELETE and DROP gated by user approval.

What you can do
  • List databases and tables, and describe table columns and types
  • Inspect full table details including indexes, DDL and statistics
  • Run SELECT queries against any database
  • Create tables, insert and update rows, with per-tool SQL verb validation
  • Delete rows or drop tables, each requiring explicit client-side approval
  • Run arbitrary custom SQL through a general execute_sql tool
When to use it
Useful when you want an assistant to explore and modify a MySQL database in natural language from a desktop client such as Claude Code, Cursor or Codex, for example inspecting schemas, drafting queries or making small data changes.
Requirements
Runs locally over stdio via npx, so Node.js 18 or newer is needed. A reachable MySQL server plus credentials supplied through environment variables DB_HOST, DB_PORT, DB_USER, DB_PASSWORD and DB_DATABASE; all are optional and default to localhost, 3306, root and no default database.
Before you install
The server holds a MySQL password in DB_PASSWORD, which is stored in plain text in the client config file, so keep that file out of version control. Writes are possible: create_table, insert, update, delete_data, drop_table and execute_sql all change data, and execute_sql accepts any SQL statement, so the per-tool verb checks do not cover it. Approval gating depends on the client honoring tool-call confirmation. Connect with a least-privilege account rather than root.

Installation

In SourceWeft

  1. Open MySQL Ops MCP in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

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):

bash
git clone https://github.com/GT-dinuo/mysql-ops-mcp.gitcd mysql-ops-mcpnpm installnpm 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:

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 databasesShow the structure of the users tableQuery the 10 most recent ordersGet full info for the users table — indexes and DDL includedInsert a test record into the users tableDelete 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:

bash
cp env.example .env   # fill in real credentialsnpm run test-connection

Development

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

License

MIT © 2026 mysql-ops-mcp

Source: README.md at commit 295b862

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v1.0.0LatestSep 16, 2026

Score

50% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts