MCP server enabling read-only MySQL queries for Claude Desktop
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
Inspect callable tools, capabilities, and parameters exposed to AI agents by Read Only Local Mysql Mcp Server.
connectConnect to a MySQL database using a connection string. The connection persists for subsequent queries until changed or disconnected.
disconnectDisconnect from the current runtime database and revert to the default environment-configured connection. Takes no parameters.
queryRun a read-only SQL query against the currently connected database.
A Model Context Protocol (MCP) server that enables Claude Desktop to interact with MySQL databases through natural language queries.
Then set your database environment variables:
Done! Restart Claude Code and ask: "What tables are in my database?"
1. Open your config file:
2. Add this configuration:
3. Save, restart Claude Desktop, and test!
This server is published in the Model Context Protocol Registry as capital.hove/read-only-local-mysql-mcp-server.
Then configure your database credentials using environment variables. Restart Claude Code and you're done!
Benefits:
For Claude Desktop:
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
For Claude Code:
Edit ~/.config/claude-code/settings.json (macOS/Linux) or %APPDATA%\claude-code\settings.json (Windows):
If you're using Claude Code, you can easily install this MCP server:
Then configure Claude Code by adding to your MCP settings.
Save the repository to a directory on your system:
Note: If you installed via Option 1 (MCP Registry with npx), you've already configured everything! This section is for users who chose Options 2, 3, or 4 (npm or manual installation).
If you're using Claude Code with a manual installation, add the MySQL server to your MCP settings:
Open your Claude Code settings (typically in ~/.config/claude-code/settings.json on macOS/Linux or %APPDATA%\claude-code\settings.json on Windows)
Add the MySQL MCP server configuration:
If you're using Claude Desktop with a manual installation, open your Claude Desktop configuration file:
macOS:
Windows:
Add the MySQL server configuration:
If you're using mise for Node.js version management, make sure to use the full path to the Node.js executable in your configuration.
| Variable | Description | Default |
|---|---|---|
DB_HOST | MySQL server hostname | mysql |
DB_PORT | MySQL server port | 3306 |
DB_DATABASE | Database name | database |
DB_USERNAME | MySQL username | root |
DB_PASSWORD | MySQL password | (empty) |
Claude will automatically convert your natural language requests into appropriate SQL queries and execute them against your database.
connectConnect to a MySQL database using a connection string. The connection persists for subsequent queries until changed or disconnected.
Parameters:
| Parameter | Required | Description |
|---|---|---|
connectionString | Yes | MySQL connection string (e.g., mysql://user:password@host:port/database) |
disconnectDisconnect from the current runtime database and revert to the default environment-configured connection. Takes no parameters.
queryRun a read-only SQL query against the currently connected database.
Parameters:
| Parameter | Required | Description |
|---|---|---|
sql | Yes | SQL query to execute (read-only) |
connectionString | No | MySQL connection string to override the current connection for this query only |
The server supports switching databases at runtime without restarting. Connection priority:
connectionString β overrides everything for a single queryconnect tool) β persists until disconnect is calledConnection string format:
Example workflow:
The server only allows SELECT queries. The following operations are blocked:
INSERT - Adding new recordsUPDATE - Modifying existing recordsDELETE - Removing recordsDROP - Removing tables/databasesALTER - Modifying table structureCREATE - Creating new tables/databasesFor enhanced security, create a dedicated read-only user for the MCP server:
dist/index.js is correctclaude_desktop_config.json formatTo see server logs, you can run the server manually:
Feel free to submit issues and enhancement requests!
This project is open source and available under the MIT License.
If you encounter issues:
Note: This server is designed for development and analysis purposes. For production use, consider additional security measures and monitoring.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/read-only-local-mysql-mcp-server)<a href="https://allmcps.com/mcp/read-only-local-mysql-mcp-server"><img src="https://allmcps.com/api/badge/read-only-local-mysql-mcp-server?style=directory" alt="Read Only Local Mysql Mcp Server on AllMCPs" /></a>