- Home
- MCP servers
- MySQL
MySQL
- typescript
3
GitHub Stars
typescript
Language
4 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"hovecapital-read-only-local-mysql-mcp-server": {
"command": "npx",
"args": [
"-y",
"@hovecapital/read-only-mysql-mcp-server"
],
"env": {
"DB_HOST": "localhost",
"DB_PORT": "3306",
"DB_DATABASE": "your_database_name",
"DB_PASSWORD": "your_password",
"DB_USERNAME": "your_username"
}
}
}
}You can use this MCP server to let Claude Desktop or Claude Code query your MySQL databases using natural language. It runs in read-only mode, validating queries to allow only SELECT statements, and returns results in JSON so you can easily display them in your client workflows.
How to use
Set up the MCP server as a local process that Claude can talk to, then ask natural language questions about your database. You can query what tables exist, inspect table structures, fetch sample records, or count and summarize data. The server converts your natural language request into a safe, read-only SQL query, executes it against your MySQL database, and returns results in JSON.
How to install
Prerequisites you need before installing: Node.js (v16 or higher) and a MySQL database server. You also need Claude Desktop or Claude Code to connect to the MCP server.
# Install using MCP Registry method (recommended)
claude mcp add mysql -s user -- npx -y @hovecapital/read-only-mysql-mcp-server
# Or install locally via npm
npm install -g @hovecapital/read-only-mysql-mcp-server
# If you prefer a manual clone/build flow, follow the Manual Installation steps below
Additional configuration and security
Configure your database credentials via environment variables when using the MCP server. For best security, create a dedicated read-only user in MySQL and grant only SELECT permissions on the target database.
-- Create a read-only user
CREATE USER 'claude_readonly'@'localhost' IDENTIFIED BY 'secure_password';
-- Grant only SELECT permissions on your specific database
GRANT SELECT ON your_database_name.* TO 'claude_readonly'@'localhost';
-- Apply the changes
FLUSH PRIVILEGES;
Troubleshooting
If you encounter issues, verify the MCP server is reachable, check credentials, and ensure Claude can reach the MySQL host. Restart Claude after any configuration change and confirm you are using the correct absolute path if you run the server manually.
Usage examples
You can ask questions like: Show me all tables in my database, What’s the structure of the users table, Get the first 10 records from the products table, How many orders were placed last month, Show me users with email addresses ending in @gmail.com.
Available tools
execute_read_only_sql
Executes a read-only SQL SELECT query against the configured MySQL database and returns results in JSON.
validate_select_only
Enforces read-only access by blocking non-SELECT operations to protect data integrity.
format_json_results
Formats query results as JSON for easy consumption by Claude and the client application.