by devakone
Securely query your MySQL host with read-only access, robust validation, and natural language search. Easily join MySQL
Enables AI assistants to execute read-only MySQL queries using natural language across multiple database environments. Provides secure database exploration with built-in validation and error handling.
MySQL Query is a community-built MCP server published by devakone that provides AI assistants with tools and capabilities via the Model Context Protocol. Securely query your MySQL host with read-only access, robust validation, and natural language search. Easily join MySQL It is categorized under databases.
You can install MySQL Query in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.
MIT
MySQL Query is released under the MIT license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.
Enable Claude to query your database directly using natural language
Example
Ask 'Show me top 10 customers by revenue this month' and get SQL results instantly
Eliminate manual SQL writing for ad-hoc queries, get insights 10x faster
Generate complex reports and analytics without leaving conversation
Example
Analyze sales trends, cohort retention, user behavior patterns conversationally
Democratize data access—non-technical team members can query databases
Understand database structure, relationships, and data models
Example
'Explain the user_orders table schema and its relationships'
Onboard engineers faster, explore unfamiliar databases efficiently
Share your MCP server with the developer community
We evaluated MySQL Query against two servers with overlapping tools; this profile had the clearer scope statement.
MySQL Query has been reliable for tool-calling workflows; the MCP profile page is a good permalink for internal docs.
MySQL Query reduced integration guesswork — categories and install configs on the listing matched the upstream repo.
I recommend MySQL Query for teams standardizing on MCP; the explainx.ai page compares cleanly with sibling servers.
Strong directory entry: MySQL Query surfaces stars and publisher context so we could sanity-check maintenance before adopting.
MySQL Query is among the better-indexed MCP projects we tried; the explainx.ai summary tracks the official description.
According to our notes, MySQL Query benefits from clear Model Context Protocol framing — fewer ambiguous “AI plugin” claims.
We wired MySQL Query into a staging workspace; the listing’s GitHub and npm pointers saved time versus hunting across READMEs.
Useful MCP listing: MySQL Query is the kind of server we cite when onboarding engineers to host + tool permissions.
MySQL Query is a well-scoped MCP server in the explainx.ai directory — install snippets and categories matched our Claude Code setup.
showing 1-10 of 70
A Model Context Protocol (MCP) server that provides read-only MySQL database queries for AI assistants. Execute queries, explore database structures, and investigate your data directly from your AI-powered tools.
<a href="https://glama.ai/mcp/servers/@devakone/mysql-query-mcp-server"> <img width="380" height="200" src="https://glama.ai/mcp/servers/@devakone/mysql-query-mcp-server/badge" alt="MySQL Query Server MCP server" /> </a>This MCP server works with any tool that supports the Model Context Protocol, including:
.cursor/mcp.jsonThis tool is designed specifically for data investigation and exploration through read-only queries. It is not intended for database administration, schema management, or data modification.

# Install globally with npm
npm install -g mysql-query-mcp-server
# Or run directly with npx
npx mysql-query-mcp-server
Create or edit your MCP configuration file (e.g., .cursor/mcp.json for Cursor IDE):
Basic Configuration:
{
"mysql": {
"name": "MySQL Query MCP",
"description": "MySQL read-only query access through MCP",
"type": "bin",
"enabled": true,
"bin": "mysql-query-mcp"
}
}
Comprehensive Configuration with Database Credentials:
{
"mysql": {
"command": "npx",
"args": ["mysql-query-mcp-server@latest"],
"env": {
"LOCAL_DB_HOST": "localhost",
"LOCAL_DB_USER": "root",
"LOCAL_DB_PASS": "<YOUR_LOCAL_DB_PASSWORD>",
"LOCAL_DB_NAME": "your_database",
"LOCAL_DB_PORT": "3306",
"DEVELOPMENT_DB_HOST": "dev.example.com",
"DEVELOPMENT_DB_USER": "<DEV_USER>",
"DEVELOPMENT_DB_PASS": "<DEV_PASSWORD>",
"DEVELOPMENT_DB_NAME": "your_database",
"DEVELOPMENT_DB_PORT": "3306",
"STAGING_DB_HOST": "staging.example.com",
"STAGING_DB_USER": "<STAGING_USER>",
"STAGING_DB_PASS": "<STAGING_PASSWORD>",
"STAGING_DB_NAME": "your_database",
"STAGING_DB_PORT": "3306",
"PRODUCTION_DB_HOST": "prod.example.com",
"PRODUCTION_DB_USER": "<PRODUCTION_USER>",
"PRODUCTION_DB_PASS": "<PRODUCTION_PASSWORD>",
"PRODUCTION_DB_NAME": "your_database",
"PRODUCTION_DB_PORT": "3306",
"DEBUG": "false",
"MCP_MYSQL_SSL": "true",
"MCP_MYSQL_REJECT_UNAUTHORIZED": "false"
}
}
}
There are two ways to configure the MySQL MCP server:
Binary Configuration (type: "bin", bin: "mysql-query-mcp")
npm install -g mysql-query-mcp-server)Command Configuration (command: "npx", args: ["mysql-query-mcp-server@latest"])
Choose the approach that best fits your workflow. Both methods will work correctly with any AI assistant that supports MCP.
| Environment Variable | Description | Default |
|---|---|---|
| DEBUG | Enable debug logging | false |
| [ENV]_DB_HOST | Database host for environment | - |
| [ENV]_DB_USER | Database username | - |
| [ENV]_DB_PASS | Database password | - |
| [ENV]_DB_NAME | Database name | - |
| [ENV]_DB_PORT | Database port | 3306 |
| [ENV]_DB_SSL | Enable SSL connection | false |
| MCP_MYSQL_SSL | Enable SSL for all connections | false |
| MCP_MYSQL_REJECT_UNAUTHORIZED | Verify SSL certificates | true |
Your AI assistant can interact with MySQL databases through the MCP server. Here are some examples:
Example queries:
Can you use the query tool to show me the first 10 users from the database? Use the local environment.
I need to analyze our sales data. Can you run a SQL query to get the total sales per region for last month from the development database?
Can you use the info tool to check what tables are available in the staging database?
Can you list all the available database environments we have configured?
The MySQL Query MCP server provides three main tools that your AI assistant can use:
Execute read-only SQL queries against a specific environment:
Use the query tool to run:
SELECT * FROM customers WHERE signup_date > '2023-01-01' LIMIT 10;
on the development environment
Get detailed information about your database:
Use the info tool to check the status of our production database.
List all configured environments from your configuration:
Use the environments tool to show me which database environments are available.
The MySQL Query MCP server provides three main tools:
Execute read-only SQL queries:
-- Example query to run with the query tool
SELECT * FROM users LIMIT 10;
Supported query types (strictly limited to):
Get detailed information about your database:
List all configured environments from your configuration:
Use the environments tool to show me which database environments are available.
If you're having trouble connecting:
Error: No connection pool available for environment
Error: Query execution failed
For more comprehensive troubleshooting, see the Troubleshooting Guide.
For examples of how to integrate with AI assistants, see the Integration Examples.
For implementation details about the MCP protocol, see the MCP README.
Contributions are welcome! Please feel free to submit a Pull Request.
This project uses GitHub Actions for continuous integration and automated releases.
The CI/CD pipeline consists of:
Build and Test: Runs on every push to main and develop branches, and on pull requests to these branches
Release: Runs when changes are pushed to the main branch and the build/test job succeeds
release-please to manage version bumps and changelog updatesThe project follows Semantic Versioning:
Commits should follow the Conventional Commits format:
feat: add new feature - Minor vRun data quality queries to catch anomalies and inconsistencies
Example
Find duplicate records, missing values, orphaned foreign keys automatically
Maintain data integrity with less manual SQL work
Prerequisites
Time Estimate
15-30 minutes including configuration and testing
Steps
Troubleshooting
✓ Do
✗ Don't
💡 Pro Tips
Architecture
MCP server acts as bridge between Claude and database, translating natural language to SQL queries and returning results in structured format.
Protocols
Compatibility
✓ Use when
Use for ad-hoc data queries, exploratory analysis, report generation, schema exploration, and democratizing data access. Best for read-heavy analytics workloads.
✗ Avoid when
Avoid for production write operations, mission-critical transactions, real-time OLTP workloads, or when database contains sensitive PII without proper access controls. Use read replicas, not primary.