- Home
- Skills
- Data & Databases
- MySQL Safe MCP
Works with the AI Agents you already use
MySQL Safe MCP
by Wilson Coc
A safety-first MySQL MCP skill for read-only database exploration, schema inspection, and query debugging.
$10
MySQL Safe MCP
Example session with this skill installed
Connect to the production database and check why the 'orders' table is slow. Show me the schema and the first 5 high-value orders.
- Read your context and instructions
- Compiled the mysql safe mcp
I have connected to the MySQL instance and performed a schema inspection followed by a performance analysis and a bounded query.
MySQL Database Audit: 'orders' Table
Schema Inspection
| Column | Type | Null | Key | Default | Extra |
|---|---|---|---|---|---|
| id | bigint | NO | PRI | NULL | auto_increment |
| user_id | bigint | NO | MUL | NULL | |
| total_amount | decimal(10,2) | NO | NULL | ||
| status | varchar(20) | NO | 'pending' | ||
| created_at | datetime | YES | CURRENT_TIMESTAMP |
Performance Analysis (EXPLAIN)
The query SELECT * FROM orders WHERE total_amount > 1000 is performing a full table scan.
Recommendation: Add an index to the total_amount column.
EXPLAIN SELECT id, total_amount, status FROM orders WHERE total_amount > 1000 ORDER BY total_amount DESC LIMIT 5;
-- Result: type: ALL, rows: 450230, extra: Using filesort
High-Value Orders (Sample)
Executed Query: SELECT id, user_id, total_amount, status FROM orders WHERE total_amount > 5000 ORDER BY total_amount DESC LIMIT 5;
| id | user_id | total_amount | status |
|---|---|---|---|
| 8842 | 102 | 12450.00 | completed |
| 7721 | 550 | 9800.50 | shipped |
| 9012 | 882 | 8720.00 | completed |
| 6631 | 12 | 7500.25 | pending |
| 8210 | 441 | 6200.00 | completed |
Next steps
- Run
CREATE INDEX idx_total_amount ON orders(total_amount);after enabling write flags. - Inspect the
user_idforeign key for potential orphan records. - Check row counts for
status='pending'to verify queue depth.
Connects securely to your tools. The creator never sees your data.
About this skill
Cut manual MySQL schema checks, slow-query debugging, and database audits from 20–30 minutes down to under 60 seconds—with zero risk of accidental writes in production.
Connecting AI agents directly to live databases often leads to runaway SELECT * queries that burn your token budget or dangerous accidental mutations. MySQL Safe MCP pairs a ready-to-build local MCP server with a strict read-only workflow, schema-first inspection, and EXPLAIN performance diagnostics so your agent works like a careful senior backend engineer.
What it does
- Enforce Read-Only Safety by Default: Locks
INSERT,UPDATE,DELETE, andDDLoperations tofalsevia environment flags so you can inspect production or staging databases with peace of mind. - Save 20–30 Minutes per Investigation: Inspect tables, column types, approximate row counts, and slow queries in seconds instead of writing repetitive manual SQL.
- Protect Your Context Window & Token Budget: Enforces explicit column selection, mandatory
LIMITclauses on exploratory queries, and SQL-side aggregations (COUNT,SUM,GROUP BY). - Pinpoint Slow Queries & Missing Indexes: Runs
EXPLAINandEXPLAIN ANALYZEautomatically before recommending index optimizations. - Guarded Write Workflow (Optional): If you manually enable write flags, requires a
SELECT COUNT(*)impact preview and explicit user confirmation before executing any modifying query.
How it works
- 2-Minute Setup: Run the included
scripts/setup_mcp.ps1(Windows) ornpm install && npm run build(macOS/Linux) to compile and register the local MySQL MCP server. - Schema-First Discovery: Automatically inspects
SHOW TABLES,DESCRIBE, andinformation_schemarow counts before touching any data. - Bounded, Token-Safe Queries: Runs targeted
SELECTqueries withLIMITand SQL aggregations, returning clean Markdown tables and exact SQL statements. - Actionable Diagnostics: Flags full-table scans, missing indexes, unexpected
NULLs, or orphan foreign keys with concrete next steps.
Frameworks & tools
Requires Node.js 18+ and access to a local or remote MySQL 5.7 / 8.x / MariaDB instance (including AWS RDS, Railway, DigitalOcean, or local Docker/XAMPP). Compatible with Claude Code, Cursor, Codex, Antigravity, GitHub Copilot, and any MCP-compatible agent.
Why this beats prompting it yourself
Generic prompts frequently trigger full-table SELECT * dumps that exhaust context windows or skip safety checks before running risky SQL. This skill hardwires read-only defaults, schema-first discovery, LIMIT caps, and row-count write previews directly into your agent's workflow.
Use cases
- Diagnosing slow production queries and identifying missing indexes in under a minute.
- Safely auditing staging or production data without risking accidental
UPDATEorDELETEstatements. - Onboarding onto unfamiliar legacy databases by mapping schemas and row volumes instantly.
- Generating ad-hoc operational and financial summaries using SQL-side aggregations.
Known limitations
Write operations are intentionally disabled by default and require manually toggling environment flags (ALLOW_*_OPERATION) to enable. Very large BLOB or TEXT columns should be excluded from exploratory queries to keep token usage minimal.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 7 days ago
- Software
Node.jsMySQL
Git
network access to your configured MySQL host/port (read-only by default), and local environment variables for database credentials.
Permissions
What's inside
Frequently Asked Questions
New in Data & Databases
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Data & Databases.