npm mysql-ops-mcpstdioMITupdated 1mo ago
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.
Was kannst du mit MySQL Ops MCP machen?
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
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
| Variable | Required | Description |
|---|---|---|
DB_HOST |
No | MySQL host, default localhost |
DB_PORT |
No | MySQL port, default 3306 |
DB_USER |
No | MySQL user, default root |
DB_PASSWORD |
No | MySQL password |
DB_DATABASE |
No | Default 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
| Tool | Description |
|---|---|
list_databases |
List all databases |
list_tables |
List tables in a database |
describe_table |
Show table columns and types |
get_table_info |
Full table details: columns, indexes, DDL, stats |
query |
Run a SELECT query |
create_table |
Create a table (CREATE TABLE only) |
insert |
Insert rows (INSERT only) |
update |
Update rows (UPDATE only) |
delete_data |
Delete rows — requires user approval |
drop_table |
Drop a table — requires user approval |
execute_sql |
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-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
Installation
MySQL Ops MCP zu deinem Client hinzufügen. Wähl den, den du nutzt.
claude mcp add mysql-ops-mcp -- npx -y mysql-ops-mcpcodex mcp add mysql-ops-mcp -- npx -y mysql-ops-mcpamp mcp add mysql-ops-mcp -- npx -y mysql-ops-mcp{
"mcpServers": {
"mysql-ops-mcp": {
"command": "npx",
"args": [
"-y",
"mysql-ops-mcp"
]
}
}
}Add to `claude_desktop_config.json`, then restart Claude Desktop.
{
"mcpServers": {
"mysql-ops-mcp": {
"command": "npx",
"args": [
"-y",
"mysql-ops-mcp"
]
}
}
}Add to `~/.cursor/mcp.json`, or `.cursor/mcp.json` for a single project.
code --add-mcp '{"name":"mysql-ops-mcp","command":"npx","args":["-y","mysql-ops-mcp"]}'Or add the block manually to `.vscode/mcp.json` under `servers`.
{
"mcpServers": {
"mysql-ops-mcp": {
"command": "npx",
"args": [
"-y",
"mysql-ops-mcp"
]
}
}
}Add to `~/.codeium/windsurf/mcp_config.json`.
{
"mcpServers": {
"mysql-ops-mcp": {
"command": "npx",
"args": [
"-y",
"mysql-ops-mcp"
]
}
}
}Add to `cline_mcp_settings.json` via the MCP Servers panel.
{
"mcpServers": {
"mysql-ops-mcp": {
"command": "npx",
"args": [
"-y",
"mysql-ops-mcp"
]
}
}
}Add to `~/.gemini/settings.json`.
{
"mcpServers": {
"mysql-ops-mcp": {
"type": "local",
"command": "npx",
"args": [
"-y",
"mysql-ops-mcp"
],
"tools": [
"*"
]
}
}
}Add to `~/.copilot/mcp-config.json`, or run `/mcp add` inside the CLI.
{
"context_servers": {
"mysql-ops-mcp": {
"command": {
"path": "npx",
"args": [
"-y",
"mysql-ops-mcp"
]
}
}
}
}Add to your Zed `settings.json`.
npx -y mysql-ops-mcpRun `goose configure`, choose **Add Extension → Command-line Extension**, and paste this command.
8 Tools
MySQL Ops MCP stellt einem verbundenen Agent 8 Tools bereit.
- list_databases
- List all databases
- list_tables
- List tables in a database
- describe_table
- Show table columns and types
- get_table_info
- Full table details: columns, indexes, DDL, stats
- create_table
- Create a table (CREATE TABLE only)
- delete_data
- Delete rows — requires user approval
- drop_table
- Drop a table — requires user approval
- execute_sql
- Run any custom SQL statement
Score
72 / 100
Gut
- Dokumentation25/25
- Pflege16/25
- Vertrauen13/20
- Funktionsumfang6/15
- Installation12/15
- Documents what it does and how to connect
- Has a resolvable package or endpoint
- Exposes at least one tool, prompt or resource
- README has substantive content
- Includes a code example
- Documents its configuration
- Mentions credentials or security posture
- Last commit 47 days ago
- Has a release history
- Repository is not archived
- Licensed MIT
- Namespace verified in the official MCP registry
- Claimed by its owner
- Published under an organisation
- 8 tool(s) documented
- Provides prompt templates
- Provides resources
- 12 documented install method(s)
- Published to a package registry
- Offers a hosted endpoint — no local install
Versionsverlauf
| Versionen | Veröffentlicht |
|---|---|
| 1.0.0Aktuell | 16. Juli 2026 |