Enables secure connections to local MySQL databases, supporting all types of SQL queries (SELECT, INSERT, UPDATE, DELETE, etc.) through natural language interaction
SQL MCP Server for Claude Desktop
A natural language interface to your local MySQL databases through Claude Desktop. This MCP (Machine Communication Protocol) server allows Claude to execute SQL queries on your local MySQL databases, enabling you to interact with your databases using natural language.
Features
Natural language to SQL query conversion through Claude
Secure connection to local MySQL databases
Support for multiple databases
Transaction management for data consistency
Connection pooling for better performance
Support for all types of SQL queries (SELECT, INSERT, UPDATE, DELETE, etc.)
Prerequisites
Python 3.8 or higher
MySQL server installed and running
Claude Desktop application
Virtual environment (recommended)
Installation
Clone this repository:
Create and activate a virtual environment:
Install dependencies:
Create a
.env
file in the project root with your MySQL credentials:
Update the directory path in
run.sh
:
Make the run script executable:
Configuration in Claude Desktop
Open Claude Desktop's MCP configuration
Add the following configuration:
Replace /absolute/path/to/your/mysql-mcp
with the actual absolute path to your project directory.
Usage
Once configured, you can interact with your databases through Claude Desktop using natural language. Examples:
Selecting a database and creating a table:
Inserting data:
Querying data:
Important Notes
Always use absolute paths in the run.sh script and Claude Desktop configuration
Ensure MySQL server is running before using the MCP server
Keep your .env file secure and never commit it to version control
The MCP server uses connection pooling with a default pool size of 5 connections
Troubleshooting
If you get a "connection refused" error, ensure your MySQL server is running
If you get an authentication error, verify your credentials in the .env file
For permission errors, ensure your MySQL user has appropriate privileges for the operations you're trying to perform
Security Considerations
Store sensitive credentials in the .env file
Use a MySQL user with appropriate permissions (avoid using root)
Keep your virtual environment and dependencies up to date
Consider network security if accessing non-localhost MySQL servers
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
A natural language interface that allows Claude to execute SQL queries on your local MySQL databases, enabling database interaction using natural language.
- Features
- Prerequisites
- Installation
- Configuration in Claude Desktop
- Usage
- Important Notes
- Troubleshooting
- Security Considerations
Related Resources
Related MCP Servers
- -securityFlicense-qualityA simple server that integrates with Claude to allow querying and manipulating Notion pages and databases through natural language prompts.Last updated -199
- -securityFlicense-qualityA server that enables interaction with PostgreSQL, MySQL, MariaDB, or SQLite databases through Claude Desktop using natural language queries.Last updated -
- -securityAlicense-qualityA connector that gives Claude direct access to MySQL databases through the Model Context Protocol, enabling natural language querying, schema exploration, and database management.Last updated -MIT License
- -securityFlicense-qualityProvides Claude Desktop with secure access to multiple database connections, allowing users to query MySQL, PostgreSQL, SQLite, and SQL Server databases directly through natural language.Last updated -