MCP server
MySQL MCP server
A community MCP server that lets AI run SQL against MySQL, read-only by default, with insert, update and delete each switched on separately.
- Community server
- Databases
At a glance
- Maintained by
- Ben Borla (community)
- Tools exposed
- 1 listed below
- Reviewed
- September 24, 2026
Why it matters
What it does and why it matters
MySQL runs a large share of business websites and apps, including many WordPress and WooCommerce stores. A MySQL MCP server lets an AI assistant query that data directly, so questions about orders, customers or content can be answered in plain English.
We did not find a production-grade MySQL server from the vendor. Oracle's own server targets MySQL HeatWave and is labeled as not for production use. The community server by Ben Borla is widely used and exposes a single query tool.
It is read-only by default. Insert, update and delete can each be turned on with a separate setting, which makes it easy to allow exactly what a workflow needs and nothing more. For business reporting we keep all three off and connect a user with read access to specific tables.
Because it is a community server, review the code and pin the version you tested before connecting it to real data.
Use cases
Best business use cases
Store questions
Ad hoc reports
Content audits
Support lookups
Schema discovery
Tools
Available tools
Tool names as published by the maintainer at review time. Versions change, so check the repository for the current list.
Read and write: Read-only by default; insert, update and delete can each be turned on with an env flag.
-
mysql_queryRuns SQL queries. Read-only by default; writes need the ALLOW_* flags.
Workflows
Example workflows
Weekly store summary
-
1
Connect the server to a read-only user.
-
2
Ask for last week's orders by product category.
-
3
The assistant writes and runs the query.
-
4
It compares the result with the week before.
-
5
It drafts a short summary for the team.
Customer lookup in support
-
1
A customer asks about an order.
-
2
The support assistant queries the order by email and date.
-
3
It shows status and items to the agent.
-
4
The agent replies with the details.
-
5
No write access is needed at any step.
Prompts
Example prompts
“How many orders did we receive last week, by product category?”
“Which customers ordered more than three times this year?”
“List tables that store product data and describe their columns.”
Setup
Installation and configuration
Examples for Claude Desktop and Claude Code. Replace the placeholder values with your own keys, and store secrets outside version control.
Claude Desktop: claude_desktop_config.json
{
"mcpServers": {
"mcp_server_mysql": {
"command": "npx",
"args": [
"-y",
"@benborla29/mcp-server-mysql"
],
"env": {
"MYSQL_HOST": "127.0.0.1",
"MYSQL_PORT": "3306",
"MYSQL_USER": "root",
"MYSQL_PASS": "your_password",
"MYSQL_DB": "your_database"
}
}
}
}
Claude Code: terminal
claude mcp add mcp_server_mysql -e MYSQL_HOST="127.0.0.1" -e MYSQL_PORT="3306" -e MYSQL_USER="root" -e MYSQL_PASS="your_password" -e MYSQL_DB="your_database" -- npx @benborla29/mcp-server-mysql
- Local server: stdio. npm: @benborla29/mcp-server-mysql.
- Needs: MYSQL_HOST; MYSQL_PORT; MYSQL_USER; MYSQL_PASS; MYSQL_DB; Optional write flags: ALLOW_INSERT_OPERATION, ALLOW_UPDATE_OPERATION, ALLOW_DELETE_OPERATION.
Security
Security considerations
-
Least privilege
Create a dedicated database user that can read only the tables the assistant needs.
-
Use a replica
Point the server at a read replica or copy, not the primary production database.
-
Log every query
Keep a log of the queries the assistant runs, and review it in the first weeks.
-
Watch for sensitive data
Keep insert, update and delete off unless a workflow truly needs them, and turn on one at a time.
Related servers
Servers that pair well with it
PostgreSQL
Lets AI assistants explore a PostgreSQL database, run SQL in a restricted read-only mode and check query performance and database health.
WooCommerce
WooCommerce's official MCP support, in preview, exposes store abilities for products and orders through the WordPress MCP Adapter.
SQLite
A community MCP server for SQLite files that lets AI list tables, read and change records and run SQL on a local database.
Keep exploring
Solutions and services that use it
Related services
View all related services- MCP integration Connect AI assistants to your CRM, files, databases and tools through Model Context Protocol servers, with safe permissions.
- Database design Data models that stay fast and correct as your business grows, with backups and access rules in place.
- Dashboards and reporting Dashboards that pull numbers from the systems you already use and show what matters without a spreadsheet.
- Web applications Custom browser-based software for the work your team does every day, from booking tools to operations systems.
- Multi-tenant architecture One product serving many customer accounts, with each account's data kept separate and secure.
- Product scaling Keep a growing product fast and stable as users, data and features increase.
Solutions
View all solutions- Automated reporting Reports that build themselves from your systems on schedule, with a plain-language summary of what changed.
- Knowledge assistant (RAG) Ask a question in plain words and get an answer from your own documents, with links to the sources.
- Forecasting dashboards Forecast demand from your sales history and seasonality, and flag items to reorder before they run out.
- Payroll automation Turn pay rules, attendance and leave into tested software so the monthly run becomes a review and payslips go out in one batch.
- AI automation and integrations Connect the tools you already use so data moves once, correctly, and AI reads the parts that arrive as text or documents.
- Price monitoring Collect competitor prices automatically, match them to your products and alert you when something changes.
Industries
View all industries- Finance and accounting Client portals, document collection, invoice and receipt processing, and reporting for accounting firms and finance teams.
- Logistics and transportation Driver apps, order and shipment tracking, document processing and integrations for logistics and delivery companies.
- Manufacturing Quality inspection, production dashboards, quoting tools, knowledge assistants and legacy system modernization for manufacturers.
Case studies
View all case studiesGuides and articles
View all guides and articles- How to connect AI to your database safely Let staff ask questions of your data in plain English without risking production systems or sensitive records.
- How to automate reporting with AI and MCP Build reports that assemble themselves from your systems through MCP, with a written summary people can trust.
- PostgreSQL vs MySQL The two most popular open-source databases compared for business applications.
- How to set up automated reporting Replace manual weekly and monthly reports with dashboards and summaries that update themselves.
AI models
View all ai models- text-embedding-3-large OpenAI's most capable embedding model for search and retrieval, with 3,072-dimension vectors and support for English and other languages.
- text-embedding-3-small OpenAI's efficient, lowest-cost embedding model, with 1,536-dimension vectors for search, retrieval and similarity at scale.
- Cohere Embed v4 Cohere's multimodal embedding model for enterprise search, embedding text, images and mixed documents, with flexible vector sizes and long inputs.
- Voyage 4 Voyage AI's current embedding series, now part of MongoDB, with large, standard and lite models that share one embedding space.
- Embeddings Models that turn text into vectors for search, retrieval, clustering and recommendations.
- Claude Sonnet 5 Anthropic's balance of speed and intelligence: a strong everyday model for assistants, document work, tool calling and coding.
Glossary terms
View all glossary terms- Database A database is an organized store of data that software can search, update and keep consistent, such as customers, orders or bookings.
- Structured output Structured output is when an AI model returns its answer in a fixed format, such as JSON matching a schema, so software can use it reliably.
- Vector database A vector database stores embeddings, lists of numbers that represent meaning, and quickly finds the ones most similar to a query.
- Backend The backend is the part of an application that runs on servers, storing data, applying business rules and serving the frontend through APIs.
- Embeddings Embeddings are lists of numbers that represent the meaning of text or images, so software can find items that are similar in meaning.
- Hallucination A hallucination is when an AI model states something false or invented as if it were true, such as a made-up fact, figure or source.
FAQ
Questions people ask us
Have a question that is not here? Ask us directly.
Oracle offers one for MySQL HeatWave that it labels as not for production. The server listed here is a widely used community server.
Only if you turn on insert, update or delete, each with its own setting. It is read-only by default.
Yes, WordPress uses MySQL or MariaDB. Use a read-only user for reporting.