by benborla
Securely join MySQL databases with Read MySQL for read-only query access and in-depth data analysis.
Provides secure read-only access to MySQL databases through SSH tunnels, letting you query data and analyze database schemas directly from Claude.
Read MySQL is a community-built MCP server published by benborla that provides AI assistants with tools and capabilities via the Model Context Protocol. Securely join MySQL databases with Read MySQL for read-only query access and in-depth data analysis. It is categorized under databases, developer tools.
You can install Read MySQL 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
Read MySQL 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
Read MySQL is a well-scoped MCP server in the explainx.ai directory — install snippets and categories matched our Claude Code setup.
I recommend Read MySQL for teams standardizing on MCP; the explainx.ai page compares cleanly with sibling servers.
We wired Read MySQL into a staging workspace; the listing’s GitHub and npm pointers saved time versus hunting across READMEs.
Read MySQL is among the better-indexed MCP projects we tried; the explainx.ai summary tracks the official description.
Read MySQL is a well-scoped MCP server in the explainx.ai directory — install snippets and categories matched our Claude Code setup.
Read MySQL is among the better-indexed MCP projects we tried; the explainx.ai summary tracks the official description.
Strong directory entry: Read MySQL surfaces stars and publisher context so we could sanity-check maintenance before adopting.
Read MySQL reduced integration guesswork — categories and install configs on the listing matched the upstream repo.
We wired Read MySQL into a staging workspace; the listing’s GitHub and npm pointers saved time versus hunting across READMEs.
Read MySQL has been reliable for tool-calling workflows; the MCP profile page is a good permalink for internal docs.
showing 1-10 of 52
🚀 This is a modified version optimized for Claude Code with SSH tunnel support
Original Author: @benborla29
Original Repository: https://github.com/benborla/mcp-server-mysql
License: MIT
MYSQL_DISABLE_READ_ONLY_TRANSACTIONS for CREATE TABLE supportA Model Context Protocol server that provides access to MySQL databases through SSH tunnels. This server enables Claude and other LLMs to inspect database schemas and execute SQL queries securely.
There are several ways to install and configure the MCP server but the most common would be checking this website https://smithery.ai/server/@benborla29/mcp-server-mysql
For Cursor IDE, you can install this MCP server with the following command in your project:
MCP Get provides a centralized registry of MCP servers and simplifies the installation process.
Codex CLI installation is similar to Claude Code below
codex mcp add mcp_server_mysql \
--env MYSQL_HOST="127.0.0.1" \
--env MYSQL_PORT="3306" \
--env MYSQL_USER="root" \
--env MYSQL_PASS="your_password" \
--env MYSQL_DB="your_database" \
--env ALLOW_INSERT_OPERATION="false" \
--env ALLOW_UPDATE_OPERATION="false" \
--env ALLOW_DELETE_OPERATION="false" \
-- npx -y @benborla29/mcp-server-mysql
If you already have this MCP server configured in Claude Desktop, you can import it automatically:
claude mcp add-from-claude-desktop
This will show an interactive dialog where you can select your mcp_server_mysql server to import with all existing configuration.
Using NPM/PNPM Global Installation:
First, install the package globally:
# Using npm
npm install -g @benborla29/mcp-server-mysql
# Using pnpm
pnpm add -g @benborla29/mcp-server-mysql
Then add the server to Claude Code:
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" \
-e ALLOW_INSERT_OPERATION="false" \
-e ALLOW_UPDATE_OPERATION="false" \
-e ALLOW_DELETE_OPERATION="false" \
-- npx @benborla29/mcp-server-mysql
Using Local Repository (for development):
If you're running from a cloned repository:
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" \
-e ALLOW_INSERT_OPERATION="false" \
-e ALLOW_UPDATE_OPERATION="false" \
-e ALLOW_DELETE_OPERATION="false" \
-e PATH="/path/to/node/bin:/usr/bin:/bin" \
-e NODE_PATH="/path/to/node/lib/node_modules" \
-- /path/to/node /full/path/to/mcp-server-mysql/dist/index.js
Replace:
/path/to/node with your Node.js binary path (find with which node)/full/path/to/mcp-server-mysql with the full path to your cloned repositoryUsing Unix Socket Connection:
For local MySQL instances using Unix sockets:
claude mcp add mcp_server_mysql \
-e MYSQL_SOCKET_PATH="/tmp/mysql.sock" \
-e MYSQL_USER="root" \
-e MYSQL_PASS="your_password" \
-e MYSQL_DB="your_database" \
-e ALLOW_INSERT_OPERATION="false" \
-e ALLOW_UPDATE_OPERATION="false" \
-e ALLOW_DELETE_OPERATION="false" \
-- npx @benborla29/mcp-server-mysql
Consider which scope to use based on your needs:
# Local scope (default) - only available in current project
claude mcp add mcp_server_mysql [options...]
# User scope - available across all your projects
claude mcp add mcp_server_mysql -s user [options...]
# Project scope - shared with team members via .mcp.json
claude mcp add mcp_server_mysql -s project [options...]
For database servers with credentials, local or user scope is recommended to keep credentials private.
After adding the server, verify it's configured correctly:
# List all configured servers
claude mcp list
# Get details for your MySQL server
claude mcp get mcp_server_mysql
# Check server status within Claude Code
/mcp
For multi-database mode, omit the MYSQL_DB environment variable:
claude mcp add mcp_server_mysql_multi \
-e MYSQL_HOST="127.0.0.1" \
-e MYSQL_PORT="3306" \
-e MYSQL_USER="root" \
-e MYSQL_PASS="your_password" \
-e MULTI_DB_WRITE_MODE="false" \
-- npx @benborla29/mcp-server-mysql
For advanced features, add additional environment variables:
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" \
-e MYSQL_POOL_SIZE="10" \
-e MYSQL_QUERY_TIMEOUT="30000" \
-e MYSQL_CACHE_TTL="60000" \
-e MYSQL_RATE_LIMIT="100" \
-e MYSQL_SSL="true" \
-e ALLOW_INSERT_OPERATION="false" \
-e ALLOW_UPDATE_OPERATION="false" \
-e ALLOW_DELETE_OPERATION="false" \
-e MYSQL_ENABLE_LOGGING="true" \
-- npx @benborla29/mcp-server-mysql
Server Connection Issues: Use /mcp command in Claude Code to check server status and authenticate if needed.
Path Issues: If using a local repository, ensure Node.js paths are correctly set:
# Find your Node.js path
which node
# For PATH environment variable
echo "$(which node)/../"
# For NODE_PATH environment variable
echo "$(which node)/../../lib/node_modules"
Permission Errors: Ensure your MySQL user has appropriate permissions for the operations you've enabled.
Server Not Starting: Check Claude Code logs or run the server directly to debug:
# Test the server directly
npx @benborla29/mcp-server-mysql
For manual installation:
# Using npm
npm install -g @benborla29/mcp-server-mysql
# Using pnpm
pnpm add -g @benborla29/mcp-server-mysql
After manual installation, you'll need to configure your LLM application to use the MCP server (see Configuration section below).
If you want to clone and run this MCP server directly from the source code, follow these steps:
Clone the repository
git clone https://github.com/benborla/mcp-server-mysql.git
cd mcp-server-mysql
Install dependencies
npm install
# or
pnpm install
Build the project
npm run build
# or
pnpm run build
Configure Claude Desktop
Add the following to your Claude Desktop configuration file (claude_desktop_config.json):
{
"mcpServers": {
"mcp_server_mysql": {
"command": "/path/to/node",
"args": [
"/full/path/to/mcp-server-mysql/dist/index.js"
],
"env": {
"MYSQL_HOST": "127.0.0.1",
"MYSQL_PORT": "3306",
"MYSQL_USER": "root",
"MYSQL_PASS": "your_password",
"MYSQL_DB": "your_database",
"ALLOW_INSERT_OPERATION": "false",
"ALLOW_UPDATE_OPERATION": "false",
"ALLOW_DELETE_OPERATION": "false",
"PATH": "/path/to/node/bin:/usr/bin:/bin", // <--- Important to add the following, run in your terminal `echo "$(which node)/../"` to get the path
"NODE_PATH": "/path/to/node/lib/node_modules" // <--- Important to add the following, run in your terminal `echo "$(which node)/../../lib/node_modules"`
}
}
}
}
Replace:
/path/to/node with the full path to your Node.js binary (find it with which node)/full/path/to/mcp-server-mysql with the full path to where yRun 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.